Update trunk tests to use create_trunk method.
Change-Id: I5eed63cf454596c1b58f1ec9546669c03f234341
diff --git a/neutron_tempest_plugin/scenario/test_trunk.py b/neutron_tempest_plugin/scenario/test_trunk.py
index f7568c5..9a92b38 100644
--- a/neutron_tempest_plugin/scenario/test_trunk.py
+++ b/neutron_tempest_plugin/scenario/test_trunk.py
@@ -59,9 +59,8 @@
def _create_server_with_trunk_port(self):
port = self.create_port(self.network, security_groups=[
self.secgroup['security_group']['id']])
- trunk = self.client.create_trunk(port['id'], subports=[])['trunk']
+ trunk = self.create_trunk(port)
server, fip = self._create_server_with_fip(port['id'])
- self.addCleanup(self._detach_and_delete_trunk, server, trunk)
return {'port': port, 'trunk': trunk, 'fip': fip,
'server': server}
@@ -78,18 +77,6 @@
**server_kwargs)['server'],
fip)
- def _detach_and_delete_trunk(self, server, trunk):
- # we have to detach the interface from the server before
- # the trunk can be deleted.
- self.os_primary.compute.InterfacesClient().delete_interface(
- server['id'], trunk['port_id'])
-
- def is_port_detached():
- p = self.client.show_port(trunk['port_id'])['port']
- return p['device_id'] == ''
- utils.wait_until_true(is_port_detached)
- self.client.delete_trunk(trunk['id'])
-
def _is_port_down(self, port_id):
p = self.client.show_port(port_id)['port']
return p['status'] == 'DOWN'
@@ -113,11 +100,9 @@
'port_id': port_for_subport['id'],
'segmentation_type': 'vlan',
'segmentation_id': vlan_tag}
- trunk = self.client.create_trunk(
- parent_port['id'], subports=[subport])['trunk']
+ self.create_trunk(parent_port, [subport])
server, fip = self._create_server_with_fip(parent_port['id'])
- self.addCleanup(self._detach_and_delete_trunk, server, trunk)
server_ssh_client = ssh.Client(
fip['floating_ip_address'],