pytest-based UI tests add fix create instance

If delpoy has more than 1 external network, then creating
instance can fail because auto_ip create a floating ip under
an unreachable external network (different than public).

Change-Id: I1c894f4bde6f3a1d758be550fab946fedaa672e6
This commit is contained in:
Jan Jasek 2024-10-16 16:16:49 +02:00
parent 5d3bea0ae3
commit 66f61889b6

View File

@ -206,6 +206,10 @@ def new_instance_demo(complete_default_test_network, request, instance_name,
count = request.param[0]
auto_ip_param = request.param[1]
if auto_ip_param:
ip_pool_param = config.network.external_network
else:
ip_pool_param = None
instance = openstack_demo.create_server(
instance_name,
image=config.image.images_list[0],
@ -213,6 +217,7 @@ def new_instance_demo(complete_default_test_network, request, instance_name,
availability_zone=config.launch_instances.available_zone,
network=complete_default_test_network.name,
auto_ip=auto_ip_param,
ip_pool=ip_pool_param,
wait=True,
max_count=count,
)