[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
This commit is contained in:
John Wu 2015-02-25 13:35:28 -08:00
parent 2987978a52
commit d383e41581
8 changed files with 178 additions and 1 deletions

View File

@ -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

View File

@ -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"
]
}
}
]
}

View File

@ -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"

View File

@ -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"
]
}
}
]
}

View File

@ -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"

View File

@ -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"
]
}
}
]
}

View File

@ -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"

View File

@ -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()