Commit 04b7167
committed
Add integration tests for allowed IP removal
Add testRemoveManyIPs to the integration tests to exercise the direct
allowed IP removal capability and run the test suite on all platforms.
$ WGCTRL_INTEGRATION go test .
┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓
┃ OPERATING SYSTEM ┃ DRIVER ┃ REMOVE IP SUPPORTED ┃ RESULT ┃
┡━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━┩
│ FreeBSD 14.2 │ native │ no │ PASS │
├──────────────────┼──────────────┼─────────────────────┼────────┤
│ OpenBSD 7.7 │ native │ no │ PASS* │
├──────────────────┼──────────────┼─────────────────────┼────────┤
│ Windows 11 │ native │ no │ PASS** │
├──────────────────┼──────────────┼─────────────────────┼────────┤
│ Linux │ native │ no │ PASS │
├──────────────────┼──────────────┼─────────────────────┼────────┤
│ Linux │ wireguard-go │ no │ PASS │
├──────────────────┼──────────────┼─────────────────────┼────────┤
│ Linux │ native │ yes │ PASS │
├──────────────────┼──────────────┼─────────────────────┼────────┤
│ Linux │ wireguard-go │ yes │ PASS │
└──────────────────┴──────────────┴─────────────────────┴────────┘
I compiled Linux from the bpf-next/master tree which includes
commit ba3d7b93dbe3 ("wireguard: allowedips: add WGALLOWEDIP_F_REMOVE_ME
flag") and wireguard-go from the head of master which includes commit
256bcbd70d5b ("device: add support for removing allowedips
individually") to test platforms with native support.
On systems where direct IP removal is not supported, I also made sure
that ConfigureDevice returns an error when Remove is used without the
shim.
* OpenBSD skips this test case, since the driver is read only.
** Two assertions fail in Windows due to missing protocol version, but
testRemoveManyIPs passes.
Signed-off-by: Jordan Rife <jordan@jrife.io>1 parent b8c2887 commit 04b7167
1 file changed
Lines changed: 105 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
46 | 54 | | |
47 | 55 | | |
48 | 56 | | |
| |||
91 | 99 | | |
92 | 100 | | |
93 | 101 | | |
94 | | - | |
| 102 | + | |
95 | 103 | | |
96 | 104 | | |
97 | 105 | | |
98 | 106 | | |
99 | 107 | | |
100 | 108 | | |
101 | 109 | | |
102 | | - | |
| 110 | + | |
103 | 111 | | |
104 | 112 | | |
105 | 113 | | |
| |||
112 | 120 | | |
113 | 121 | | |
114 | 122 | | |
115 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
116 | 129 | | |
117 | 130 | | |
118 | 131 | | |
| |||
223 | 236 | | |
224 | 237 | | |
225 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
226 | 327 | | |
227 | 328 | | |
228 | 329 | | |
| |||
0 commit comments