From e6d215119e54f5efa5f45b964037edc068ee9def Mon Sep 17 00:00:00 2001 From: Dmitrii Shcherbakov Date: Sat, 17 Jun 2023 14:59:03 +0400 Subject: [PATCH] Be specific about a FIP to be checked in CP tests The configure step for the DRAgent tests configures a name for a floating IP to be checked for at the peer side. Since the data plane tests add one as well for an instance, make sure the control plane-only tests rely on the FIP that has a specific name. This can be useful if the tests are run in a different order. --- zaza/openstack/charm_tests/dragent/tests.py | 3 ++- zaza/openstack/configure/bgp_speaker.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/zaza/openstack/charm_tests/dragent/tests.py b/zaza/openstack/charm_tests/dragent/tests.py index 67748c8..a32b0c8 100644 --- a/zaza/openstack/charm_tests/dragent/tests.py +++ b/zaza/openstack/charm_tests/dragent/tests.py @@ -26,6 +26,7 @@ from zaza.openstack.utilities import ( cli as cli_utils, juju as juju_utils, ) +from zaza.openstack.configure.bgp_speaker import NDR_TEST_FIP class DRAgentTest(neutron_tests.NeutronNetworkingBase): @@ -83,7 +84,7 @@ class DRAgentTest(neutron_tests.NeutronNetworkingBase): # Get expected advertised routes private_cidr = self.project_subnet['cidr'] floating_ip_cidr = "{}/32".format( - self.neutron_client.list_floatingips() + self.neutron_client.list_floatingips(name=NDR_TEST_FIP) ["floatingips"][0]["floating_ip_address"]) # This test may run immediately after configuration. diff --git a/zaza/openstack/configure/bgp_speaker.py b/zaza/openstack/configure/bgp_speaker.py index 94aba98..6144474 100755 --- a/zaza/openstack/configure/bgp_speaker.py +++ b/zaza/openstack/configure/bgp_speaker.py @@ -26,7 +26,7 @@ from zaza.openstack.utilities import ( ) -FIP_TEST = "FIP TEST" +NDR_TEST_FIP = "NDR_TEST_FIP" def setup_bgp_speaker(peer_application_name, keystone_session=None): @@ -90,7 +90,8 @@ def setup_bgp_speaker(peer_application_name, keystone_session=None): # Create Floating IP to advertise logging.info("Creating floating IP to advertise") port = openstack_utils.create_port(neutron_client, - FIP_TEST, openstack_utils.PRIVATE_NET) + NDR_TEST_FIP, + openstack_utils.PRIVATE_NET) floating_ip = openstack_utils.create_floating_ip(neutron_client, openstack_utils.EXT_NET, port=port)