From dbed97a24df2fb74e4989fb15c912252f8a8bb07 Mon Sep 17 00:00:00 2001 From: Huanxuan Ao Date: Tue, 28 Jun 2016 14:39:00 +0800 Subject: Add "--property" option to "flavor create" command Add "--property" option to "flavor create" command to support adding properties to a new falvor. Change-Id: I4f06b364375d5a81584fe41122d48e9568fa712a Closes-Bug: #1596798 --- functional/tests/compute/v2/test_flavor.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'functional') diff --git a/functional/tests/compute/v2/test_flavor.py b/functional/tests/compute/v2/test_flavor.py index 2bb075bd..6edb1fdf 100644 --- a/functional/tests/compute/v2/test_flavor.py +++ b/functional/tests/compute/v2/test_flavor.py @@ -25,7 +25,8 @@ class FlavorTests(test.TestCase): @classmethod def setUpClass(cls): opts = cls.get_show_opts(cls.FIELDS) - raw_output = cls.openstack('flavor create ' + cls.NAME + opts) + raw_output = cls.openstack( + 'flavor create --property a=b --property c=d ' + cls.NAME + opts) expected = cls.NAME + '\n' cls.assertOutput(expected, raw_output) @@ -47,19 +48,22 @@ class FlavorTests(test.TestCase): def test_flavor_properties(self): opts = self.get_show_opts(['properties']) + # check the properties we added in create command. + raw_output = self.openstack('flavor show ' + self.NAME + opts) + self.assertEqual("a='b', c='d'\n", raw_output) raw_output = self.openstack( - 'flavor set --property a=b --property c=d ' + self.NAME + 'flavor set --property e=f --property g=h ' + self.NAME ) self.assertEqual('', raw_output) raw_output = self.openstack('flavor show ' + self.NAME + opts) - self.assertEqual("a='b', c='d'\n", raw_output) + self.assertEqual("a='b', c='d', e='f', g='h'\n", raw_output) raw_output = self.openstack( - 'flavor unset --property a ' + self.NAME + 'flavor unset --property a --property c ' + self.NAME ) self.assertEqual('', raw_output) raw_output = self.openstack('flavor show ' + self.NAME + opts) - self.assertEqual("c='d'\n", raw_output) + self.assertEqual("e='f', g='h'\n", raw_output) -- cgit v1.2.1