From c4ac6f6475fe7a6b7ebceba1a7af3ee6af5138fe Mon Sep 17 00:00:00 2001 From: Periyasamy Palanisamy Date: Mon, 18 Jun 2018 12:30:55 +0200 Subject: Use Neutron API for attaching floating ip address The Nova API for attaching floating ip address with vm instance is removed in latest Openstack release. Hence moving to neutron API for attaching floating ip address with VM. JIRA: SDNVPN-217 Change-Id: If321191eca0915cfd816eabc8890b28ed79cefc7 Signed-off-by: Periyasamy Palanisamy --- sdnvpn/test/functest/testcase_8.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'sdnvpn/test/functest/testcase_8.py') diff --git a/sdnvpn/test/functest/testcase_8.py b/sdnvpn/test/functest/testcase_8.py index e667dba..6336f46 100644 --- a/sdnvpn/test/functest/testcase_8.py +++ b/sdnvpn/test/functest/testcase_8.py @@ -154,21 +154,23 @@ def main(): msg = "Assign a Floating IP to %s" % vm_1.name results.record_action(msg) - fip = os_utils.create_floating_ip(neutron_client) + vm1_port = test_utils.get_port(neutron_client, vm_1.id) + fip_added = os_utils.attach_floating_ip(neutron_client, + vm1_port['id']) - fip_added = os_utils.add_floating_ip(nova_client, - vm_1.id, fip['fip_addr']) if fip_added: results.add_success(msg) else: results.add_failure(msg) + fip = fip_added['floatingip']['floating_ip_address'] + results.add_to_summary(0, "=") results.record_action("Ping %s via Floating IP" % vm_1.name) results.add_to_summary(0, "-") - results.ping_ip_test(fip['fip_addr']) + results.ping_ip_test(fip) - floatingip_ids.append(fip['fip_id']) + floatingip_ids.append(fip_added['floatingip']['id']) except Exception as e: logger.error("exception occurred while executing testcase_8: %s", e) -- cgit 1.2.3-korg