11from test .integration .conftest import get_region
2+ from test .integration .helpers import get_test_label
23
34import pytest
45
@@ -11,6 +12,7 @@ def test_get_vpc(test_linode_client, create_vpc):
1112 test_linode_client .vpcs ()
1213 assert vpc .id == create_vpc .id
1314 assert isinstance (vpc .ipv6 [0 ].range , str )
15+ assert vpc .vpc_type == "regular"
1416
1517
1618@pytest .mark .smoke
@@ -38,6 +40,8 @@ def test_get_subnet(test_linode_client, create_vpc_with_subnet):
3840 vpc .ipv6 [0 ].range .split ("::" )[0 ]
3941 )
4042 assert loaded_subnet .id == subnet .id
43+ assert loaded_subnet .vpc_type == "regular"
44+ assert loaded_subnet .vpc_type == vpc .vpc_type
4145
4246
4347@pytest .mark .smoke
@@ -139,3 +143,38 @@ def test_get_vpc_ipv6s(test_linode_client):
139143 assert "vpc_id" in ipv6
140144 assert isinstance (ipv6 ["ipv6_range" ], str )
141145 assert isinstance (ipv6 ["ipv6_addresses" ], list )
146+
147+
148+ def test_get_vpc_with_rdma_type (test_linode_client , create_vpc_with_rdma_type ):
149+ vpc_rdma = create_vpc_with_rdma_type
150+ assert vpc_rdma .vpc_type == "rdma"
151+
152+ vpc = test_linode_client .load (VPC , vpc_rdma .id )
153+ assert vpc .id == vpc_rdma .id
154+ assert vpc .vpc_type == vpc_rdma .vpc_type
155+
156+ vpc = test_linode_client .vpcs (VPC .vpc_type == "rdma" )[0 ]
157+ assert vpc .id == vpc_rdma .id
158+ assert vpc .vpc_type == vpc_rdma .vpc_type
159+
160+
161+ def test_get_subnet_with_rdma_type (
162+ request , test_linode_client , create_vpc_with_rdma_type
163+ ):
164+ vpc_rdma = create_vpc_with_rdma_type
165+ label = get_test_label (length = 10 )
166+
167+ subnet_rdma = create_vpc_with_rdma_type .subnet_create (
168+ label = label ,
169+ ipv4 = "10.0.0.0/24" ,
170+ )
171+
172+ # clean-up after test
173+ request .addfinalizer (subnet_rdma .delete )
174+
175+ assert subnet_rdma .vpc_type == vpc_rdma .vpc_type
176+ assert subnet_rdma .ipv6 is None
177+
178+ subnet = test_linode_client .load (VPCSubnet , subnet_rdma .id , vpc_rdma .id )
179+ assert subnet .id == subnet_rdma .id
180+ assert subnet .ipv6 is None
0 commit comments