From bbf75de11d0d49acc5be9b8738e52fe1b6994213 Mon Sep 17 00:00:00 2001 From: Deepthi Kandavara Jayarama Date: Mon, 9 Apr 2018 22:33:00 +0000 Subject: [PATCH] [Bug:2088241] Modified code to reflect upstream Base class : BaseAdminNetworkTest in create and delete network root@localhost:/tmp/jenkins/workspace/end2end-precommit/tempest# ./tools/with_venv.sh stestr run vmware_nsx_tempest.tests.dvs.api.test_networks_admin_actions.AdminNetworksTestJSON {0} vmware_nsx_tempest.tests.dvs.api.test_networks_admin_actions.AdminNetworksTestJSON.test_create_update_delete_flat_network_subnet [4.502624s] ... ok {0} vmware_nsx_tempest.tests.dvs.api.test_networks_admin_actions.AdminNetworksTestJSON.test_create_update_delete_vlan_network_subnet [3.449882s] ... ok {0} vmware_nsx_tempest.tests.dvs.api.test_networks_admin_actions.AdminNetworksTestJSON.test_list_networks [0.147079s] ... ok {0} vmware_nsx_tempest.tests.dvs.api.test_networks_admin_actions.AdminNetworksTestJSON.test_show_network [0.112556s] ... ok {0} vmware_nsx_tempest.tests.dvs.api.test_networks_admin_actions.AdminNetworksTestJSON.test_show_subnet [0.615493s] ... ok ====== Totals ====== Ran: 5 tests in 27.0000 sec. - Passed: 5 - Skipped: 0 - Expected Fail: 0 - Unexpected Success: 0 - Failed: 0 Sum of execute time for each test: 8.8276 sec. Change-Id: Iea50f16e1c427e82f91405d1909a50dae800b930 --- vmware_nsx_tempest/tests/dvs/api/base_dvs.py | 5 +---- .../tests/dvs/api/test_networks_admin_actions.py | 2 -- vmware_nsx_tempest/tests/nsxv/api/test_port_types.py | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/vmware_nsx_tempest/tests/dvs/api/base_dvs.py b/vmware_nsx_tempest/tests/dvs/api/base_dvs.py index 949651d..638b186 100644 --- a/vmware_nsx_tempest/tests/dvs/api/base_dvs.py +++ b/vmware_nsx_tempest/tests/dvs/api/base_dvs.py @@ -31,12 +31,10 @@ class BaseDvsAdminNetworkTest(base.BaseAdminNetworkTest): cls.admin_ports_client.delete_port(port['id']) for subnet in cls.subnets: cls.admin_subnets_client.delete_subnet(subnet['id']) - for network in cls.networks: - cls.admin_networks_client.delete_network(network['id']) # clean up ports, subnets and networks cls.ports = [] cls.subnets = [] - cls.networks = [] + super(BaseDvsAdminNetworkTest, cls).resource_cleanup() @classmethod def create_network(cls, **kwargs): @@ -54,7 +52,6 @@ class BaseDvsAdminNetworkTest(base.BaseAdminNetworkTest): body = cls.admin_networks_client.create_network(**body) network = body['network'] - cls.networks.append(network) return network @classmethod diff --git a/vmware_nsx_tempest/tests/dvs/api/test_networks_admin_actions.py b/vmware_nsx_tempest/tests/dvs/api/test_networks_admin_actions.py index 31fed62..77fb738 100644 --- a/vmware_nsx_tempest/tests/dvs/api/test_networks_admin_actions.py +++ b/vmware_nsx_tempest/tests/dvs/api/test_networks_admin_actions.py @@ -62,7 +62,6 @@ class AdminNetworksTestJSON(base.BaseDvsAdminNetworkTest): # Remove subnet from cleanup list self.subnets.pop() body = self.delete_network(net_id) - self.networks.pop() @decorators.attr(type='smoke') @decorators.idempotent_id('15d3d53c-3328-401f-b8f5-3a29aee2ea3a') @@ -89,7 +88,6 @@ class AdminNetworksTestJSON(base.BaseDvsAdminNetworkTest): # Remove subnet from cleanup list self.subnets.pop() body = self.delete_network(net_id) - self.networks.pop() @decorators.attr(type='smoke') @decorators.idempotent_id('838aee5f-92f2-47b9-86c6-629a04aa6269') diff --git a/vmware_nsx_tempest/tests/nsxv/api/test_port_types.py b/vmware_nsx_tempest/tests/nsxv/api/test_port_types.py index 43c13b6..0e5999a 100644 --- a/vmware_nsx_tempest/tests/nsxv/api/test_port_types.py +++ b/vmware_nsx_tempest/tests/nsxv/api/test_port_types.py @@ -61,7 +61,6 @@ class PortTypeTest(base.BaseAdminNetworkTest): LOG.debug("create FLAT network: %s", str(post_body)) body = self.admin_networks_client.create_network(**post_body) network = body['network'] - self.networks.append(network) if _auto_clean_up: self.addCleanup(test_utils.call_and_ignore_notfound_exc, self.delete_network, network['id'])