Skip to content

Commit 8d721b5

Browse files
sdf
1 parent b2ad81f commit 8d721b5

File tree

2 files changed

+17
-27
lines changed

2 files changed

+17
-27
lines changed

linode_api4/objects/linode_interfaces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class LinodeInterfaceVPCIPv4AddressOptions(JSONObject):
6666
Options accepted for a single address when creating or updating the IPv4 configuration of a VPC Linode Interface.
6767
"""
6868

69-
address: str = ""
69+
address: Optional[str] = None
7070
primary: Optional[bool] = None
7171
nat_1_1_address: Optional[str] = None
7272

test/integration/models/linode/interfaces/test_interfaces.py

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import ipaddress
2-
from test.integration.conftest import get_region
32
from test.integration.helpers import get_test_label
43

54
import pytest
@@ -16,21 +15,19 @@
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")
2725
def 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+
227225
def 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

Comments
 (0)