Commit 415e7eb
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 415e7eb
1 file changed
+37
-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 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
137 | 152 | | |
138 | 153 | | |
139 | 154 | | |
140 | 155 | | |
141 | | - | |
142 | 156 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
148 | 164 | | |
| 165 | + | |
| 166 | + | |
149 | 167 | | |
150 | | - | |
| 168 | + | |
151 | 169 | | |
152 | 170 | | |
153 | 171 | | |
| |||
164 | 182 | | |
165 | 183 | | |
166 | 184 | | |
167 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
168 | 193 | | |
169 | | - | |
170 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
171 | 197 | | |
172 | | - | |
| 198 | + | |
173 | 199 | | |
174 | 200 | | |
175 | 201 | | |
| |||
0 commit comments