From 70f8479bf1d300a7892ae56f06d7e60fc70e6107 Mon Sep 17 00:00:00 2001 From: Juan Vidal Date: Tue, 21 Feb 2017 12:49:32 +0000 Subject: Remove get_floating_ip_2 from sfc_symmetric_chain Using the new functions in functest to retrieve the nova ID for a VNF instance, it is possible to use a generic solution at the problem of getting floating ips deterministcally to the instances Change-Id: Ie77820b0f466dcbf8ac771f12b5aee55ef74ead5 Signed-off-by: Juan Vidal --- sfc/tests/functest/sfc_symmetric_chain.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'sfc/tests/functest') diff --git a/sfc/tests/functest/sfc_symmetric_chain.py b/sfc/tests/functest/sfc_symmetric_chain.py index d82303a2..3e7ff240 100644 --- a/sfc/tests/functest/sfc_symmetric_chain.py +++ b/sfc/tests/functest/sfc_symmetric_chain.py @@ -105,7 +105,7 @@ def main(): logger.info('Topology description: {0}' .format(testTopology['description'])) - test_utils.create_instance( + client_instance = test_utils.create_instance( nova_client, CLIENT, COMMON_CONFIG.flavor, @@ -148,6 +148,8 @@ def main(): logger.error('ERROR while booting VNF') sys.exit(1) + vnf_instance_id = test_utils.get_nova_id(tacker_client, 'vdu1', vnf_id) + os_tacker.create_sfc( tacker_client, sfc_name='red', @@ -180,9 +182,20 @@ def main(): except Exception, e: logger.error("Unable to start the thread that counts time %s" % e) - # TODO: Find a replacement for get_floating_ips() - server_floating_ip, client_floating_ip, sf_floating_ip = \ - test_utils.get_floating_ips_2(nova_client, neutron_client) + logger.info("Assigning floating IPs to instances") + server_floating_ip = test_utils.assign_floating_ip( + nova_client, neutron_client, server_instance.id) + client_floating_ip = test_utils.assign_floating_ip( + nova_client, neutron_client, client_instance.id) + sf_floating_ip = test_utils.assign_floating_ip( + nova_client, neutron_client, vnf_instance_id) + + for ip in (server_floating_ip, client_floating_ip, sf_floating_ip): + logger.info("Checking connectivity towards floating IP [%s]" % ip) + if not test_utils.ping(ip, retries=50, retry_timeout=1): + logger.error("Cannot ping floating IP [%s]" % ip) + sys.exit(1) + logger.info("Successful ping to floating IP [%s]" % ip) if not test_utils.check_ssh([sf_floating_ip]): logger.error("Cannot establish SSH connection to the SFs") -- cgit 1.2.3-korg