summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | compute: Don't warn if disk overcommit params unsetStephen Finucane2021-11-031-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to a small logic error, we were emitting a warning about a deprecated option when the user tried to live migrate an instance using microversion 2.25 even though the user hadn't actually set that option. Correct this. Change-Id: Ib61e817bd4ced9b5533e7c7f9d8f0b45fe81c211 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Story: 2009657 Task: 43836
* | | | Merge "Support Neutron Local IP CRUD"Zuul2022-02-093-0/+946
|\ \ \ \
| * | | | Support Neutron Local IP CRUDNurmatov Mamatisa2022-01-283-0/+946
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+43
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Add network update quota "limit_check" parameterRodolfo Alonso Hernandez2021-12-071-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | Merge "Get rid of tenant_id in the network commands"Zuul2022-01-1719-133/+77
|\ \ \ \ \
| * | | | | Get rid of tenant_id in the network commandsArtem Goncharov2022-01-1719-133/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Finally drop tenant_id completely from the networking service. Change-Id: I5f62f2a76592eaaaed6703624e959df41a6ecc8f
* | | | | | Switch compute service list, delete and set to sdk.Ritvik Vinodkumar2022-01-142-96/+164
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | Switch the compute service commands from novaclient to SDK. Change-Id: I16498905101d6c2702a3ccbaf8cf5e3098d51992
* | | | | Merge "Add --security-group to port list"Zuul2022-01-131-0/+20
|\ \ \ \ \
| * | | | | Add --security-group to port listRodolfo Alonso Hernandez2021-12-021-0/+20
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The neutron API supports filtering ports by security group. Closes-Bug: #1405057 Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/804979 Change-Id: I0f626882716c21ac200c1b929ea04664d21874d8
* | | | | Merge "Include hosts in aggregate list --long"Zuul2021-12-251-0/+2
|\ \ \ \ \
| * | | | | Include hosts in aggregate list --longDavid Caro2021-06-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it easier to get the total list of aggregates and the hosts belonging to each of them (specially for scripting purposes). Change-Id: I94833c15075ae655bc11e7c0fc47c0abad5846fc Signed-off-by: David Caro <me@dcaro.es>
* | | | | | Merge "compute: Return information about fixed IP"Zuul2021-12-252-28/+117
|\ \ \ \ \ \
| * | | | | | compute: Return information about fixed IPStephen Finucane2021-12-142-28/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compute API provides this information to us. We might as well use it. Change-Id: I5608fa80745975ce49712718452cfe296c0f64d2 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | | | Merge "Switch add fixed IP to SDK"Zuul2021-12-251-45/+179
|\ \ \ \ \ \ \ | |/ / / / / /
| * | | | | | Switch add fixed IP to SDKRitvik Vinodkumar2021-12-141-45/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch the add fixed IP command from novaclient to SDK. Change-Id: I4752ea7b4bfc17e04b8f46dbe9a68d938501a89e
* | | | | | | Merge "compute: Pass through args to ssh"Zuul2021-12-251-5/+45
|\ \ \ \ \ \ \
| * | | | | | | compute: Pass through args to sshHugh Saunders2021-12-151-5/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why limit a user to preset ssh arguments? Capture them all and send them along to ssh to deal with. This allows users to use the full range of ssh arguments, including specifying a command to run on the instance. For example: openstack server ssh -4 upg -- -l cirros -i ~/id_rsa_upg "date; uptime" SSH arguments that openstackclient currently mirrors are deprecated except for -4 and -6, as they are useful for retrieving the correct instance IP. Change-Id: Ia50786d5eee52688e180550fe16aeb8af610154b Co-authored-by: Stephen Finucane <stephen@that.guru>
* | | | | | | | Merge "compute: Fix weird option definition for 'server ssh'"Zuul2021-12-251-0/+77
|\ \ \ \ \ \ \ \ | |/ / / / / / /
| * | | | | | | compute: Fix weird option definition for 'server ssh'Stephen Finucane2021-12-151-0/+77
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | argparse allows you to specify multiple options for a given argument when declaring the argument. For some reason, we weren't doing this for the 'server ssh' command. There's no apparent reason for doing things this way and it's been that way since the beginning (2013) so let's not do that. We also add unit tests since they were missing and should exist. Change-Id: I67a9e6516d7057266210cd4083e9ddeb1cfaa5de Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | | | Add location to fake network objectsDr. Jens Harbott2021-12-161-4/+30
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Network objects returned from the SDK include a location column which has a reference to the cloud to which the object belongs. Add this column to our fake objects used for testing, so that we can make sure we don't include them in CLI output where they are useless. Change-Id: Ib09027af78e7bf2458cdc76ea9027faa3dbbfcf9 Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
* | | | | | Merge "Allow unset port's host_id"Zuul2021-12-131-1/+4
|\ \ \ \ \ \
| * | | | | | Allow unset port's host_idSlawek Kaplonski2021-11-281-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is supported by Neutron and needs to be done like that when e.g. admin wants to unbound port from the host. Task: #44043 Story: #2009705 Change-Id: I08f1bb40f4dc72cfa7c62feeb5f513455de0ca45
* | | | | | | Allow setting gateway when creating a routerDr. Jens Harbott2021-12-091-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These options are not only valid when modifying a router, but also when one is created initially. Signed-off-by: Dr. Jens Harbott <harbott@osism.tech> Change-Id: I3e12901f37cbd1639ac9dc9cc49b04114b80474c
* | | | | | | Fix RemoveServerVolumeDr. Jens Harbott2021-12-081-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The nova API we're using to delete a server volume attachment needs to be handed a volume, not a volume attachment. Also make sure that we create an error if the volume isn't actually attached to the server. Signed-off-by: Dr. Jens Harbott <harbott@osism.tech> Co-authored-by: Stephen Finucane <sfinucan@redhat.com> Change-Id: I12abd3787ea47acb4da282d00fdc1989405a0564
* | | | | | | Merge "compute: Show flavor in 'server list' with API >= 2.47"Zuul2021-11-301-240/+318
|\ \ \ \ \ \ \
| * | | | | | | compute: Show flavor in 'server list' with API >= 2.47Khomesh Thakre2021-11-301-240/+318
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the issue where the flavor name was empty in server list output. This requires somewhat invasive unit test changes to reflect the changed API response from the server, but this has the upside of meaning we don't need new tests since what we have validates things. Also drop the flavor ID column as it is removed from the compute API. Change-Id: Ica3320242a38901c1180b2b29109c9474366fde0 Signed-off-by: Khomesh Thakre <khomeshthakre24@gmail.com> Story: 2008257 Task: 41113
* | | | | | | | Merge "Switch openstack server remove port/network to using sdk"Zuul2021-11-301-8/+11
|\ \ \ \ \ \ \ \
| * | | | | | | | Switch openstack server remove port/network to using sdkDiwei Zhu2021-11-291-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I1540c1f52e9a107dba20eeea9dc323c5510fe2b1
* | | | | | | | | Merge "Switch server suspend and server resume to SDK"Zuul2021-11-301-4/+4
|\ \ \ \ \ \ \ \ \
| * | | | | | | | | Switch server suspend and server resume to SDKThrivikram Mudunuri2021-11-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch the server suspend and server resume commands from novaclient to SDK. Use the SDK versions of test fakes to support fake Server resources. Change-Id: Idd0b4f13fab0f238e42844a7d759538bbda24f68
* | | | | | | | | | Merge "Switch server pause and server unpause to SDK"Zuul2021-11-301-4/+20
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / /
| * | | | | | | | | Switch server pause and server unpause to SDKThrivikram Mudunuri2021-11-291-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch the server pause and server unpause commands from novaclient to SDK. Use the SDK versions of test fakes to support fake Server resources. Change-Id: Id626f06f3d7edd44b306b7fc7b9b00d04af09621
* | | | | | | | | | Merge "image: Remove dead test helper methods"Zuul2021-11-292-204/+0
|\ \ \ \ \ \ \ \ \ \ | |_|_|/ / / / / / / |/| | | | | | | | / | | |_|_|_|_|_|_|/ | |/| | | | | | |
| * | | | | | | | image: Remove dead test helper methodsStephen Finucane2021-11-172-204/+0
| | |_|/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These haven't been used since we switched the image commands from glanceclient to openstacksdk. There's more cleanup to be done here but that can be done later. Change-Id: I3de1f24323886b122b3a30660fb3de18eb7014e9 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | | | | Merge "Switch server image create to SDK"Zuul2021-11-291-15/+12
|\ \ \ \ \ \ \ \ | |_|/ / / / / / |/| | | | | | |
| * | | | | | | Switch server image create to SDKThrivikram Mudunuri2021-11-161-15/+12
| | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch the server image create command from novaclient to SDK. Use the SDK versions of test fakes to support fake Server resources. Also, fetch updated image *after* waiting. If a user requests that we wait (--wait) for a server image to become active before returning, then we should probably return the final image. If we don't then the image can appear to be in a non-active state when it fact it's active. Correct this by fetching the image after the wait call. Change-Id: I83a403c035add9ab041ed6d59b5b29e42267f143
* | | | | | | Switch command server remove volume to sdkDiwei Zhu2021-11-261-3/+42
| |_|/ / / / |/| | | | | | | | | | | | | | | | | Change-Id: If6f6cf93b55a67e767c54de8ce21f25252cf99ca
* | | | | | Merge "Switch command server add volume to sdk."Zuul2021-11-253-149/+275
|\ \ \ \ \ \
| * | | | | | Switch command server add volume to sdk.Diwei Zhu2021-11-223-149/+275
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | File tests.unit.volume.v2.fakes is modified to provide sdk volume fakes. File tests.unit.compute.v2.fakes is modified to provide sdk volume attachment fakes. For test, setup_sdk_volumes_mock() method is created so that volumes are created in similar way as servers are created. Change-Id: I290ba83b6ba27a1377ab73fd0ae06ecced25efd1
* | | | | | Merge "Add --subnet-pool to subnet list"Zuul2021-11-251-0/+42
|\ \ \ \ \ \ | |/ / / / / |/| | | | |
| * | | | | Add --subnet-pool to subnet listBrian Haley2021-03-161-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The neutron API supports filtering subnets by subnet pool id, but the CLI was missing support for it. Change-Id: Ic230c2c5cda8255d8f2c422880aeac81670b2df3
* | | | | | Merge "Switch openstack server add port/network to using sdk."Zuul2021-11-151-17/+41
|\ \ \ \ \ \
| * | | | | | Switch openstack server add port/network to using sdk.Diwei Zhu2021-11-141-17/+41
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | compute: Return details of attached volumes5.7.0Stephen Finucane2021-11-031-8/+83
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API behind the 'server add volume' command returns details of the created volume attachment, however, we were dropping these results rather than displaying them to the user. Correct this. Change-Id: I3f7e121220d29422ccf4e6940de2f28bb8496c83 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | Merge "Switch server backup to sdk."Zuul2021-10-272-61/+112
|\ \ \ \ \ | |_|_|/ / |/| | | |
| * | | | Switch server backup to sdk.Diwei Zhu2021-10-272-61/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch this command from novaclient to SDK. As this is the first command related to server that we are migrating, we need to extend our test fakes to support fake Server resources. The extended fakes will replace the old ones once all commands related to server are switched. Change-Id: If476fb1614a64320ed071bbda35e941bf3290a2e
* | | | | Remove remnants of 'six'Stephen Finucane2021-10-211-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just one entry left. Remove it. Change-Id: Ia12173ecb7f3fed4a1195a46ebf9b096d917b3b6 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | Remove 'get_osc_show_columns_for_sdk_resource' duplicatesStephen Finucane2021-10-211-59/+0
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were a number of 'get_osc_show_columns_for_sdk_resource' defined in-tree. However, osc-lib has provided this method for some time (since 2.2.0, June 2020 [1] - our minimum version is currently 2.3.0) so there's no need to provide our own copies. Remove them. [1] https://github.com/openstack/osc-lib/commit/29a0c5a5 Change-Id: I25695f4f9a379dd691b7eaa1e3247164668ae77e Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | compute: Fix filtering servers by tagsStephen Finucane2021-10-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The nova API expects the 'tags' and 'not-tags' filters of the 'GET /servers' (list servers) API to be a CSV string [1]: tags (Optional) A list of tags to filter the server list by. Servers that match all tags in this list will be returned. Boolean expression in this case is 't1 AND t2'. Tags in query must be separated by comma. New in version 2.26 not-tags (Optional) A list of tags to filter the server list by. Servers that don’t match all tags in this list will be returned. Boolean expression in this case is 'NOT (t1 AND t2)'. Tags in query must be separated by comma. New in version 2.26 We were instead providing a Python list, which was simply being URL encoded. Correct this. [1] https://docs.openstack.org/api-ref/compute/?expanded=list-servers-detail#list-servers Change-Id: Ie0251a0dccdf3385089e5bbaedf646a5e928cc48 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Closes-Bug: #1946816