Commit 20e06a3
committed
Fix variable shadowing and URL handling bugs in TestTLSDefaults
This commit fixes two bugs in the TLS test that were causing failures:
1. Variable shadowing bug (line 145):
- Changed `err := conn.Close()` to `closeErr := conn.Close()`
- The original code shadowed the outer `err` variable, making the
test logic confusing and error-prone
- Now the test correctly checks the Dial error, not the Close error
2. Missing URL prefix stripping in cipher test (line 168-170):
- Added `host := strings.TrimPrefix(oc.AdminConfig().Host, "https://")`
- The cipher test was trying to dial with "https://..." prefix
- tls.Dial expects "host:port" format, not a URL
3. Improved error handling in cipher test (line 172):
- Properly capture and use closeErr instead of calling conn.Close()
inline in the error message
These fixes address the test failures reported in:
periodic-ci-openshift-release-master-nightly-4.21-e2e-metal-ipi-ovn-bm
Related: PR #30533 (the revert), PR #29611 (original implementation)1 parent bc35cba commit 20e06a3
1 file changed
+29
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
137 | 148 | | |
138 | 149 | | |
139 | 150 | | |
140 | 151 | | |
141 | | - | |
142 | 152 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
148 | 158 | | |
149 | 159 | | |
150 | | - | |
| 160 | + | |
151 | 161 | | |
152 | 162 | | |
153 | 163 | | |
| |||
164 | 174 | | |
165 | 175 | | |
166 | 176 | | |
167 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
168 | 185 | | |
169 | | - | |
170 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
171 | 189 | | |
172 | | - | |
| 190 | + | |
173 | 191 | | |
174 | 192 | | |
175 | 193 | | |
| |||
0 commit comments