|
|
|
@ -29,6 +29,7 @@ class TrunkLifeCycle(utils.NeutronScenario):
|
|
|
|
|
|
|
|
|
|
def run(self, subport_count=50): |
|
|
|
|
net = self._create_network({}) |
|
|
|
|
self._create_subnet(net, {'cidr': '10.0.0.0/8'}) |
|
|
|
|
ports = [self._create_port(net, {}) for i in range(subport_count)] |
|
|
|
|
parent, subports = ports[0], ports[1:] |
|
|
|
|
subport_payload = [{'port_id': p['port']['id'], |
|
|
|
@ -38,7 +39,9 @@ class TrunkLifeCycle(utils.NeutronScenario):
|
|
|
|
|
trunk_payload = {'port_id': parent['port']['id'], |
|
|
|
|
'sub_ports': subport_payload} |
|
|
|
|
trunk = self._create_trunk(trunk_payload) |
|
|
|
|
self._update_port(parent, {'device_id': 'sometrunk'}) |
|
|
|
|
self._list_trunks(id=trunk['trunk']['id']) |
|
|
|
|
self._list_ports_by_device_id("sometrunk") |
|
|
|
|
self._delete_trunk(trunk['trunk']['id']) |
|
|
|
|
|
|
|
|
|
@atomic.action_timer("neutron.delete_trunk") |
|
|
|
@ -52,3 +55,7 @@ class TrunkLifeCycle(utils.NeutronScenario):
|
|
|
|
|
@atomic.optional_action_timer("neutron.list_trunks") |
|
|
|
|
def _list_trunks(self, **kwargs): |
|
|
|
|
return self.clients("neutron").list_trunks(**kwargs)["trunks"] |
|
|
|
|
|
|
|
|
|
@atomic.optional_action_timer("neutron.list_ports_by_device_id") |
|
|
|
|
def _list_ports_by_device_id(self, device_id): |
|
|
|
|
return self.clients("neutron").list_ports(device_id=device_id) |
|
|
|
|