diff options
| author | Reedip <reedip14@gmail.com> | 2017-02-23 08:05:00 -0500 |
|---|---|---|
| committer | Reedip <reedip.banerjee@gmail.com> | 2017-06-12 02:52:28 +0000 |
| commit | eb793dc8c6a8bd30e612f19f30808528b10eb344 (patch) | |
| tree | 3b4850912510b0c24258bdb2539b8892f1d2d6c1 /openstackclient/tests/functional | |
| parent | e54fcd0a5ccb80b56db3b61ae461473f2ceddea9 (diff) | |
| download | python-openstackclient-eb793dc8c6a8bd30e612f19f30808528b10eb344.tar.gz | |
Add default-quota to subnet pool commands
Add --default-quota option to subnet pool create and set commands.
Setting default-quota back to None may break the current Neutron
behavior, therefore support for Unset command is not provided in
this patch.
Neutron API:
https://github.com/openstack/neutron/blob/a0e0e8b6686b847a4963a6aa6a3224b5768544e6/neutron/api/v2/attributes.py#L239
Closes-Bug: #1667294
Change-Id: Ia4e7c23a49e91a090133c729353cdb8e62bc5674
Diffstat (limited to 'openstackclient/tests/functional')
| -rw-r--r-- | openstackclient/tests/functional/network/v2/test_subnet_pool.py | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/openstackclient/tests/functional/network/v2/test_subnet_pool.py b/openstackclient/tests/functional/network/v2/test_subnet_pool.py index 640f68b7..a4b823f1 100644 --- a/openstackclient/tests/functional/network/v2/test_subnet_pool.py +++ b/openstackclient/tests/functional/network/v2/test_subnet_pool.py @@ -165,7 +165,7 @@ class SubnetPoolTests(common.NetworkTests): self.assertIn(name2, names) def test_subnet_pool_set_show(self): - """Test create, set, show, delete""" + """Test create, delete, set, show, unset""" name = uuid.uuid4().hex new_name = name + "_" @@ -173,11 +173,15 @@ class SubnetPoolTests(common.NetworkTests): '--default-prefix-length 16 ' + '--min-prefix-length 16 ' + '--max-prefix-length 32 ' + - '--description aaaa ', + '--description aaaa ' + + '--default-quota 10 ', name, ) - self.addCleanup(self.openstack, 'subnet pool delete ' + new_name) + self.addCleanup( + self.openstack, + 'subnet pool delete ' + cmd_output['id'], + ) self.assertEqual( name, cmd_output["name"], @@ -202,6 +206,10 @@ class SubnetPoolTests(common.NetworkTests): 32, cmd_output["max_prefixlen"], ) + self.assertEqual( + 10, + cmd_output["default_quota"], + ) # Test set cmd_output = self.openstack( @@ -212,7 +220,8 @@ class SubnetPoolTests(common.NetworkTests): '--default-prefix-length 8 ' + '--min-prefix-length 8 ' + '--max-prefix-length 16 ' + - name + '--default-quota 20 ' + + name, ) self.assertOutput('', cmd_output) @@ -244,6 +253,28 @@ class SubnetPoolTests(common.NetworkTests): 16, cmd_output["max_prefixlen"], ) + self.assertEqual( + 20, + cmd_output["default_quota"], + ) + + # Test unset + # NOTE(dtroyer): The unset command --default-quota option DOES NOT + # WORK after a default quota has been set once on a + # pool. The error appears to be in a lower layer, + # once that is fixed add a test for subnet pool unset + # --default-quota. + # The unset command of --pool-prefixes also doesnt work + # right now. It would be fixed in a separate patch once + # the lower layer is fixed. + # cmd_output = self.openstack( + # '--debug ' + + # 'subnet pool unset ' + + # ' --pool-prefix 10.110.0.0/16 ' + + # new_name, + # ) + # self.assertOutput('', cmd_output) + # self.assertNone(cmd_output["prefixes"]) def _subnet_pool_create(self, cmd, name, is_type_ipv4=True): """Make a random subnet pool |
