Skip to content

Commit 00afc23

Browse files
committed
Create int tests for Reserved IPs: nodebalancers
1 parent 3961d4b commit 00afc23

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

test/integration/models/nodebalancer/test_nodebalancer.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
NodeBalancerNode,
1616
NodeBalancerType,
1717
RegionPrice,
18+
ReservedIPAddress,
1819
)
1920

2021
TEST_REGION = get_region(
@@ -113,6 +114,31 @@ def test_create_nb(test_linode_client, e2e_test_firewall):
113114
nb.delete()
114115

115116

117+
pytest.mark.skip() # TODO: Currently if fails to assign ReservedIP via ipv4 param, need to investigate
118+
def test_create_nb_with_reserved_ip(test_linode_client, e2e_test_firewall, create_reserved_ip):
119+
client = test_linode_client
120+
reserved_ip = create_reserved_ip
121+
label = get_test_label(8)
122+
123+
nb = client.nodebalancer_create(
124+
region=TEST_REGION,
125+
label=label,
126+
firewall=e2e_test_firewall.id,
127+
client_udp_sess_throttle=5,
128+
ipv4=reserved_ip.address,
129+
)
130+
131+
assert TEST_REGION, nb.region
132+
assert label == nb.label
133+
assert nb.ipv4.address == reserved_ip.address
134+
assert nb.ipv4.public == True
135+
assert nb.ipv4.reserved == True
136+
137+
nb.delete()
138+
reserved_ip = client.networking.reserved_ips(ReservedIPAddress.address==reserved_ip.address)[0]
139+
assert reserved_ip.assigned_entity is None
140+
141+
116142
def test_get_nodebalancer_config(test_linode_client, create_nb_config):
117143
config = test_linode_client.load(
118144
NodeBalancerConfig,

0 commit comments

Comments
 (0)