From d383e41581694ef7ec21a4b5c94be0710ac1e51e Mon Sep 17 00:00:00 2001 From: John Wu Date: Wed, 25 Feb 2015 13:35:28 -0800 Subject: [PATCH] [Swift] Add base for Swift API Benchmarks: Patch-2 This patch adds swift scenarios, cleanup resource, and unit tests. Swift Scenarios: - create_container_and_object_then_list_objects - create_container_and_object_then_delete_object - create_container_and_object_then_download_object Blueprint benchmark-scenarios-for-swift This patch also fixed a minor bug with osclients.py where incorrect "authurl" param name was used. Change-Id: I0e5f09551fcf61e62347d56fd86f7baf9288adea --- rally-jobs/rally-neutron.yaml | 57 +++++++++++++++++++ ...-container-and-object-then-delete-all.json | 24 ++++++++ ...-container-and-object-then-delete-all.yaml | 16 ++++++ ...ainer-and-object-then-download-object.json | 24 ++++++++ ...ainer-and-object-then-download-object.yaml | 16 ++++++ ...ontainer-and-object-then-list-objects.json | 24 ++++++++ ...ontainer-and-object-then-list-objects.yaml | 16 ++++++ tests/unit/fakes.py | 2 +- 8 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 samples/tasks/scenarios/swift/create-container-and-object-then-delete-all.json create mode 100644 samples/tasks/scenarios/swift/create-container-and-object-then-delete-all.yaml create mode 100644 samples/tasks/scenarios/swift/create-container-and-object-then-download-object.json create mode 100644 samples/tasks/scenarios/swift/create-container-and-object-then-download-object.yaml create mode 100644 samples/tasks/scenarios/swift/create-container-and-object-then-list-objects.json create mode 100644 samples/tasks/scenarios/swift/create-container-and-object-then-list-objects.yaml diff --git a/rally-jobs/rally-neutron.yaml b/rally-jobs/rally-neutron.yaml index 7054ffa3..66efaa77 100644 --- a/rally-jobs/rally-neutron.yaml +++ b/rally-jobs/rally-neutron.yaml @@ -750,3 +750,60 @@ users: tenants: 2 users_per_tenant: 2 + + SwiftObjects.create_container_and_object_then_list_objects: + - + args: + objects_per_container: 2 + object_size: 5120 + runner: + type: "constant" + times: 2 + concurrency: 2 + context: + users: + tenants: 1 + users_per_tenant: 1 + roles: + - "admin" + sla: + failure_rate: + max: 0 + + SwiftObjects.create_container_and_object_then_delete_all: + - + args: + objects_per_container: 5 + object_size: 102400 + runner: + type: "constant" + times: 4 + concurrency: 2 + context: + users: + tenants: 1 + users_per_tenant: 1 + roles: + - "admin" + sla: + failure_rate: + max: 0 + + SwiftObjects.create_container_and_object_then_download_object: + - + args: + objects_per_container: 5 + object_size: 1024 + runner: + type: "constant" + times: 6 + concurrency: 3 + context: + users: + tenants: 1 + users_per_tenant: 1 + roles: + - "admin" + sla: + failure_rate: + max: 0 diff --git a/samples/tasks/scenarios/swift/create-container-and-object-then-delete-all.json b/samples/tasks/scenarios/swift/create-container-and-object-then-delete-all.json new file mode 100644 index 00000000..02b67062 --- /dev/null +++ b/samples/tasks/scenarios/swift/create-container-and-object-then-delete-all.json @@ -0,0 +1,24 @@ +{ + "SwiftObjects.create_container_and_object_then_delete_all": [ + { + "args": { + "objects_per_container": 5, + "object_size": 102400 + }, + "runner": { + "type": "constant", + "times": 4, + "concurrency": 2 + }, + "context": { + "users": { + "tenants": 1, + "users_per_tenant": 1 + }, + "roles": [ + "admin" + ] + } + } + ] +} diff --git a/samples/tasks/scenarios/swift/create-container-and-object-then-delete-all.yaml b/samples/tasks/scenarios/swift/create-container-and-object-then-delete-all.yaml new file mode 100644 index 00000000..510af158 --- /dev/null +++ b/samples/tasks/scenarios/swift/create-container-and-object-then-delete-all.yaml @@ -0,0 +1,16 @@ +--- + SwiftObjects.create_container_and_object_then_delete_all: + - + args: + objects_per_container: 5 + object_size: 102400 + runner: + type: "constant" + times: 4 + concurrency: 2 + context: + users: + tenants: 1 + users_per_tenant: 1 + roles: + - "admin" diff --git a/samples/tasks/scenarios/swift/create-container-and-object-then-download-object.json b/samples/tasks/scenarios/swift/create-container-and-object-then-download-object.json new file mode 100644 index 00000000..7b988e4c --- /dev/null +++ b/samples/tasks/scenarios/swift/create-container-and-object-then-download-object.json @@ -0,0 +1,24 @@ +{ + "SwiftObjects.create_container_and_object_then_download_object": [ + { + "args": { + "objects_per_container": 5, + "object_size": 1024 + }, + "runner": { + "type": "constant", + "times": 6, + "concurrency": 3 + }, + "context": { + "users": { + "tenants": 1, + "users_per_tenant": 1 + }, + "roles": [ + "admin" + ] + } + } + ] +} diff --git a/samples/tasks/scenarios/swift/create-container-and-object-then-download-object.yaml b/samples/tasks/scenarios/swift/create-container-and-object-then-download-object.yaml new file mode 100644 index 00000000..6ea50cf6 --- /dev/null +++ b/samples/tasks/scenarios/swift/create-container-and-object-then-download-object.yaml @@ -0,0 +1,16 @@ +--- + SwiftObjects.create_container_and_object_then_download_object: + - + args: + objects_per_container: 5 + object_size: 1024 + runner: + type: "constant" + times: 6 + concurrency: 3 + context: + users: + tenants: 1 + users_per_tenant: 1 + roles: + - "admin" diff --git a/samples/tasks/scenarios/swift/create-container-and-object-then-list-objects.json b/samples/tasks/scenarios/swift/create-container-and-object-then-list-objects.json new file mode 100644 index 00000000..f807d4b6 --- /dev/null +++ b/samples/tasks/scenarios/swift/create-container-and-object-then-list-objects.json @@ -0,0 +1,24 @@ +{ + "SwiftObjects.create_container_and_object_then_list_objects": [ + { + "args": { + "objects_per_container": 2, + "object_size": 5120 + }, + "runner": { + "type": "constant", + "times": 2, + "concurrency": 2 + }, + "context": { + "users": { + "tenants": 1, + "users_per_tenant": 1 + }, + "roles": [ + "admin" + ] + } + } + ] +} diff --git a/samples/tasks/scenarios/swift/create-container-and-object-then-list-objects.yaml b/samples/tasks/scenarios/swift/create-container-and-object-then-list-objects.yaml new file mode 100644 index 00000000..bc01aa4b --- /dev/null +++ b/samples/tasks/scenarios/swift/create-container-and-object-then-list-objects.yaml @@ -0,0 +1,16 @@ +--- + SwiftObjects.create_container_and_object_then_list_objects: + - + args: + objects_per_container: 2 + object_size: 5120 + runner: + type: "constant" + times: 2 + concurrency: 2 + context: + users: + tenants: 1 + users_per_tenant: 1 + roles: + - "admin" diff --git a/tests/unit/fakes.py b/tests/unit/fakes.py index b708a8b0..6554f2a9 100644 --- a/tests/unit/fakes.py +++ b/tests/unit/fakes.py @@ -892,7 +892,7 @@ class FakeObjectManager(FakeManager): def put_object(self, container_name, object_name, content, **kwargs): container = self.find(name=container_name) - if container is None or object_name in container.items: + if container is None: raise swift_exceptions.ClientException("Object PUT failed") container.items[object_name] = content return mock.MagicMock()