diff options
author | Kevin Benton <kevin@benton.pub> | 2016-11-01 11:27:32 -0700 |
---|---|---|
committer | Kevin Benton <kevin@benton.pub> | 2016-11-14 23:59:56 +0000 |
commit | d2c292e5dcbde6222467b3435e80ec081aef77a8 (patch) | |
tree | 7b688a14e0ba55cbcece6dff5882084ae97d09da /rally-jobs | |
parent | 4d7653848d74674d23eed59d334ace5fe89288a0 (diff) | |
download | neutron-d2c292e5dcbde6222467b3435e80ec081aef77a8.tar.gz |
Add a trunk rally test
This adds a basic rally scenario to create a trunk
with a bunch of subports so we can keep an eye on the
performance of the trunk API.
Change-Id: I12aaf6121b677e9696131601b3539a7091e2858c
Diffstat (limited to 'rally-jobs')
-rw-r--r-- | rally-jobs/neutron-neutron.yaml | 17 | ||||
-rw-r--r-- | rally-jobs/plugins/trunk_scenario.py | 54 |
2 files changed, 70 insertions, 1 deletions
diff --git a/rally-jobs/neutron-neutron.yaml b/rally-jobs/neutron-neutron.yaml index 2e34e62c62..77c1808628 100644 --- a/rally-jobs/neutron-neutron.yaml +++ b/rally-jobs/neutron-neutron.yaml @@ -305,4 +305,19 @@ sla: failure_rate: max: 0 - + NeutronTrunks.create_and_list_trunk_subports: + - + args: + subport_count: 50 + runner: + type: "constant" + times: 10 + concurrency: 4 + context: + users: + tenants: 1 + users_per_tenant: 1 + quotas: + neutron: + network: -1 + port: -1
\ No newline at end of file diff --git a/rally-jobs/plugins/trunk_scenario.py b/rally-jobs/plugins/trunk_scenario.py new file mode 100644 index 0000000000..abafb09e62 --- /dev/null +++ b/rally-jobs/plugins/trunk_scenario.py @@ -0,0 +1,54 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from rally import consts +from rally.plugins.openstack import scenario +from rally.plugins.openstack.scenarios.neutron import utils +from rally.task import atomic +from rally.task import validation + + +"""Scenarios for VLAN Aware VMs.""" + + +@validation.required_services(consts.Service.NEUTRON) +@validation.required_openstack(users=True) +@scenario.configure(context={"cleanup": ["neutron"]}, + name="NeutronTrunks.create_and_list_trunk_subports") +class TrunkLifeCycle(utils.NeutronScenario): + + def run(self, subport_count=50): + net = self._create_network({}) + ports = [self._create_port(net, {}) for i in range(subport_count)] + parent, subports = ports[0], ports[1:] + subport_payload = [{'port_id': p['port']['id'], + 'segmentation_type': 'vlan', + 'segmentation_id': seg_id} + for seg_id, p in enumerate(subports, start=1)] + trunk_payload = {'port_id': parent['port']['id'], + 'sub_ports': subport_payload} + trunk = self._create_trunk(trunk_payload) + self._list_trunks(id=trunk['trunk']['id']) + self._delete_trunk(trunk['trunk']['id']) + + @atomic.action_timer("neutron.delete_trunk") + def _delete_trunk(self, trunk_id): + self.clients("neutron").delete_trunk(trunk_id) + + @atomic.action_timer("neutron.create_trunk") + def _create_trunk(self, trunk_payload): + return self.clients("neutron").create_trunk({'trunk': trunk_payload}) + + @atomic.optional_action_timer("neutron.list_trunks") + def _list_trunks(self, **kwargs): + return self.clients("neutron").list_trunks(**kwargs)["trunks"] |