summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional/common/test_quota.py
Commit message (Collapse)AuthorAgeFilesLines
* Blacken openstack.commonStephen Finucane2023-05-101-18/+32
| | | | | | | | | | Black used with the '-l 79 -S' flags. A future change will ignore this commit in git-blame history by adding a 'git-blame-ignore-revs' file. Change-Id: Ifcb3c798666d74d596b8ecb3d6d507f782de7ba5 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* tests: Convert more functional tests to use 'parse_output'Stephen Finucane2022-11-081-43/+56
| | | | | Change-Id: I1d968181eb196c6df4583c772c67ed58bc7ba585 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* quota: Deprecate "force" behavior for network quotasStephen Finucane2022-10-111-2/+2
| | | | | | | | | | | | In change Idc1b99492d609eb699d0a6bef6cd760458a774f6, we added a '--check-limit' option to enable "no force" behavior for network quotas. This was already the default for compute quotas. Provide a path for harmonizing the behavior of the two options by instead using a '--no-force' option which will become the eventual default for the network quotas also. Change-Id: I25828a3d68e2e900f498e17a0d01fb70be77548e Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* quota: Add 'quota show --usage' optionStephen Finucane2022-09-301-0/+4
| | | | | | | | | | | Provide an more sane way to get usage information for a particular project's quotas. This requires using the 'Lister' command type since the 'ShowOne' command type only allows for simple key-value pair output. We also add a note indicating that the '<project>' argument is optional. Change-Id: Ic7342cf08f024cc690049414c5eef5b9a7594677 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Skip test_quota_network_set_with_force func testDr. Jens Harbott2022-06-281-0/+1
| | | | | | | | | | | This test was added in [0] and it causes a lot of failures, since setting the network quota to 1 will result in quota errors for any other test that is trying to create a network in parallel. We can only run this test in a serial tempest task that would need to be created for such a scenario. Related-Story: 2010110 Change-Id: I6015c181ecabff26bdb1b0c11b0e33ad39e6f083
* Allow "--force" flag in quota network commandsRodolfo Alonso Hernandez2022-03-171-0/+47
| | | | | | | | | This flag allows to set a new Neutron quota resource limit without checking first the current resource usage. The new limit will be set anyway. This flag was used only by the compute engine. Related-Bug: #1953170 Change-Id: I7084f8208b804236ac99e6842db7a45854ce54d7
* Add network update quota "limit_check" parameterRodolfo Alonso Hernandez2021-12-071-0/+25
| | | | | | | | | | | | | This new parameter commands the Neutron server to first check the resource usage before setting the new quota limit. If the resource usage is below the new limit, the Neutron server will raise an exception. Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/806254 Depends-On: https://review.opendev.org/c/openstack/neutron/+/801470 Partial-Bug: #1936408 Change-Id: Idc1b99492d609eb699d0a6bef6cd760458a774f6
* functional: Remove test for 'quota set --force'Stephen Finucane2020-11-061-44/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change I1d1ac1ac46f49f64794ffc8631e166935537966c introduced the 'quota set --force' parameter to force set nova quotas. As part of that fix, we introduced a functional test, 'QuotaTests.test_quota_set_force' that works by attempting to set the 'limit' of the quota for instances to the current usage ('is_use') minus one. This test is flawed. It doesn't create any instances so when it fires by itself, it will always set the 'limit' to 0. When it fires at the same time as other tests (remember, we run tests in parallel), notably tests that rely on booting instances, it can cause other tests to fail with the following error: Quota exceeded for instances: Requested 1, but already used 0 of 0 instances (HTTP 403) We could attempt to work around this by creating a new project and using that project to fiddle with quotas. That's a lot of work though, and the returns are questionable: the 'quota set' command is an admin-only command by default and the '--force' parameter should almost never be used. Simply remove this test. Change-Id: Ic07ff6f4a7c1c27852c892eb906bb144aae91788 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Story: #2008327 Task: #41225
* Add '--force; parameter to 'openstack quota set'hackertron2020-04-141-0/+44
| | | | | | | | | The compute service allows us to to force set a quota, setting a quota value that is less than the amount of the resource currently consumed. Expose this feature by way of a '--force' boolean parameter. Change-Id: I1d1ac1ac46f49f64794ffc8631e166935537966c
* Fix service discovery in functional testsGlenn Van de Water2019-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | If a required service is not enabled then we skip the test. The discovery is done by tests/functional/base.py:is_service_enabled but this method is broken, credentials are not passed to the 'openstack service show' command so every call will fail and every test that relies on it will be skipped. This commit fixed that method and the issues that popped up when re-enabling tests. Network segment range: - issue where we assumed network-segment-range extension is always present - issue where we compare integers and string representations of numbers Subnet: - issue where we try to deepcopy an uncopyable object in UnsetSubnet Change-Id: Id3cc907c1ed2a25b49cf6f4a7233e0401a02383a Story: 2005169 Task: 29908
* Add support for get details of QuotaSławek Kapłoński2019-02-241-0/+32
| | | | | | | | | | With passing "--detail" argument to "openstack quota list", details about current usage should be returned. It is currently supported by Nova and Neutron so details of resources from those projects can be returned. Change-Id: I48fda15b34283bb7c66ea18ed28262f48b9229fe Related-Bug: #1716043
* Clean up the changes of os.environ in functional testsRui Chen2017-07-201-0/+1
| | | | | | | | | | | | Use fixtures to restore the API version changes of os.environ in each functional tests, aims to avoid the following test cases failing in unexpected context. And make sure setUpClass/tearDownClass call super class's corresponding methods first. Change-Id: Ie248fe9d3a9e25f1b076c9f2c363200f29a83817 Closes-Bug: #1696080
* Fix quota functional tests for nova-netDean Troyer2017-04-261-51/+102
| | | | | | | | | We need to skip some functional tests when testing against a nova-net cloud so add the bits to detect that. Also JSON-ify the quota functional tests and add the skips for nova-net. Change-Id: Ibfeeb3f967f34c98e80271a8214cf95dc50407f1
* OSC Quota ListSindhu Devale2017-03-101-0/+21
| | | | | | | | Implement Neutron feature of Quota List into OpenStack Client. Change-Id: Idf941acf8d00b136776b7381b877c56d82622f57 Partially-Implements: blueprint neutron-client-quota
* Fix quota set command error for SDK > 0.9.10Huanxuan Ao2017-01-151-3/+0
| | | | | | | | | | A bug in OpenStack SDK 0.9.11 and 0.9.12 that causes quota set command to fail. This can be removed when the proposed SDK fix (https://review.openstack.org/#/c/419911/) is released and in the minimum SDK version in global requirements. Closes-Bug: #1655445 Change-Id: I63132f5f762f0120282f8b92e72512763063e3c6
* Fix quota show --default commandDean Troyer2017-01-141-3/+0
| | | | | | | | | | | | Work around a bug in OpenStack SDK 0.9.11 and 0.9.12 that causes quota show --default to fail. This can be removed when the proposed SDK fix (https://review.openstack.org/420301) is reelased and in the minimum SDK version in global requirements. quota set --network is still broken, I can't fix it at the moment... Closes-bug: 1656572 Change-Id: Ice77e14782c33e672176afbab36bba95b73d7a11
* skip tests related to SDK 0912 and keystone IdP changeSteve Martinelli2017-01-071-0/+6
| | | | | | | the gate is super wedged, i will skip tests and unskip them as necessary. Change-Id: Ia4469738c876ec1293f91b96dcc7d15365f4f37d
* Revert "WIP: Skip broken functional tests..."Dean Troyer2016-12-291-6/+0
| | | | | | | | | SDK 0.9.11 caused some failures, its blocked now. Revert those breakages that occurred in 0.9.10 -> 0.9.11. This partially reverts commit 188e32f9e642fc5eaaec83d5c231aa890354671a. Change-Id: I8b350250dbdcbf5c4599dfb55f6685c0db18bb30
* WIP: Skip broken functional tests...Dean Troyer2016-12-231-0/+6
| | | | | | | | | ...so we don't have to fix them all in one review. Do not merge this until https://review.openstack.org/#/c/414649 is merged and funtional tests pass. Change-Id: I4f187111d3e4d8c4a613c20a946d6b5d3562e879
* Fix openstack quota set/show --class not workqtang2016-09-141-2/+11
| | | | | | | | identity_client should not be used for quota class operation. Update code to fix the qutoa class set/show issue. Change-Id: I71c59c08a0d5da29982497f589e1efe131997f21 Closes-Bug: #1609233
* Support fetching network project default quotaRui Chen2016-09-131-0/+11
| | | | | | | | | | Neutron server and openstacksdk had supported to fetch network project default quota, this patch add the CLI support in openstackclient. Change-Id: If0ef74c268c41a866c62156da0603a40ae4e6e31 Closes-Bug: #1204956 Depends-On: I6a4e2a146351dd1e7d652442511f1ef2c279da42
* move all functional tests to tests moduleSteve Martinelli2016-09-091-0/+42
functional tests should be grouped with other tests (unit and integration tests). as part of this commit the "common" module was renamed to just "base", this was done for simplicity. the post_test_hook.sh file was also copied to the functional module since it should live there. a separate change to the infra repo will be made to call the new location, once that is merged we can remove the old one (a new change will also be posted for that) Needed-By: I49d54f009021d65c1ae49faf6b3f0a7acdadd7b3 Change-Id: Ie8c334f6223373b8e06df8bd8466500d2a2c8ede