From c57ac8bf15283ea28ee7390c06b63fc2c98aa76c Mon Sep 17 00:00:00 2001 From: Giulio Fidente Date: Thu, 1 Aug 2013 11:28:41 +0200 Subject: [PATCH] renames the stress test class to include the Volume keyword tries to pick a better naming for the volume stress test class and unifies stress test/class/file naming trying to serve as "guidance" for future usage Change-Id: Ie1b4aa4a4d2587fb1499604ecbc22f9b8f374c67 --- tempest/stress/README.rst | 2 +- ..._destroy_server.py => server_create_destroy.py} | 2 +- tempest/stress/actions/volume_create_delete.py | 14 +++++++------- ...e-test.json => server-create-destroy-test.json} | 2 +- tempest/stress/etc/stress-tox-job.json | 4 ++-- ...te-test.json => volume-attach-delete-test.json} | 0 tempest/stress/etc/volume-create-delete-test.json | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) rename tempest/stress/actions/{create_destroy_server.py => server_create_destroy.py} (96%) rename tempest/stress/etc/{sample-test.json => server-create-destroy-test.json} (52%) rename tempest/stress/etc/{volume-assign-delete-test.json => volume-attach-delete-test.json} (100%) diff --git a/tempest/stress/README.rst b/tempest/stress/README.rst index 661763cce9..31642b0997 100644 --- a/tempest/stress/README.rst +++ b/tempest/stress/README.rst @@ -30,7 +30,7 @@ Running the sample test To test installation, do the following (from the tempest/stress directory): - ./run_stress.py etc/sample-test.json -d 30 + ./run_stress.py etc/server-create-destroy-test.json -d 30 This sample test tries to create a few VMs and kill a few VMs. diff --git a/tempest/stress/actions/create_destroy_server.py b/tempest/stress/actions/server_create_destroy.py similarity index 96% rename from tempest/stress/actions/create_destroy_server.py rename to tempest/stress/actions/server_create_destroy.py index 68dc14891e..1a1e30b443 100644 --- a/tempest/stress/actions/create_destroy_server.py +++ b/tempest/stress/actions/server_create_destroy.py @@ -16,7 +16,7 @@ from tempest.common.utils.data_utils import rand_name import tempest.stress.stressaction as stressaction -class CreateDestroyServerTest(stressaction.StressAction): +class ServerCreateDestroyTest(stressaction.StressAction): def setUp(self, **kwargs): self.image = self.manager.config.compute.image_ref diff --git a/tempest/stress/actions/volume_create_delete.py b/tempest/stress/actions/volume_create_delete.py index 184f870525..e29d9c41da 100644 --- a/tempest/stress/actions/volume_create_delete.py +++ b/tempest/stress/actions/volume_create_delete.py @@ -14,20 +14,20 @@ from tempest.common.utils.data_utils import rand_name import tempest.stress.stressaction as stressaction -class CreateDeleteTest(stressaction.StressAction): +class VolumeCreateDeleteTest(stressaction.StressAction): def run(self): name = rand_name("volume") self.logger.info("creating %s" % name) - resp, volume = self.manager.volumes_client.\ - create_volume(size=1, display_name=name) + volumes_client = self.manager.volumes_client + resp, volume = volumes_client.create_volume(size=1, + display_name=name) assert(resp.status == 200) vol_id = volume['id'] - status = 'available' - self.manager.volumes_client.wait_for_volume_status(vol_id, status) + volumes_client.wait_for_volume_status(vol_id, 'available') self.logger.info("created %s" % volume['id']) self.logger.info("deleting %s" % name) - resp, _ = self.manager.volumes_client.delete_volume(vol_id) + resp, _ = volumes_client.delete_volume(vol_id) assert(resp.status == 202) - self.manager.volumes_client.wait_for_resource_deletion(vol_id) + volumes_client.wait_for_resource_deletion(vol_id) self.logger.info("deleted %s" % vol_id) diff --git a/tempest/stress/etc/sample-test.json b/tempest/stress/etc/server-create-destroy-test.json similarity index 52% rename from tempest/stress/etc/sample-test.json rename to tempest/stress/etc/server-create-destroy-test.json index 494c823eab..17d5e1a3c3 100644 --- a/tempest/stress/etc/sample-test.json +++ b/tempest/stress/etc/server-create-destroy-test.json @@ -1,4 +1,4 @@ -[{"action": "tempest.stress.actions.create_destroy_server.CreateDestroyServerTest", +[{"action": "tempest.stress.actions.server_create_destroy.ServerCreateDestroyTest", "threads": 8, "use_admin": false, "use_isolated_tenants": false, diff --git a/tempest/stress/etc/stress-tox-job.json b/tempest/stress/etc/stress-tox-job.json index 3534c265f9..dffc469cbb 100644 --- a/tempest/stress/etc/stress-tox-job.json +++ b/tempest/stress/etc/stress-tox-job.json @@ -1,10 +1,10 @@ -[{"action": "tempest.stress.actions.create_destroy_server.CreateDestroyServerTest", +[{"action": "tempest.stress.actions.server_create_destroy.ServerCreateDestroyTest", "threads": 8, "use_admin": false, "use_isolated_tenants": false, "kwargs": {} }, - {"action": "tempest.stress.actions.volume_create_delete.CreateDeleteTest", + {"action": "tempest.stress.actions.volume_create_delete.VolumeCreateDeleteTest", "threads": 4, "use_admin": false, "use_isolated_tenants": false, diff --git a/tempest/stress/etc/volume-assign-delete-test.json b/tempest/stress/etc/volume-attach-delete-test.json similarity index 100% rename from tempest/stress/etc/volume-assign-delete-test.json rename to tempest/stress/etc/volume-attach-delete-test.json diff --git a/tempest/stress/etc/volume-create-delete-test.json b/tempest/stress/etc/volume-create-delete-test.json index 6325bdc8b3..e8a58f7c52 100644 --- a/tempest/stress/etc/volume-create-delete-test.json +++ b/tempest/stress/etc/volume-create-delete-test.json @@ -1,4 +1,4 @@ -[{"action": "tempest.stress.actions.volume_create_delete.CreateDeleteTest", +[{"action": "tempest.stress.actions.volume_create_delete.VolumeCreateDeleteTest", "threads": 4, "use_admin": false, "use_isolated_tenants": false,