summaryrefslogtreecommitdiff
path: root/openstackclient/tests
Commit message (Collapse)AuthorAgeFilesLines
* compute: Require image when rebuilding a volume-backed serverstable/yogawhoami-rajat2022-09-301-0/+19
| | | | | | | | | | | | | | | A volume-backed server will have no image attribute (or rather the image property will be set to the empty string). As such, if you want to try rebuild you will need to specify an image [*]. Enforce this. [*] Before microversion 2.93, this must be the same image. However, we don't touch on that here. This will be addressed later. Change-Id: I6842dabd7acb4e3a78f894e55e616625757eb6a4 Story: 2010297 Task: 46290 (cherry picked from commit 1f63034441a63b968185e1678049c01205b8e6d7) (cherry picked from commit 0118d57c027c630f726dba4659c1e554ba833405)
* Fix: create image from volume commandwhoami-rajat2022-07-011-1/+105
| | | | | | | | | | | | | | | | | | | | | Currently the command ``openstack image create --volume`` calls cinderclient to upload the volume to image service (glance) but OSC passes ``visibility`` and ``protected`` fields which are only available in microversion 3.1 or greater. This generates an error if the user is using volume microversion < 3.1 and wants to create an image from volume. This patch fixes that by only passing ``visibility`` and ``protected`` fields when the volume microversion is 3.1 or greater and fail otherwise i.e. the following 3 cases: 1) visibility/protected argument + mv >= 3.1 = pass 2) visibility/protected argument + mv < 3.1 = fail 3) not visibility/protected argument + any mv = pass Story: 2010060 Task: 45511 Change-Id: I568a0ea0af8f7f82b16d49a6a1bb0391b99c50dc (cherry picked from commit 9eea28ba59e44526b9d6f1ad9f80c3553d5853e2) Conflicts: openstackclient/image/v2/image.py
* Add support for setting extra DHCP options on existing portsSlawek Kaplonski2022-02-211-0/+21
| | | | | | | | | It is now possible to set extra DHCP option for an existing port using "port set" command. It works in the same way like during port creation. Story: 2009095 Task: 42927 Change-Id: I3577d4e3a303137b708ae8687c44b486aa82e296
* Merge "image: Sanity check the 'SetImage' command"Zuul2022-02-091-9/+3
|\
| * image: Sanity check the 'SetImage' commandStephen Finucane2021-11-171-9/+3
| | | | | | | | | | | | | | | | | | This was a very difficult command to grok, due to the layering on of additional features over the years. Make this a little easier to follow by grouping related logic and making use of argparse features. Change-Id: I4e1a0aed09ea5d6a8c26ec3e888c9c7b6cefc25a Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "tests: Update fake image client in tests"Zuul2022-02-094-36/+28
|\ \ | |/
| * tests: Update fake image client in testsStephen Finucane2021-11-174-36/+28
| | | | | | | | | | | | | | | | | | | | | | These clients are intended to fake out the old glanceclient client which we no longer use. They were only "working" because we weren't actually using any of the glancelclient-based stuff and were instead overriding everything within the tests. Move these overrides back to the main fake client and remove the crud. Change-Id: I92ee74a1df72a6dd23f9d2dc04342aab0cbd3210 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "image: Remove FakeImage test helper"Zuul2022-02-0911-222/+187
|\ \ | |/
| * image: Remove FakeImage test helperStephen Finucane2021-11-1711-222/+187
| | | | | | | | | | | | | | | | | | We're no longer creating fake versions of glanceclient's 'Resource' object but rather openstacksdk objects. As such, there's no point nesting things under a fake resource class. Change-Id: I39cd5302622f4542db9eebcccfad0cb90d077441 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "compute: Don't warn if disk overcommit params unset"Zuul2022-02-091-10/+10
|\ \
| * | 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-094-0/+1107
|\ \ \
| * | | Support Neutron Local IP CRUDNurmatov Mamatisa2022-01-284-0/+1107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-032-0/+68
|\ \ \ \ | |/ / / |/| | |
| * | | Add network update quota "limit_check" parameterRodolfo Alonso Hernandez2021-12-072-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | 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
* | | | | 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-302-19/+94
|\ \ \ \ \ \ \ \
| * | | | | | | | Switch openstack server remove port/network to using sdkDiwei Zhu2021-11-292-19/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | Add functional test for server add/remove volume.Diwei Zhu2021-11-261-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I86a76f32790cafcff1d94364fb72f8890a8cb025