[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
This commit is contained in:
Deepthi Kandavara Jayarama 2018-04-09 22:33:00 +00:00
parent 2a629b279f
commit bbf75de11d
3 changed files with 1 additions and 7 deletions

View File

@ -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

View File

@ -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')

View File

@ -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'])