Skip to content

Commit 8d59b31

Browse files
committed
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
1 parent d2273ec commit 8d59b31

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

openstackclient/tests/functional/volume/v1/test_volume_type.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@ def test_volume_type_set_unset_properties(self):
6161
raw_output = self.openstack('volume type show ' + self.NAME + opts)
6262
self.assertEqual("c='d'\n", raw_output)
6363

64+
def test_volume_type_set_unset_multiple_properties(self):
65+
raw_output = self.openstack(
66+
'volume type set --property a=b --property c=d ' + self.NAME)
67+
self.assertEqual("", raw_output)
68+
69+
opts = self.get_opts(["properties"])
70+
raw_output = self.openstack('volume type show ' + self.NAME + opts)
71+
self.assertEqual("a='b', c='d'\n", raw_output)
72+
73+
raw_output = self.openstack(
74+
'volume type unset --property a --property c ' + self.NAME)
75+
self.assertEqual("", raw_output)
76+
raw_output = self.openstack('volume type show ' + self.NAME + opts)
77+
self.assertEqual("\n", raw_output)
78+
6479
def test_multi_delete(self):
6580
vol_type1 = uuid.uuid4().hex
6681
vol_type2 = uuid.uuid4().hex

openstackclient/tests/functional/volume/v2/test_volume_type.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,21 @@ def test_volume_type_set_unset_properties(self):
6262
raw_output = self.openstack('volume type show ' + self.NAME + opts)
6363
self.assertEqual("c='d'\n", raw_output)
6464

65+
def test_volume_type_set_unset_multiple_properties(self):
66+
raw_output = self.openstack(
67+
'volume type set --property a=b --property c=d ' + self.NAME)
68+
self.assertEqual("", raw_output)
69+
70+
opts = self.get_opts(["properties"])
71+
raw_output = self.openstack('volume type show ' + self.NAME + opts)
72+
self.assertEqual("a='b', c='d'\n", raw_output)
73+
74+
raw_output = self.openstack(
75+
'volume type unset --property a --property c ' + self.NAME)
76+
self.assertEqual("", raw_output)
77+
raw_output = self.openstack('volume type show ' + self.NAME + opts)
78+
self.assertEqual("\n", raw_output)
79+
6580
def test_volume_type_set_unset_project(self):
6681
raw_output = self.openstack(
6782
'volume type set --project admin ' + self.NAME)

0 commit comments

Comments
 (0)