11import ipaddress
2- from test .integration .conftest import get_region
32from test .integration .helpers import get_test_label
43
54import pytest
1615 LinodeInterfacePublicIPv6RangeOptions ,
1716 LinodeInterfacePublicOptions ,
1817 LinodeInterfaceVLANOptions ,
19- LinodeInterfaceVPCOptions , LinodeInterfaceVPCIPv4Options , LinodeInterfaceVPCIPv4AddressOptions ,
20- LinodeInterfaceVPCIPv4Range ,
18+ LinodeInterfaceVPCIPv4Options ,
2119 LinodeInterfaceVPCIPv4RangeOptions ,
20+ LinodeInterfaceVPCOptions ,
2221)
2322
2423
25-
26- @pytest .fixture
24+ @pytest .fixture (scope = "function" )
2725def instance_with_interface_generation_linode (
2826 test_linode_client ,
2927 e2e_test_firewall ,
30-
3128 # We won't be using this all the time, but it's
3229 # necessary for certain consumers of this fixture
33- create_vpc_with_subnet
30+ create_vpc_with_subnet ,
3431):
3532 client = test_linode_client
3633
@@ -224,6 +221,7 @@ def test_linode_interface_create_public(
224221 assert iface .public .ipv6 .slaac [0 ].prefix == 64
225222 assert len (iface .public .ipv6 .shared ) == 0
226223
224+
227225def test_linode_interface_create_vpc (
228226 test_linode_client ,
229227 e2e_test_firewall ,
@@ -232,16 +230,7 @@ def test_linode_interface_create_vpc(
232230):
233231 instance : Instance = instance_with_interface_generation_linode
234232 vpc , subnet = create_vpc_with_subnet
235- subnet_network = ipaddress .ip_network (subnet .ipv4 )
236-
237- print (vars (subnet ))
238-
239- # + 10 is an arbitrary offset because the subnet fixture is session scoped.
240- subnet_allocated_ip = next (v for i , v in enumerate (subnet_network .hosts ()) if v == 10 )
241-
242- ipv6_range = test_linode_client .networking .ipv6_range_allocate (
243- 64 , linode = instance .id
244- )
233+ # subnet_network = ipaddress.ip_network(subnet.ipv4)
245234
246235 iface = instance .interface_create (
247236 firewall_id = e2e_test_firewall .id ,
@@ -251,19 +240,20 @@ def test_linode_interface_create_vpc(
251240 vpc = LinodeInterfaceVPCOptions (
252241 subnet_id = subnet .id ,
253242 ipv4 = LinodeInterfaceVPCIPv4Options (
254- addresses = [
255- LinodeInterfaceVPCIPv4AddressOptions (
256- address = str (subnet_allocated_ip ),
257- primary = True ,
258- nat_1_1_address = "any" ,
259- )
260- ],
243+ # TODO (Enhanced Interfaces): Not currently working as expected
244+ # addresses=[
245+ # LinodeInterfaceVPCIPv4AddressOptions(
246+ # address="auto",
247+ # primary=True,
248+ # nat_1_1_address="any",
249+ # )
250+ # ],
261251 ranges = [
262252 LinodeInterfaceVPCIPv4RangeOptions (
263- range = str ( subnet_allocated_ip ) + "/32 " ,
253+ range = "/29 " ,
264254 )
265255 ]
266- )
256+ ),
267257 ),
268258 )
269259
0 commit comments