summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-11-09 18:50:43 +0000
committerGerrit Code Review <review@openstack.org>2020-11-09 18:50:43 +0000
commite2bd1530cf1fc5a84af4dc88829f3c73cdf694f2 (patch)
treedf4e95ad6093c15da8c6e6a48b752acfb74483c4 /openstackclient
parent4d3bad9f198628954f6c50fdb76b56e2d8ecc070 (diff)
parentffd7e939615975b68bb7ec011cdaea077d9201c9 (diff)
downloadpython-openstackclient-e2bd1530cf1fc5a84af4dc88829f3c73cdf694f2.tar.gz
Merge "functional: Remove test for 'quota set --force'"
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/tests/functional/common/test_quota.py44
1 files changed, 0 insertions, 44 deletions
diff --git a/openstackclient/tests/functional/common/test_quota.py b/openstackclient/tests/functional/common/test_quota.py
index 4c2fc0e3..9c057460 100644
--- a/openstackclient/tests/functional/common/test_quota.py
+++ b/openstackclient/tests/functional/common/test_quota.py
@@ -165,47 +165,3 @@ class QuotaTests(base.TestCase):
# returned attributes
self.assertTrue(cmd_output["key-pairs"] >= 0)
self.assertTrue(cmd_output["snapshots"] >= 0)
-
- def test_quota_set_force(self):
- """Test to set instance value by force """
- json_output = json.loads(self.openstack(
- 'quota list -f json --detail --compute'
- ))
- in_use = limit = None
- for j in json_output:
- if j["Resource"] == "instances":
- in_use = j["In Use"]
- limit = j["Limit"]
-
- # Reduce count of in_use
- in_use = in_use - 1
- # cannot have negative instances limit
- if in_use < 0:
- in_use = 0
-
- # set the limit by force now
- self.openstack(
- 'quota set ' + self.PROJECT_NAME +
- '--instances ' + str(in_use) + ' --force'
- )
- cmd_output = json.loads(self.openstack(
- 'quota show -f json ' + self.PROJECT_NAME
- ))
- self.assertIsNotNone(cmd_output)
- self.assertEqual(
- in_use,
- cmd_output["instances"]
- )
-
- # Set instances limit to original limit now
- self.openstack(
- 'quota set ' + self.PROJECT_NAME + '--instances ' + str(limit)
- )
- cmd_output = json.loads(self.openstack(
- 'quota show -f json ' + self.PROJECT_NAME
- ))
- self.assertIsNotNone(cmd_output)
- self.assertEqual(
- limit,
- cmd_output["instances"]
- )