aboutsummaryrefslogtreecommitdiffstats
path: root/sfc/tests/functest/sfc_symmetric_chain.py
diff options
context:
space:
mode:
authorJuan Vidal <juan.vidal.allende@ericsson.com>2017-02-21 12:49:32 +0000
committerJuan Vidal <juan.vidal.allende@ericsson.com>2017-03-01 09:29:15 +0000
commit70f8479bf1d300a7892ae56f06d7e60fc70e6107 (patch)
treed45380c511fd6cb52824eab2b0633cf24b3f5154 /sfc/tests/functest/sfc_symmetric_chain.py
parentcaa4f781910cf8a4ecac82cdae7de50ccd216f3b (diff)
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 <juan.vidal.allende@ericsson.com>
Diffstat (limited to 'sfc/tests/functest/sfc_symmetric_chain.py')
-rw-r--r--sfc/tests/functest/sfc_symmetric_chain.py21
1 files changed, 17 insertions, 4 deletions
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")