|
1 | 1 | import json |
2 | 2 |
|
3 | 3 | import pytest |
| 4 | +from pytest import MonkeyPatch |
4 | 5 |
|
5 | 6 | from tests.integration.helpers import ( |
6 | 7 | delete_target_id, |
@@ -43,7 +44,7 @@ def linode_interface_vlan(linode_cloud_firewall): |
43 | 44 |
|
44 | 45 | yield linode_id |
45 | 46 |
|
46 | | - # delete_target_id(target="linodes", id=linode_id) |
| 47 | + delete_target_id(target="linodes", id=linode_id) |
47 | 48 |
|
48 | 49 |
|
49 | 50 | @pytest.fixture(scope="session") |
@@ -143,7 +144,8 @@ def get_ipv4_addr(linode_id: "str"): |
143 | 144 | return str(ipv4_addr) |
144 | 145 |
|
145 | 146 |
|
146 | | -def test_interface_add(linode_cloud_firewall): |
| 147 | +def test_interface_add(linode_cloud_firewall, monkeypatch: MonkeyPatch): |
| 148 | + monkeypatch.setenv("LINODE_CLI_API_VERSION", "v4beta") |
147 | 149 | linode_id = create_linode( |
148 | 150 | firewall_id=linode_cloud_firewall, |
149 | 151 | test_region="us-sea", |
@@ -214,9 +216,10 @@ def test_interface_add(linode_cloud_firewall): |
214 | 216 | delete_target_id(target="linodes", id=linode_id) |
215 | 217 |
|
216 | 218 |
|
217 | | -def test_interface_firewalls_list(linode_interface_public): |
218 | | - linode_id = linode_interface_public |
| 219 | +def test_interface_firewalls_list(linode_interface_public, monkeypatch: MonkeyPatch): |
| 220 | + monkeypatch.setenv("LINODE_CLI_API_VERSION", "v4beta") |
219 | 221 |
|
| 222 | + linode_id = linode_interface_public |
220 | 223 | interface_id = get_interface_id(linode_id) |
221 | 224 |
|
222 | 225 | data = json.loads( |
@@ -247,9 +250,10 @@ def test_interface_firewalls_list(linode_interface_public): |
247 | 250 | assert "rules" in firewall and isinstance(firewall["rules"], dict) |
248 | 251 |
|
249 | 252 |
|
250 | | -def test_interface_settings_update(linode_interface_public): |
251 | | - linode_id = linode_interface_public |
| 253 | +def test_interface_settings_update(linode_interface_public, monkeypatch: MonkeyPatch): |
| 254 | + monkeypatch.setenv("LINODE_CLI_API_VERSION", "v4beta") |
252 | 255 |
|
| 256 | + linode_id = linode_interface_public |
253 | 257 | interface_id = get_interface_id(linode_id) |
254 | 258 |
|
255 | 259 | data = json.loads( |
@@ -286,7 +290,9 @@ def test_interface_settings_update(linode_interface_public): |
286 | 290 | assert default_route["ipv6_eligible_interface_ids"] == [int(interface_id)] |
287 | 291 |
|
288 | 292 |
|
289 | | -def test_interface_update(linode_interface_public): |
| 293 | +def test_interface_update(linode_interface_public, monkeypatch: MonkeyPatch): |
| 294 | + monkeypatch.setenv("LINODE_CLI_API_VERSION", "v4beta") |
| 295 | + |
290 | 296 | linode_id = linode_interface_public |
291 | 297 | interface_id = get_interface_id(linode_id) |
292 | 298 | ipv4_addr = get_ipv4_addr(linode_id) |
@@ -340,9 +346,10 @@ def test_interface_update(linode_interface_public): |
340 | 346 | assert all("range" in r and r["range"].endswith("/64") for r in ipv6_ranges) |
341 | 347 |
|
342 | 348 |
|
343 | | -def test_interface_view(linode_interface_vpc): |
344 | | - linode_id = linode_interface_vpc |
| 349 | +def test_interface_view(linode_interface_vpc, monkeypatch: MonkeyPatch): |
| 350 | + monkeypatch.setenv("LINODE_CLI_API_VERSION", "v4beta") |
345 | 351 |
|
| 352 | + linode_id = linode_interface_vpc |
346 | 353 | interface_id = get_interface_id(linode_id) |
347 | 354 |
|
348 | 355 | data = json.loads( |
@@ -379,7 +386,8 @@ def test_interface_view(linode_interface_vpc): |
379 | 386 | ) |
380 | 387 |
|
381 | 388 |
|
382 | | -def test_interfaces_list(linode_interface_vlan): |
| 389 | +def test_interfaces_list(linode_interface_vlan, monkeypatch: MonkeyPatch): |
| 390 | + monkeypatch.setenv("LINODE_CLI_API_VERSION", "v4beta") |
383 | 391 | linode_id = linode_interface_vlan |
384 | 392 |
|
385 | 393 | data = json.loads( |
@@ -418,7 +426,9 @@ def test_interfaces_list(linode_interface_vlan): |
418 | 426 |
|
419 | 427 |
|
420 | 428 | @pytest.mark.flaky(reruns=3, reruns_delay=2) |
421 | | -def test_interfaces_upgrade(linode_interface_legacy): |
| 429 | +def test_interfaces_upgrade(linode_interface_legacy, monkeypatch: MonkeyPatch): |
| 430 | + monkeypatch.setenv("LINODE_CLI_API_VERSION", "v4beta") |
| 431 | + |
422 | 432 | linode_id = linode_interface_legacy |
423 | 433 |
|
424 | 434 | # wait boot/provisioning |
|
0 commit comments