From c401e6bac701ced8299dc3577841e9117f23b9f0 Mon Sep 17 00:00:00 2001 From: Bharath bhushan patel Date: Fri, 5 Oct 2018 05:27:31 +0000 Subject: [PATCH] Manager parsing for nsxv is added The designate related testcases were failing as the api call to get transportzone from nsxv was failing as the manager client object was not parsed to do so, added the code to handle it. Change-Id: I49e5867dee5b42951d1dc66b304651aacf31e0c0 --- .../tests/scenario/test_designate.py | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/vmware_nsx_tempest_plugin/tests/scenario/test_designate.py b/vmware_nsx_tempest_plugin/tests/scenario/test_designate.py index d445cd2..401273a 100644 --- a/vmware_nsx_tempest_plugin/tests/scenario/test_designate.py +++ b/vmware_nsx_tempest_plugin/tests/scenario/test_designate.py @@ -25,7 +25,7 @@ from tempest.lib import exceptions as lib_exc from vmware_nsx_tempest_plugin.common import constants as const from vmware_nsx_tempest_plugin.lib import feature_manager from vmware_nsx_tempest_plugin.services import nsxv3_client - +from vmware_nsx_tempest_plugin.services import nsxv_client CONF = config.CONF @@ -49,10 +49,17 @@ class TestZonesV2Ops(feature_manager.FeatureManager): @classmethod def resource_setup(cls): super(TestZonesV2Ops, cls).resource_setup() - cls.nsx = nsxv3_client.NSXV3Client(CONF.nsxv3.nsx_manager, - CONF.nsxv3.nsx_user, - CONF.nsxv3.nsx_password) - out = cls.nsx.get_transport_zones() + if CONF.network.backend == 'nsxv': + manager_ip = CONF.nsxv.manager_uri.split("/")[2] + cls.nsx = nsxv_client.VSMClient(manager_ip, + CONF.nsxv.user, + CONF.nsxv.password) + out = cls.nsx.get_all_vdn_scopes() + else: + cls.nsx = nsxv3_client.NSXV3Client(CONF.nsxv3.nsx_manager, + CONF.nsxv3.nsx_user, + CONF.nsxv3.nsx_password) + out = cls.nsx.get_transport_zones() vlan_flag = 0 vxlan_flag = 0 for tz in out: @@ -376,7 +383,7 @@ class TestZonesScenario(TestZonesV2Ops): else: nameserver = CONF.dns.nameservers.split(":")[0] my_resolver.nameservers = [nameserver] - #wait for status to change from pending to active + # wait for status to change from pending to active time.sleep(const.ZONE_WAIT_TIME) try: answer = my_resolver.query(record['name']) @@ -420,10 +427,10 @@ class TestZonesScenario(TestZonesV2Ops): else: nameserver = CONF.dns.nameservers.split(":")[0] my_resolver.nameservers = [nameserver] - #wait for status to change from pending to active + # wait for status to change from pending to active time.sleep(const.ZONE_WAIT_TIME) region = const.REGION_NAME - #check PTR record + # check PTR record ptr_record = self.show_ptr_record(region, fip_id) self.assertEqual(fip, ptr_record[1]['address']) try: