Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a volume create/delete stress test
Simply performs a create/delete operation, in a while loop for the duration passed to run_stress.py Change-Id: I006f3754f1fc1cabfbb90ed72704b2185dcc4e5f Fixes: bug #1192227
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from tempest.common.utils.data_utils import rand_name | ||
|
||
|
||
def create_delete(manager, logger): | ||
while True: | ||
name = rand_name("volume") | ||
logger.info("creating %s" % name) | ||
resp, volume = manager.volumes_client.create_volume(size=1, | ||
display_name=name) | ||
assert(resp.status == 200) | ||
manager.volumes_client.wait_for_volume_status(volume['id'], | ||
'available') | ||
logger.info("created %s" % volume['id']) | ||
logger.info("deleting %s" % name) | ||
resp, _ = manager.volumes_client.delete_volume(volume['id']) | ||
assert(resp.status == 202) | ||
manager.volumes_client.wait_for_resource_deletion(volume['id']) | ||
logger.info("deleted %s" % volume['id']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[{"action": "tempest.stress.actions.volume_create_delete.create_delete", | ||
"threads": 4, | ||
"use_admin": false, | ||
"use_isolated_tenants": false, | ||
"kwargs": {} | ||
} | ||
] |