summaryrefslogtreecommitdiff
path: root/openstackclient/tests
diff options
context:
space:
mode:
authorRui Chen <chenrui.momo@gmail.com>2016-06-29 14:43:38 +0800
committerRui Chen <chenrui.momo@gmail.com>2016-09-12 11:08:32 +0800
commit8d59b31c72468d82cbe79a6cf24df28fb3b6cf06 (patch)
tree3dbec64f2932a5ac7ab6e559edaeeb7685a68479 /openstackclient/tests
parentd2273ecea5d540f4dacc89772870722355f2492f (diff)
downloadpython-openstackclient-8d59b31c72468d82cbe79a6cf24df28fb3b6cf06.tar.gz
Add functional tests for unset multiple volume type props
CinderClient bug/1596511 cause that OSC can't unset multiple properties of volume type, obviously no functional test case cover the part of logic in OSC, that make the issue raising, the patch add functional test cases for this scenario. Change-Id: I42cf9ac8cc72ccc2f1208926d8faf7b80ee2d288 Partial-Bug: #1596511 Depends-On: I60378a32cdc52aacdf869d69b246dec7eb6cdb77
Diffstat (limited to 'openstackclient/tests')
-rw-r--r--openstackclient/tests/functional/volume/v1/test_volume_type.py15
-rw-r--r--openstackclient/tests/functional/volume/v2/test_volume_type.py15
2 files changed, 30 insertions, 0 deletions
diff --git a/openstackclient/tests/functional/volume/v1/test_volume_type.py b/openstackclient/tests/functional/volume/v1/test_volume_type.py
index 538545ab..955759b6 100644
--- a/openstackclient/tests/functional/volume/v1/test_volume_type.py
+++ b/openstackclient/tests/functional/volume/v1/test_volume_type.py
@@ -61,6 +61,21 @@ class VolumeTypeTests(common.BaseVolumeTests):
raw_output = self.openstack('volume type show ' + self.NAME + opts)
self.assertEqual("c='d'\n", raw_output)
+ def test_volume_type_set_unset_multiple_properties(self):
+ raw_output = self.openstack(
+ 'volume type set --property a=b --property c=d ' + self.NAME)
+ self.assertEqual("", raw_output)
+
+ opts = self.get_opts(["properties"])
+ raw_output = self.openstack('volume type show ' + self.NAME + opts)
+ self.assertEqual("a='b', c='d'\n", raw_output)
+
+ raw_output = self.openstack(
+ 'volume type unset --property a --property c ' + self.NAME)
+ self.assertEqual("", raw_output)
+ raw_output = self.openstack('volume type show ' + self.NAME + opts)
+ self.assertEqual("\n", raw_output)
+
def test_multi_delete(self):
vol_type1 = uuid.uuid4().hex
vol_type2 = uuid.uuid4().hex
diff --git a/openstackclient/tests/functional/volume/v2/test_volume_type.py b/openstackclient/tests/functional/volume/v2/test_volume_type.py
index b62cbb39..d8bd3a96 100644
--- a/openstackclient/tests/functional/volume/v2/test_volume_type.py
+++ b/openstackclient/tests/functional/volume/v2/test_volume_type.py
@@ -62,6 +62,21 @@ class VolumeTypeTests(common.BaseVolumeTests):
raw_output = self.openstack('volume type show ' + self.NAME + opts)
self.assertEqual("c='d'\n", raw_output)
+ def test_volume_type_set_unset_multiple_properties(self):
+ raw_output = self.openstack(
+ 'volume type set --property a=b --property c=d ' + self.NAME)
+ self.assertEqual("", raw_output)
+
+ opts = self.get_opts(["properties"])
+ raw_output = self.openstack('volume type show ' + self.NAME + opts)
+ self.assertEqual("a='b', c='d'\n", raw_output)
+
+ raw_output = self.openstack(
+ 'volume type unset --property a --property c ' + self.NAME)
+ self.assertEqual("", raw_output)
+ raw_output = self.openstack('volume type show ' + self.NAME + opts)
+ self.assertEqual("\n", raw_output)
+
def test_volume_type_set_unset_project(self):
raw_output = self.openstack(
'volume type set --project admin ' + self.NAME)