summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional/volume
diff options
context:
space:
mode:
authorRui Chen <chenrui.momo@gmail.com>2017-02-24 16:48:05 +0800
committerRui Chen <chenrui.momo@gmail.com>2017-05-17 01:42:12 +0000
commit7a7bb06377c96f7bfc2c371aa2ff726ee364a9db (patch)
tree518ae86b9137ae6e7921c018f363628316a38ce4 /openstackclient/tests/functional/volume
parent0181de38afc8cc4b96f226b00e173fb0c0d2e4dc (diff)
downloadpython-openstackclient-7a7bb06377c96f7bfc2c371aa2ff726ee364a9db.tar.gz
Make block-device-mapping more stable and clear
The patch fix the following issues: 1. ValueError is raised if input don't contain "=". Sometimes the whole "server create" command is very complex, it's difficult to find out root reason directly. 2. Don't support to add block device from snapshot, like: --block-device-mapping vdb=0c8ae9d8-cadc-4a23-8337-4254614d277e:snapshot:1, it's supported by novaclient, but not in osc. 3. If input "vdb=", not add any mapping information, the server will be launched successfully, not raise error message to let use add volume/snapshot id, just ignore "--block-device-mapping" option. 4. The help message of "block-device-mapping" option is so simple, need to add some details about how to add <type>, <delete_on_terminate> contains. Change-Id: Ib7f7a654c3dc2a8272545f168b4c4ced230ce39e Depends-On: Ib37913891bbf7a31b570404c4668c490d5ac859b Closes-Bug: #1667266
Diffstat (limited to 'openstackclient/tests/functional/volume')
-rw-r--r--openstackclient/tests/functional/volume/v2/test_volume.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/openstackclient/tests/functional/volume/v2/test_volume.py b/openstackclient/tests/functional/volume/v2/test_volume.py
index ce98236f..94ac792f 100644
--- a/openstackclient/tests/functional/volume/v2/test_volume.py
+++ b/openstackclient/tests/functional/volume/v2/test_volume.py
@@ -14,6 +14,8 @@ import json
import time
import uuid
+from tempest.lib import exceptions
+
from openstackclient.tests.functional.volume.v2 import common
@@ -253,7 +255,13 @@ class VolumeTests(common.BaseVolumeTests):
total_sleep = 0
opts = self.get_opts(['status'])
while total_sleep < wait:
- status = self.openstack(check_type + ' show ' + check_name + opts)
+ try:
+ status = self.openstack(
+ check_type + ' show ' + check_name + opts
+ )
+ except exceptions.CommandFailed:
+ # Show command raise Exception when object had been deleted
+ status = 'disappear'
status = status.rstrip()
print('Checking {} {} Waiting for {} current status: {}'
.format(check_type, check_name, desired_status, status))