Skip to content

Commit 928e1ec

Browse files
committed
Add fixture for Reserved IP created in the NAT Gateway region
1 parent f1074b5 commit 928e1ec

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

‎test/integration/models/networking/test_networking.py‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,18 @@ def create_firewall_with_device(create_linode_without_firewall):
128128
firewall.delete()
129129

130130

131+
@pytest.fixture
132+
def create_nat_reserved_ip(test_linode_client, create_nat_gateway):
133+
client = test_linode_client
134+
gateway = create_nat_gateway
135+
136+
reserved_ip = client.networking.reserved_ip_create(region=gateway.region)
137+
138+
yield reserved_ip
139+
140+
reserved_ip.delete()
141+
142+
131143
@pytest.fixture
132144
def create_nat_vpc_with_subnet(test_linode_client, create_nat_vpc):
133145
subnet = create_nat_vpc.subnet_create(
@@ -660,10 +672,10 @@ def test_update_nat_gateway(test_linode_client, create_nat_gateway):
660672

661673
@pytest.mark.parametrize("create_nat_gateway", [False], indirect=True)
662674
def test_assign_nat_gateway_ip_address(
663-
test_linode_client, create_nat_gateway, create_reserved_ip
675+
test_linode_client, create_nat_gateway, create_nat_reserved_ip
664676
):
665677
gateway = create_nat_gateway
666-
reserved_ip = create_reserved_ip
678+
reserved_ip = create_nat_reserved_ip
667679

668680
gateway.address_assignment_create(reserved_ip.address)
669681

@@ -685,12 +697,12 @@ def test_get_nat_gateway_linode_ifaces(
685697
e2e_test_firewall,
686698
create_nat_gateway,
687699
create_nat_vpc_with_subnet_and_linode,
688-
create_reserved_ip,
700+
create_nat_reserved_ip,
689701
):
690702
client = test_linode_client
691703
gateway = create_nat_gateway
692704
vpc, subnet, linode = create_nat_vpc_with_subnet_and_linode
693-
reserved_ip = create_reserved_ip
705+
reserved_ip = create_nat_reserved_ip
694706

695707
gateway.address_assignment_create(reserved_ip.address)
696708
# Link the NAT Gateway to the VPC Subnet

0 commit comments

Comments
 (0)