summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional/volume/v2
diff options
context:
space:
mode:
authorzhiyong.dai <zhiyong.dai@easystack.cn>2016-12-01 02:20:23 +0800
committerzhiyong.dai <zhiyong.dai@easystack.cn>2017-02-23 21:49:11 +0800
commit40ec7a9c96f4ce4071e47e5bf0c249aa77b5b2ee (patch)
treefa08254e4e9c9bc5c2b0ca12881feffad713ec68 /openstackclient/tests/functional/volume/v2
parent3b562ffa904ebb23396c2d6c7398a520cd535238 (diff)
downloadpython-openstackclient-40ec7a9c96f4ce4071e47e5bf0c249aa77b5b2ee.tar.gz
Support --no-property in "volume set" command
Add "--no-property" option to "volume set" command in v1 and v2 and update the test cases. Change-Id: Id5660f23b3b2d9aa72f4c16b19ce83f3f7ed2fa4
Diffstat (limited to 'openstackclient/tests/functional/volume/v2')
-rw-r--r--openstackclient/tests/functional/volume/v2/test_volume.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/openstackclient/tests/functional/volume/v2/test_volume.py b/openstackclient/tests/functional/volume/v2/test_volume.py
index 203ca819..ce98236f 100644
--- a/openstackclient/tests/functional/volume/v2/test_volume.py
+++ b/openstackclient/tests/functional/volume/v2/test_volume.py
@@ -104,7 +104,7 @@ class VolumeTests(common.BaseVolumeTests):
# TODO(qiangjiahui): Add project option to filter tests when we can
# specify volume with project
- def test_volume_set(self):
+ def test_volume_set_and_unset(self):
"""Tests create volume, set, unset, show, delete"""
name = uuid.uuid4().hex
new_name = name + "_"
@@ -144,8 +144,11 @@ class VolumeTests(common.BaseVolumeTests):
'--name ' + new_name +
' --size 2 ' +
'--description bbbb ' +
- '--property Alpha=c ' +
+ '--no-property ' +
'--property Beta=b ' +
+ '--property Gamma=c ' +
+ '--image-property a=b ' +
+ '--image-property c=d ' +
'--bootable ' +
name,
)
@@ -168,10 +171,14 @@ class VolumeTests(common.BaseVolumeTests):
cmd_output["description"],
)
self.assertEqual(
- "Alpha='c', Beta='b'",
+ "Beta='b', Gamma='c'",
cmd_output["properties"],
)
self.assertEqual(
+ {'a': 'b', 'c': 'd'},
+ cmd_output["volume_image_metadata"],
+ )
+ self.assertEqual(
'true',
cmd_output["bootable"],
)
@@ -179,7 +186,8 @@ class VolumeTests(common.BaseVolumeTests):
# Test volume unset
raw_output = self.openstack(
'volume unset ' +
- '--property Alpha ' +
+ '--property Beta ' +
+ '--image-property a ' +
new_name,
)
self.assertOutput('', raw_output)
@@ -189,9 +197,13 @@ class VolumeTests(common.BaseVolumeTests):
new_name
))
self.assertEqual(
- "Beta='b'",
+ "Gamma='c'",
cmd_output["properties"],
)
+ self.assertEqual(
+ {'c': 'd'},
+ cmd_output["volume_image_metadata"],
+ )
def test_volume_snapshot(self):
"""Tests volume create from snapshot"""