From 4e62e1e2e18cb93ba0f88bff8727182b1002de4b Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Thu, 16 Jun 2016 14:25:33 -0400 Subject: support multi-delete for volume-type Added the ability to delete multiple volume types at once. Note there are no unit tests exist for v1 volume-types, so instead a functional test was created. Partial-Bug: #1592906 Change-Id: I99f3f22901ab35252b91a3072b14de7d19cb17ca --- functional/tests/volume/v1/test_volume_type.py | 13 +++++++++++++ functional/tests/volume/v2/test_volume_type.py | 13 +++++++++++++ 2 files changed, 26 insertions(+) (limited to 'functional') diff --git a/functional/tests/volume/v1/test_volume_type.py b/functional/tests/volume/v1/test_volume_type.py index 824b20d7..5f1f957e 100644 --- a/functional/tests/volume/v1/test_volume_type.py +++ b/functional/tests/volume/v1/test_volume_type.py @@ -10,6 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. +import time import uuid from functional.tests.volume.v1 import common @@ -59,3 +60,15 @@ class VolumeTypeTests(common.BaseVolumeTests): self.assertEqual("", raw_output) raw_output = self.openstack('volume type show ' + self.NAME + opts) self.assertEqual("c='d'\n", raw_output) + + def test_multi_delete(self): + vol_type1 = uuid.uuid4().hex + vol_type2 = uuid.uuid4().hex + self.openstack('volume type create ' + vol_type1) + time.sleep(5) + self.openstack('volume type create ' + vol_type2) + time.sleep(5) + cmd = 'volume type delete %s %s' % (vol_type1, vol_type2) + time.sleep(5) + raw_output = self.openstack(cmd) + self.assertOutput('', raw_output) diff --git a/functional/tests/volume/v2/test_volume_type.py b/functional/tests/volume/v2/test_volume_type.py index 4c315334..114e4298 100644 --- a/functional/tests/volume/v2/test_volume_type.py +++ b/functional/tests/volume/v2/test_volume_type.py @@ -10,6 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. +import time import uuid from functional.tests.volume.v2 import common @@ -69,3 +70,15 @@ class VolumeTypeTests(common.BaseVolumeTests): raw_output = self.openstack( 'volume type unset --project admin ' + self.NAME) self.assertEqual("", raw_output) + + def test_multi_delete(self): + vol_type1 = uuid.uuid4().hex + vol_type2 = uuid.uuid4().hex + self.openstack('volume type create ' + vol_type1) + time.sleep(5) + self.openstack('volume type create ' + vol_type2) + time.sleep(5) + cmd = 'volume type delete %s %s' % (vol_type1, vol_type2) + time.sleep(5) + raw_output = self.openstack(cmd) + self.assertOutput('', raw_output) -- cgit v1.2.1