From a6cc277372f7c442245c55d74b66606d6c1d7a36 Mon Sep 17 00:00:00 2001 From: Alexandr Nevenchannyy Date: Wed, 15 Jun 2016 17:41:47 +0300 Subject: [PATCH] Mark several cleanup resources as tenant_resource Nova servers and security groups are tenant related resources, but resource decorator missed that fact which makes cleanup tries to delete one resources several times. Change-Id: Ie3a0a40c2282fc7cffa33f1efe5d37601a461709 Closes-Bug: #1584104 --- rally-jobs/nova.yaml | 43 ++++++++++++++++++++ rally/plugins/openstack/cleanup/resources.py | 6 ++- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/rally-jobs/nova.yaml b/rally-jobs/nova.yaml index 7c09a955..7351102c 100644 --- a/rally-jobs/nova.yaml +++ b/rally-jobs/nova.yaml @@ -127,6 +127,27 @@ failure_rate: max: 0 + NovaServers.boot_and_list_server: + - + args: + flavor: + name: {{flavor_name}} + image: + name: {{image_name}} + detailed: True + runner: + type: "constant" + times: 4 + concurrency: 2 + context: + users: + tenants: 2 + users_per_tenant: 2 + user_choice_method: "round_robin" + sla: + failure_rate: + max: 0 + NovaServers.suspend_and_resume_server: - args: @@ -674,6 +695,28 @@ failure_rate: max: 0 + NovaSecGroup.create_and_list_secgroups: + - + args: + security_group_count: 5 + rules_per_security_group: 5 + runner: + type: "constant" + times: 4 + concurrency: 2 + context: + users: + tenants: 2 + users_per_tenant: 2 + user_choice_method: "round_robin" + quotas: + nova: + security_groups: -1 + security_group_rules: -1 + sla: + failure_rate: + max: 0 + NovaSecGroup.create_and_list_secgroups: - args: diff --git a/rally/plugins/openstack/cleanup/resources.py b/rally/plugins/openstack/cleanup/resources.py index 835724d6..d2c7f32c 100644 --- a/rally/plugins/openstack/cleanup/resources.py +++ b/rally/plugins/openstack/cleanup/resources.py @@ -78,7 +78,8 @@ class HeatStack(base.ResourceManager): _nova_order = get_order(200) -@base.resource("nova", "servers", order=next(_nova_order)) +@base.resource("nova", "servers", order=next(_nova_order), + tenant_resource=True) class NovaServer(base.ResourceManager): def list(self): """List all servers.""" @@ -123,7 +124,8 @@ class NovaKeypair(SynchronizedDeletion, base.ResourceManager): pass -@base.resource("nova", "security_groups", order=next(_nova_order)) +@base.resource("nova", "security_groups", order=next(_nova_order), + tenant_resource=True) class NovaSecurityGroup(SynchronizedDeletion, base.ResourceManager): def list(self):