Tempest: Port Types network cleanup fix

Created network wasn't included in cleanup for test

Change-Id: Iae19744dda669d3e8ab522f161ad6e197aca0d41
This commit is contained in:
Christopher Chu Lin 2017-05-15 11:57:49 -04:00
parent c449abdc05
commit f5fe39e788

View File

@ -195,6 +195,8 @@ class PortTypeTest(base.BaseAdminNetworkTest):
net_name = data_utils.rand_name('test-net')
net_body = self.create_network(name=net_name)
test_net = net_body['network']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.delete_network, test_net['id'])
self.assertRaises(ex.BadRequest, self._create_direct_port,
network_id=test_net['id'])
@ -249,11 +251,15 @@ class PortTypeTest(base.BaseAdminNetworkTest):
net_name = data_utils.rand_name('test-net')
net_body = self.create_network(name=net_name)
test_net = net_body['network']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.delete_network, test_net['id'])
test_port_name = data_utils.rand_name('test-port-')
orig_post = {'name': test_port_name}
LOG.debug("create NORMAL port: %s", str(orig_post))
test_port = self.create_port(network_id=test_net['id'],
**orig_post)
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.delete_port, test_port['port']['id'])
post_body = {'port_security_enabled': 'False',
'security_groups': [],
'binding:vnic_type': 'direct'}