1
1
import ipaddress
2
- from test .integration .conftest import get_region
3
2
from test .integration .helpers import get_test_label
4
3
5
4
import pytest
16
15
LinodeInterfacePublicIPv6RangeOptions ,
17
16
LinodeInterfacePublicOptions ,
18
17
LinodeInterfaceVLANOptions ,
19
- LinodeInterfaceVPCOptions , LinodeInterfaceVPCIPv4Options , LinodeInterfaceVPCIPv4AddressOptions ,
20
- LinodeInterfaceVPCIPv4Range ,
18
+ LinodeInterfaceVPCIPv4Options ,
21
19
LinodeInterfaceVPCIPv4RangeOptions ,
20
+ LinodeInterfaceVPCOptions ,
22
21
)
23
22
24
23
25
-
26
- @pytest .fixture
24
+ @pytest .fixture (scope = "function" )
27
25
def instance_with_interface_generation_linode (
28
26
test_linode_client ,
29
27
e2e_test_firewall ,
30
-
31
28
# We won't be using this all the time, but it's
32
29
# necessary for certain consumers of this fixture
33
- create_vpc_with_subnet
30
+ create_vpc_with_subnet ,
34
31
):
35
32
client = test_linode_client
36
33
@@ -224,6 +221,7 @@ def test_linode_interface_create_public(
224
221
assert iface .public .ipv6 .slaac [0 ].prefix == 64
225
222
assert len (iface .public .ipv6 .shared ) == 0
226
223
224
+
227
225
def test_linode_interface_create_vpc (
228
226
test_linode_client ,
229
227
e2e_test_firewall ,
@@ -232,16 +230,7 @@ def test_linode_interface_create_vpc(
232
230
):
233
231
instance : Instance = instance_with_interface_generation_linode
234
232
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)
245
234
246
235
iface = instance .interface_create (
247
236
firewall_id = e2e_test_firewall .id ,
@@ -251,19 +240,20 @@ def test_linode_interface_create_vpc(
251
240
vpc = LinodeInterfaceVPCOptions (
252
241
subnet_id = subnet .id ,
253
242
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
+ # ],
261
251
ranges = [
262
252
LinodeInterfaceVPCIPv4RangeOptions (
263
- range = str ( subnet_allocated_ip ) + "/32 " ,
253
+ range = "/29 " ,
264
254
)
265
255
]
266
- )
256
+ ),
267
257
),
268
258
)
269
259
0 commit comments