summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional
Commit message (Collapse)AuthorAgeFilesLines
* Migrate server_groups to the new APIViolet Kurtz2022-08-021-12/+12
| | | | | | Moved the server_groups to the new API. Change-Id: Ied7bd6f56e277f0c5efcd5ba028765f9be65050f
* Add support for CRUD operations for QoS minimum packet rate rulePrzemyslaw Szczerbik2022-07-011-0/+67
| | | | | | | Closes-Bug: #1922237 Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/810364 See-Also: https://review.opendev.org/785236 Change-Id: Ie7e1eb0575fd37121d5097ecbc318d0769ab3db0
* 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
* Merge "Allow to filter multiple tags for image list"Zuul2022-05-161-1/+7
|\
| * Allow to filter multiple tags for image listDmitriy Rabotyagov2022-05-161-1/+7
| | | | | | | | | | | | | | | | | | Currently in case of passing `--tag` several times, only last one will be picked up for the filtering. In the meanwhile Glance allow option to be repeated multiple times to filter based on the multiple tags. Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/789827 Change-Id: I7379d0b0014f0e3d13b02ee5ec6b642a7a5aa7d1
* | Merge "Fix typos"Zuul2022-05-164-8/+8
|\ \ | |/ |/|
| * Fix typosCyril Roelandt2021-10-264-8/+8
| | | | | | | | Change-Id: Idd502c8df21da79ff3b9339870f38378f5337879
* | Merge "tests: Improve logging for executed commands"Zuul2022-05-132-14/+40
|\ \
| * | tests: Improve logging for executed commandsStephen Finucane2021-12-092-14/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're seeing failures in a recently added tests, 'ServerTests.test_server_add_remove_volume' from 'openstackclient/tests/functional/compute/v2/test_server.py'. These failures are likely the result of slow CI nodes, but we don't have enough information in the CI logs to debug them. Starting logging the various commands executed in tests so that we can see these logs if and when tests fail. Change-Id: I4584dc5e6343fe8c8544431a527d8c3c7e7b3c5b Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | 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
* | | Fix 'server event list|show' for deleted serversmelanie witt2022-02-091-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of compute microversion >= 2.21, support for list and show of server events for deleted servers was added. This however wasn't working using the openstackclient because the compute GET /servers/{server_id} will not return a deleted server, so osc_lib.utils.find_resource() fails to find the server and the command bails early. This adds a check for a uuid-like <server> arg and uses it directly if the <server> cannot be found via find_resource(). A note is also added to the command help to indicate that list and show for deleted servers will only work if a server ID is passed (name will not work). Story: 2009841 Task: 44443 Change-Id: Icd33b3b9a3a1855d7893dd111bbb2aca059f45fd
* | | Merge "Support Neutron Local IP CRUD"Zuul2022-02-091-0/+161
|\ \ \
| * | | Support Neutron Local IP CRUDNurmatov Mamatisa2022-01-281-0/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for Neutron Local IP CRUD operations. Partial-Bug: #1930200 Depends-On: https://review.opendev.org/c/openstack/neutron/+/804523 Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/804988 Change-Id: I1095100efb27b8559412469f0a9d07fc0a3db9d5
* | | | Merge "Add network update quota "limit_check" parameter"Zuul2022-02-031-0/+25
|\ \ \ \ | |/ / / |/| | |
| * | | 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
* | | Fix volume set functional testDr. Jens Harbott2022-01-111-0/+1
| |/ |/| | | | | | | | | | | | | | | Sometimes it can happen that when extending a volume it is shown as status "extending" with the original size for a while. Wait for the volume to enter state "available" again before checking the result. Signed-off-by: Dr. Jens Harbott <harbott@osism.tech> Change-Id: Ib70cfa1c241ce94426214c7a05c550213f427caa
* | Switch openstack server remove port/network to using sdkDiwei Zhu2021-11-291-11/+83
| | | | | | | | Change-Id: I1540c1f52e9a107dba20eeea9dc323c5510fe2b1
* | Add functional test for server add/remove volume.Diwei Zhu2021-11-261-0/+59
| | | | | | | | Change-Id: I86a76f32790cafcff1d94364fb72f8890a8cb025
* | Switch openstack server add port/network to using sdk.Diwei Zhu2021-11-141-0/+48
|/ | | | | | | | | | | | | The old novaclient.v2.server.Server.interface_attach() method is replaced with proxy.create_server_interface(). In swargs, 'net_id' and 'port_id' are mutual-exclusive, if one of them is given with value, the other one cannot be None, as the API would responde with 400 (None is not string). In unit test, temporary method 'setup_sdk_servers_mock' is added, because other tests are still using the old 'setup_servers_mock'. Functional tests are added. Releasenote is generated. Change-Id: I9899f0509febc5143560a1859ae6344d0a6d1427
* tests: Handle removal of block-storage v2 APIStephen Finucane2021-07-234-30/+44
| | | | | | | | | | | | | | Cinder recently removed their v2 API [1] which is causing the functional tests to fail. Improve our 'is_service_enabled' test helper to use the 'versions show' command, which queries the service catalog and can give us information about the service version as well as answer the more general "is this service available" question. We also resolve a long-standing TODO in the process. [1] https://review.opendev.org/c/openstack/cinder/+/792299 Change-Id: I381069357aa008344e15327adf3a863c0c2e1f04 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Merge "Make functional Neutron tests running fine on ML2/OVN environments"Zuul2021-06-294-13/+45
|\
| * Make functional Neutron tests running fine on ML2/OVN environmentsSlawek Kaplonski2021-05-274-13/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Devstack recently switched default Neutron's backend from ML2/OVS to ML2/OVN. As OVN backend has some parity gaps and differences in some APIs, functional tests job was failing with ML2/OVN as some tests weren't properly skipped in case of missing some Neutron API extensions. This patch fixes that by doing some small changes in the functional tests: - skip DHCP/L3 agent tests when dhcp/l3 agent scheduler extensions aren't available, - skip updating neutron agent as OVN agents don't allows that, - skip service providers tests when there is no Neutron L3 agent available, - skip setting router as distributed as OVN backend don't supports that router's attribute at all. Depends-On: https://review.opendev.org/c/openstack/neutron/+/793141 Change-Id: I29a8db202086b0b49fed865409fa8ca244b98439
* | Add support for Neutron's L3 conntrack helper resourceSlawek Kaplonski2021-06-071-0/+145
|/ | | | | | | | | | | | | | Neutron has got CRUD API for L3 conntrack helper since some time. This patch adds support for it in the OSC. OpenStack SDK supports that since [1] This patch also bumps minimum OpenStack SDK version to the 0.56.0 as that version introduced support for the Neutron's L3 conntrack helper. [1] https://review.opendev.org/c/openstack/openstacksdk/+/782870 Change-Id: I55604182ae50b6ad70c8bc1f7efad8859f191269
* compute: Add functional tests for --block-deviceStephen Finucane2021-03-051-16/+148
| | | | | | | | | | | | | | | | | | | | | | This mostly reuses the existing tests for '--block-device-mapping', which can hopefully be removed at some point in the future. This highlights two issues with the implementation of this option. Firstly, the 'boot_index' parameter is not required so don't mandate it. Secondly, and more significantly, we were defaulting the destination type for the 'image' source type to 'local'. Nova only allows you to attach a single image to local mapping [1], which means this default would only make sense if you were expecting users to use the '--block-device' option exclusively and omit the '--image' option. This is the *less common* case so this is a bad default. Default instead to a destination type of 'volume' like everything else, and require users specifying '--block-device' alone to pass 'destination_type=local' explicitly. [1] https://github.com/openstack/nova/blob/c8a6f8d2e/nova/block_device.py#L193-L206 Change-Id: I1718be965f57c3bbdb8a14f3cfac967dd4c55b4d Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Merge "Support Neutron Address Group CRUD"Zuul2021-01-111-0/+177
|\
| * Support Neutron Address Group CRUDHang Yang2020-12-241-0/+177
| | | | | | | | | | | | | | | | | | | | Add support for Neutron address group CRUD operations. Subsequent patches will be added to use address groups in security group rules. Change-Id: I3c313fc9329837dde67815901528a34dca98ebcc Implements: blueprint address-groups-in-sg-rules Depends-On: https://review.opendev.org/738274 Depends-On: https://review.opendev.org/745594
* | Add 'server shelve --offload', 'server shelve --wait' optionsStephen Finucane2021-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The '--offload' option allows us to explicitly request that the server be offloaded once shelved or if already shelved. The '--wait' option allows us to wait for the shelve and/or offload operations to complete before returning. It is implied when attempting to offload a server than is not yet shelved. Change-Id: Id226831e3c09bc95c34b222151b27391a844b073 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | compute: Fix 'server group * -f yaml' outputStephen Finucane2021-01-061-6/+6
| | | | | | | | | | | | | | | | | | Make use of 'FormattableColumn'-derived formatters, which provide better output than what we were using before, particularly for the YAML output format. Change-Id: Id6d25a0a348596d5a0430ff7afbf87b049a76bc8 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | compute: Fix 'server * -f yaml' outputStephen Finucane2021-01-061-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make use of 'FormattableColumn'-derived formatters, which provide better output than what we were using before, particularly for the YAML output format. For example, compare before for the 'server show' command: $ openstack --os-compute-api-version 2.79 server show test-server -f yaml ... addresses: private=fdff:77e3:9bb4:0:f816:3eff:fe6d:a944, 10.0.0.44 flavor: disk='1', ephemeral='0', extra_specs.hw_rng:allowed='True', original_name='m1.tiny', ram='512', swap='0', vcpus='1' ... To after: $ openstack --os-compute-api-version 2.79 server show test-server -f yaml ... addresses: private: - fdff:77e3:9bb4:0:f816:3eff:fe6d:a944 - 10.0.0.44 flavor: disk: 1 ephemeral: 0 extra_specs: hw_rng:allowed: 'True' original_name: m1.tiny ram: 512 swap: 0 vcpus: 1 ... Similarly, compare before for 'server list': $ openstack --os-compute-api-version 2.79 server list -f yaml - ... Networks: private=fdff:77e3:9bb4:0:f816:3eff:fe6d:a944, 10.0.0.44 Power State: Running Properties: '' ... To after: $ openstack --os-compute-api-version 2.79 server list -f yaml - ... Networks: private: - fdff:77e3:9bb4:0:f816:3eff:fe6d:a944 - 10.0.0.44 Power State: 1 Properties: {} ... We also fix the human-readable output for the 'tags' field. Before: $ openstack --os-compute-api-version 2.79 server list ... | tags | ['bar', 'foo'] | After: $ openstack --os-compute-api-version 2.79 server list ... | tags | bar, foo | Change-Id: I7a8349106e211c57c4577b75326b39b88bd9ac1e Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | image: Unset properties rather than setting to NoneStephen Finucane2020-12-221-0/+2
|/ | | | | | | | | | | | | | | | | Currently, we attempt to unset an image property by setting it to None. This doesn't work for known properties and is rightly rejected by the Glance API with the following error: BadRequestException: 400: Client Error for url: http://172.20.4.87/image/v2/images/368c5751-2b0b-4a38-a255-fd146fe52d31, Bad Request The solution is to actually unset the field by deleting it. Change-Id: Ie156bedbe0f9244f82c81401679706f484caf9aa Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Story: #2008463 Task: #41493
* tests: Remove 'agent' functional testsStephen Finucane2020-11-161-196/+0
| | | | | | | | | | | | | | The 'os-agents' API was recently removed from nova [1]. Remove the functional tests, since they will always fail going forward but will continue to run on older stable branches. Also Squeeze https://review.opendev.org/#/c/762559/ inside, since those 2 are simultaneously blocking gate [1] https://review.opendev.org/#/c/749309/ Change-Id: I0bf7d4c0ba2a9d4637db0d209d8d52163d772f12 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* 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
* Fix formatting of the flavor propertiesArtem Goncharov2020-11-021-17/+26
| | | | | | | Do not stringify flavor properties to allow proper output formatting to json/yaml/etc Change-Id: I9f4c42acb85b726af87123134dd19de98fe95074
* Merge "Show words indicating booted from volume for server image"Zuul2020-09-301-2/+17
|\
| * Show words indicating booted from volume for server imagemelanie witt2020-08-271-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | For a server booted from a volume, nova API does not store an image_id and instead returns an empty string. Currently, openstackclient similarly shows an empty string for Image Name and Image ID for servers booted from volumes. To aid CLI users in understanding the meaning of no image_id, we can display the string "N/A (booted from volume)" in the image field if the server was booted from a volume. Change-Id: I9c62cf6fe23b2e934dcbf5ebbf706b2705d2e424
* | Merge "Output correct json for security groups in 'openstack server show'"Zuul2020-09-251-15/+24
|\ \
| * | Output correct json for security groups in 'openstack server show'jay2020-09-141-15/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes incorrect json output for 'openstack server show -f json'. The security group json output groups all the json as one for e.g. "security_groups": "name='group1'\nname='group2'" The correct output should be "security_groups" : [{"name" : "group1"}, {"name" : "group2"}] properties and volumes_attached fields also has similar issue. Story: 2007755 Change-Id: I1b1cac716329e0530400aff782c08000b21d8e1d
* | | Delete the testcases that arent needed anymoremb711d2020-07-233-32/+0
| |/ |/| | | | | | | | | | | | | The file test_examples.py has never worked since its written and and cli in the example directory are covered by other functional tests for container, flavor and object lists and they have better asserts. So, deleting the file Change-Id: Ib9af40da96e66354fe878e79a80048a58f8dd6fe
* | Merge "Add '--force; parameter to 'openstack quota set'"Zuul2020-07-061-0/+44
|\ \ | |/ |/|
| * 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
* | Resolve PEP8Pete Zaitcev2020-05-141-1/+0
| | | | | | | | | | | | | | | | No idea how this happened, but reviews started failing the pep8 gate job. The failures are legitimate, see the commit. I guess the pep8 tests became smarter and found these issues. Change-Id: Id9a0dad644134dafd68eed37fe8f41c583d7a619
* | Merge "Support for stateless security groups"Zuul2020-04-081-1/+3
|\ \
| * | Support for stateless security groupsTom Stappaerts2020-03-311-1/+3
| |/ | | | | | | | | | | | | | | | | | | | | Add support for stateful attribute of security groups, using --stateful and --no-stateful flag on security group. This allows a user to create security groups with stateful false. Change-Id: Ifd20b5fc47fd0ea0bb5aeda84820dcc0fb1e8847 Blueprint: stateless-security-groups Depends-On: https://review.opendev.org/711513/
* | Add command: router add/remove route --routeBence Romsics2020-03-301-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add commands to osc to call the two new API methods introduced by new Neutron extension: extraroute-atomic. Bump our openstacksdk requirement to >=0.38.0 which contains the corresponding sdk change. The lower-constraints of dogpile.cache and keystoneauth1 are bumped because of requirements bumps in openstacksdk. The lower-constraint of decorator is bumped because of problem already fixed by amotoki here: https://review.opendev.org/701706 Change-Id: Ia9b9c216f1d1161ebedac31594a2c464d77f4ae2 Depends-On: https://review.opendev.org/674324 Partial-Bug: #1826396 (rfe) Related-Change: https://review.opendev.org/655680 (spec)
* | Merge "Fix faulthy state argument choice"5.1.0Zuul2020-03-241-0/+18
|\ \
| * | Fix faulthy state argument choiceBram Verschueren2019-12-191-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The correct state name for a failing volume snapshot deletion is 'error_deleting' instead of 'error-deleting'. [1] [1] https://opendev.org/openstack/cinder/src/commit/89d6a5042fcb2ede5a0b1112d72fae805ea52fcd/cinder/objects/fields.py#L126 Task: #37844 Story: #2007037 Change-Id: Ia99900ece4f1cd29769b22ddaa3965789d719556
* | | Merge "Now we can add description for role creation in OSC"Zuul2020-03-202-1/+26
|\ \ \ | |_|/ |/| |
| * | Now we can add description for role creation in OSCM V P Nitesh2018-09-182-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now user can add the description when user create's the role using OSC ``openstack role create`` command. User can add the description by adding `--description <Description>` to OSC ``openstack role create`` command. Co-Authored-By: Deepak Mourya<deepakmoriya7@gmail.com> Change-Id: I858e004c3b29c687b6a39c8a1ed5fb029eb19c67 Depends-on: I230af9cc833af13064636b5d9a7ce6334c3f6e9a Closes-Bug: #1669080
* | | Merge "Create Volume v3 functional tests"Zuul2020-01-135-11/+1031
|\ \ \
| * | | Create Volume v3 functional testsDean Troyer2019-11-185-11/+1031
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now-ish Volume v3 has been a pass-through to v2. In order to prepare to make the Volume v3 commands stand-alone copy the v2 functional tests to v3. This is the first of a series of reviews to completely separate Volume v2 and v3 commands. Once these are split we can begin to implement v3 microversion support and/or start using the OpenStack SDK as the REST library. Change-Id: Iefd78d8ef6bb851d7360596337a88ee8f8476767 Signed-off-by: Dean Troyer <dtroyer@gmail.com>