From 8275ce9638061a032fc9f0b348cdb95c00650087 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 17 Apr 2015 14:27:18 -0500 Subject: [PATCH] Add Nova lock and unlock scenario Add scenario to boot a server, lock it, unlock it, and delete it. Change-Id: Ifd29211914ff264738e1ff0371629d33b5f55f36 --- rally-jobs/rally.yaml | 19 ++++++++++++++ .../nova/boot-lock-unlock-and-delete.json | 25 +++++++++++++++++++ .../nova/boot-lock-unlock-and-delete.yaml | 16 ++++++++++++ tests/unit/fakes.py | 7 +++++- 4 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 samples/tasks/scenarios/nova/boot-lock-unlock-and-delete.json create mode 100644 samples/tasks/scenarios/nova/boot-lock-unlock-and-delete.yaml diff --git a/rally-jobs/rally.yaml b/rally-jobs/rally.yaml index ac5764fe..9baf9578 100755 --- a/rally-jobs/rally.yaml +++ b/rally-jobs/rally.yaml @@ -1278,6 +1278,25 @@ failure_rate: max: 0 + NovaServers.boot_lock_unlock_and_delete: + - + args: + flavor: + name: "m1.tiny" + image: + name: {{image_name}} + runner: + type: "constant" + times: 4 + concurrency: 4 + context: + users: + tenants: 2 + users_per_tenant: 1 + sla: + failure_rate: + max: 0 + NovaServers.boot_server_from_volume_and_delete: - args: diff --git a/samples/tasks/scenarios/nova/boot-lock-unlock-and-delete.json b/samples/tasks/scenarios/nova/boot-lock-unlock-and-delete.json new file mode 100644 index 00000000..ffa3acd1 --- /dev/null +++ b/samples/tasks/scenarios/nova/boot-lock-unlock-and-delete.json @@ -0,0 +1,25 @@ +{ + "NovaServers.boot_lock_unlock_and_delete": [ + { + "args": { + "flavor": { + "name": "m1.tiny" + }, + "image": { + "name": "cirros-0.3.2-x86_64-uec" + } + }, + "runner": { + "type": "constant", + "times": 10, + "concurrency": 2 + }, + "context": { + "users": { + "tenants": 1, + "users_per_tenant": 1 + } + } + } + ] +} diff --git a/samples/tasks/scenarios/nova/boot-lock-unlock-and-delete.yaml b/samples/tasks/scenarios/nova/boot-lock-unlock-and-delete.yaml new file mode 100644 index 00000000..e7e01a85 --- /dev/null +++ b/samples/tasks/scenarios/nova/boot-lock-unlock-and-delete.yaml @@ -0,0 +1,16 @@ +--- + NovaServers.boot_lock_unlock_and_delete: + - + args: + flavor: + name: "m1.tiny" + image: + name: "cirros-0.3.2-x86_64-uec" + runner: + type: "constant" + times: 10 + concurrency: 2 + context: + users: + tenants: 1 + users_per_tenant: 1 diff --git a/tests/unit/fakes.py b/tests/unit/fakes.py index fbd8016a..ed3e3ac8 100644 --- a/tests/unit/fakes.py +++ b/tests/unit/fakes.py @@ -105,10 +105,15 @@ class FakeResource(object): class FakeServer(FakeResource): - def suspend(self): self.status = "SUSPENDED" + def lock(self): + setattr(self, "OS-EXT-STS:locked", True) + + def unlock(self): + setattr(self, "OS-EXT-STS:locked", False) + class FakeFailedServer(FakeResource):