Skip to content

Commit fba9576

Browse files
Re-add integration test
1 parent 25d4024 commit fba9576

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

tests/integration/linodes/test_interfaces.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,62 @@
1717
linode_label = DEFAULT_LABEL + timestamp
1818

1919

20+
@pytest.fixture
21+
def linode_with_vpc_interface_as_args(linode_cloud_firewall):
22+
"""
23+
NOTE: This is fixture exists to accommodate a regression test.
24+
For new tests, use linode_with_vpc_interface_as_json.
25+
"""
26+
27+
vpc_json = create_vpc_w_subnet()
28+
29+
vpc_region = vpc_json["region"]
30+
vpc_id = str(vpc_json["id"])
31+
subnet_id = str(vpc_json["subnets"][0]["id"])
32+
33+
linode_json = json.loads(
34+
exec_test_command(
35+
BASE_CMD
36+
+ [
37+
"create",
38+
"--type",
39+
"g6-nanode-1",
40+
"--region",
41+
vpc_region,
42+
"--image",
43+
DEFAULT_TEST_IMAGE,
44+
"--root_pass",
45+
DEFAULT_RANDOM_PASS,
46+
"--firewall_id",
47+
linode_cloud_firewall,
48+
"--interfaces.purpose",
49+
"vpc",
50+
"--interfaces.primary",
51+
"true",
52+
"--interfaces.subnet_id",
53+
subnet_id,
54+
"--interfaces.ipv4.nat_1_1",
55+
"any",
56+
"--interfaces.ipv4.vpc",
57+
"10.0.0.5",
58+
"--interfaces.ip_ranges",
59+
json.dumps(["10.0.0.6/32"]),
60+
"--interfaces.purpose",
61+
"public",
62+
"--json",
63+
"--suppress-warnings",
64+
]
65+
)
66+
.stdout.decode()
67+
.rstrip()
68+
)[0]
69+
70+
yield linode_json, vpc_json
71+
72+
delete_target_id(target="linodes", id=str(linode_json["id"]))
73+
delete_target_id(target="vpcs", id=vpc_id)
74+
75+
2076
@pytest.fixture
2177
def linode_with_vpc_interface_as_json(linode_cloud_firewall):
2278
vpc_json = create_vpc_w_subnet()
@@ -99,5 +155,9 @@ def assert_interface_configuration(
99155
assert public_interface["purpose"] == "public"
100156

101157

158+
def test_with_vpc_interface_as_args(linode_with_vpc_interface_as_args):
159+
assert_interface_configuration(*linode_with_vpc_interface_as_args)
160+
161+
102162
def test_with_vpc_interface_as_json(linode_with_vpc_interface_as_json):
103163
assert_interface_configuration(*linode_with_vpc_interface_as_json)

0 commit comments

Comments
 (0)