diff options
author | Stamatis Katsaounis <mokats@intracom-telecom.com> | 2018-09-06 14:44:48 +0300 |
---|---|---|
committer | Stamatis Katsaounis <mokats@intracom-telecom.com> | 2018-11-01 16:25:02 +0200 |
commit | 72eb4c28889c56340c7ae222c8199e564ba46e41 (patch) | |
tree | 2d935a4bf48d211c664945a6fa50c1d25f2d7684 /sdnvpn/test/functest/testcase_13.py | |
parent | 93fa759def8b61029ef1bb08b491a66cb7ddeb17 (diff) |
Replace neutron client calls with openstack sdk
JIRA: SDNVPN-237
JIRA: SDNVPN-220
This patch replaces almost all calls of neutron client with
openstack sdk. The calls regarding bgpvpn are not replaced
due to lack of support from openstack sdk at the moment.
Change-Id: Idf52b8c57b895f87ba6320e350bf170faa24d0a7
Signed-off-by: Stamatis Katsaounis <mokats@intracom-telecom.com>
(cherry picked from commit ebf6885a907379083b360ae729f69151c1dd8115)
Diffstat (limited to 'sdnvpn/test/functest/testcase_13.py')
-rw-r--r-- | sdnvpn/test/functest/testcase_13.py | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/sdnvpn/test/functest/testcase_13.py b/sdnvpn/test/functest/testcase_13.py index 4152c67..e15c8f1 100644 --- a/sdnvpn/test/functest/testcase_13.py +++ b/sdnvpn/test/functest/testcase_13.py @@ -36,7 +36,7 @@ def main(): if not os.path.isfile(COMMON_CONFIG.ubuntu_image_path): logger.info("Downloading image") image_dest_path = '/'.join( - COMMON_CONFIG.ubuntu_image_path.split('/')[:-1]) + COMMON_CONFIG.ubuntu_image_path.split('/')[:-1]) os_utils.download_url( "http://artifacts.opnfv.org/sdnvpn/" "ubuntu-16.04-server-cloudimg-amd64-disk1.img", @@ -45,7 +45,6 @@ def main(): logger.info("Using old image") neutron_client = os_utils.get_neutron_client() - conn = os_utils.get_os_connection() (floatingip_ids, instance_ids, router_ids, network_ids, image_ids, subnet_ids, interfaces, bgpvpn_ids, flavor_ids) = ([] for i in range(9)) @@ -64,7 +63,7 @@ def main(): flavor_ids.append(flavor_id) network_1_id, subnet_1_id, router_1_id = test_utils.create_network( - neutron_client, + conn, TESTCASE_CONFIG.net_1_name, TESTCASE_CONFIG.subnet_1_name, TESTCASE_CONFIG.subnet_1_cidr, @@ -76,7 +75,7 @@ def main(): router_ids.extend([router_1_id]) sg_id = os_utils.create_security_group_full( - neutron_client, TESTCASE_CONFIG.secgroup_name, + conn, TESTCASE_CONFIG.secgroup_name, TESTCASE_CONFIG.secgroup_descr) compute_nodes = test_utils.assert_and_get_compute_nodes(conn) @@ -102,13 +101,13 @@ def main(): userdata=u1) vm_1_ip = test_utils.get_instance_ip(conn, vm_1) - vm1_port = test_utils.get_port(neutron_client, vm_1.id) + vm1_port = test_utils.get_port(conn, vm_1.id) test_utils.update_port_allowed_address_pairs( - neutron_client, - vm1_port['id'], + conn, + vm1_port.id, [test_utils.AllowedAddressPair( TESTCASE_CONFIG.extra_route_cidr, - vm1_port['mac_address'])]) + vm1_port.mac_address)]) vm_2 = test_utils.create_instance( conn, @@ -122,13 +121,13 @@ def main(): userdata=u1) vm_2_ip = test_utils.get_instance_ip(conn, vm_2) - vm2_port = test_utils.get_port(neutron_client, vm_2.id) + vm2_port = test_utils.get_port(conn, vm_2.id) test_utils.update_port_allowed_address_pairs( - neutron_client, - vm2_port['id'], + conn, + vm2_port.id, [test_utils.AllowedAddressPair( TESTCASE_CONFIG.extra_route_cidr, - vm2_port['mac_address'])]) + vm2_port.mac_address)]) test_utils.async_Wait_for_instances([vm_1, vm_2]) @@ -184,7 +183,7 @@ def main(): neutron_client, bgpvpn_id, router_1_id) test_utils.update_router_extra_route( - neutron_client, router_1_id, + conn, router_1_id, [test_utils.ExtraRoute(TESTCASE_CONFIG.extra_route_cidr, vm_1_ip), test_utils.ExtraRoute(TESTCASE_CONFIG.extra_route_cidr, @@ -207,10 +206,10 @@ def main(): logger.error("exception occurred while executing testcase_13: %s", e) raise finally: - test_utils.update_router_no_extra_route(neutron_client, router_ids) + test_utils.update_router_no_extra_route(conn, router_ids) test_utils.cleanup_nova(conn, instance_ids, flavor_ids) test_utils.cleanup_glance(conn, image_ids) - test_utils.cleanup_neutron(neutron_client, floatingip_ids, + test_utils.cleanup_neutron(conn, neutron_client, floatingip_ids, bgpvpn_ids, interfaces, subnet_ids, router_ids, network_ids) |