summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Merge "Remove non-working code after method return."Zuul2021-10-071-5/+0
|\
| * Remove non-working code after method return.lsmman2021-10-061-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | Delete duplicate return code. While adding return of a new Member type, the existing return code part is not deleted. Note the code in fakes.py in the below commit where these codes were added. - Project: python-openstackclient - The commit: 60e7c51df4cf061ebbb435a959ad63c7d3a296bf Change-Id: Iae44770a784732991962cd38472095f76ab2543f
* | Merge "Add --trusted-image-cert option for server create"Zuul2021-10-061-0/+150
|\ \
| * | Add --trusted-image-cert option for server createPavlo Shchelokovskyy2021-09-301-0/+150
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | this already exists for server rebuild, but was missing for server create. This option is supported from Compute API version >= 2.63, and is only available for servers booted directly from images (not from volumes, not from snapshots, and not from images first converted to volumes). Additionally, this patch removes mentions of OS_TRUSTED_IMAGE_CERTIFICATE_IDS env var from similar option help string in server rebuild command as it is not actually implemented yet. Change-Id: I4e9faea05c499bd91034d1d284c44fdcc8e18db5
* | Replace assertItemsEqual with assertCountEqualAlfredo Moralejo2021-09-091-2/+2
|/ | | | | | | | | | Follow-up of [1]. After this patch was sent, two more assertItemsEqual were added in [2]. This patch is fixing it. [1] https://review.opendev.org/c/openstack/python-openstackclient/+/789410 [2] https://review.opendev.org/c/openstack/python-openstackclient/+/781637 Change-Id: Ic2276bd0ff0f5df76505f37d8994b3384d40e9a7
* Merge "compute: Add support for microversion 2.90"Zuul2021-09-021-16/+155
|\
| * compute: Add support for microversion 2.90Stephen Finucane2021-09-011-16/+155
| | | | | | | | | | | | | | | | | | Allow configuring hostname when creating a new server or updating or rebuilding an existing server. Change-Id: Ibe603eab78bbbec43605f56de62a20493b6aa93d Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Depends-On: https://review.opendev.org/c/openstack/python-novaclient/+/806917
* | compute: Add support for microversion 2.89Lee Yarwood2021-09-022-0/+52
|/ | | | | | | | | | This microversion drops the duplicate ``id`` field while adding ``attachment_id`` and ``bdm_uuid`` to the output of the os-volume_attachments API reflected within osc by the ``openstack server volume list $server``command. Depends-On: https://review.opendev.org/c/openstack/nova/+/804275 Change-Id: I8a7002d8d65d7795e106b768df868198ab8b8143
* Merge "L3 conntrack helper: Use singular name consistently"Zuul2021-08-261-2/+2
|\
| * L3 conntrack helper: Use singular name consistentlyAkihiro Motoki2021-06-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | We use singular form for delete command argument in all places. This commit replaces conntrack-helper-ids with a singular form. The only visible change is a fix for the help message below. openstack network l3 conntrack helper delete <router> <conntrack-helper-ids> [<conntrack-helper-ids> ...] Change-Id: I50bbd9f6199071bb86cbb2f37c45ebda1de58433
* | Merge "volume: Add 'volume transfer request create --(no-)snapshots' option"Zuul2021-08-261-0/+46
|\ \
| * | volume: Add 'volume transfer request create --(no-)snapshots' optionStephen Finucane2021-07-131-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | This closes a gap with cinderclient's 'transfer-create' command. Change-Id: I7386a7be15c0e3ee87abbcfc2275ba8524c10ff8 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Story: 2009054 Task: 42831
* | | Merge "volume: Add missing 'volume list --offset' parameter"Zuul2021-08-261-2/+6
|\ \ \
| * | | volume: Add missing 'volume list --offset' parameterStephen Finucane2021-07-271-2/+6
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Looking at the code for the ancient v1 cinder API, we see that this supported offset-style pagination [1][2][3]. Add this parameter, simplifying a future patch to standardize pagination across OSC. [1] https://github.com/openstack/cinder/blob/juno-eol/cinder/api/v1/volumes.py#L259 [2] https://github.com/openstack/cinder/blob/juno-eol/cinder/api/v1/volumes.py#L292 [3] https://github.com/openstack/cinder/blob/juno-eol/cinder/api/common.py#L120 Change-Id: Ifec208ea9ed7afb4bebced6132abb96a3af034b5 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | Merge "Replace assertItemsEqual with assertCountEqual"Zuul2021-08-2332-292/+292
|\ \ \
| * | | Replace assertItemsEqual with assertCountEqualDirk Mueller2021-05-0332-292/+292
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | assertItemsEqual was removed from Python's unittest.TestCase in Python 3.3 [1][2]. We have been able to use them since then, because testtools required unittest2, which still included it. With testtools removing Python 2.7 support [3][4], we will lose support for assertItemsEqual, so we should switch to use assertCountEqual. [1] - https://bugs.python.org/issue17866 [2] - https://hg.python.org/cpython/rev/d9921cb6e3cd [3] - testing-cabal/testtools#286 [4] - testing-cabal/testtools#277 Change-Id: I0bbffbec8889b8b3067cfe17d258f5cb16624f38
* | | | Show "Forced Down" compute service status with --longmelanie witt2021-08-172-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the unified client does not have the ability to show the "Forced Down" field of a GET /os-services response in microversion 2.11 even though the legacy client can. This adds a "Forced Down" column to the 'openstack compute service list --long' command output when microversion 2.11 is used. Story: 2009115 Task: 43011 Change-Id: I10bc2fedbf0e867a990227962b2b6e60f5681f69
* | | | Correct REST API response fields for /os-migrations APImelanie witt2021-07-282-5/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compute APIs are unfortunately inconsistent with regard to the response parameters for migrations. * GET /servers/{server_id}/migrations returns server_uuid * GET /os-migrations returns instance_uuid Because the 'Server UUID' column is being specified for parsing the response from GET /os-migrations, it is always showing as an empty string to users. There are a few other mismatches between the column names and the REST API response fields [1]: * 'Old Flavor' vs 'old_instance_type_id' * 'New Flavor' vs 'new_instance_type_id' * 'Type' vs 'migration_type' This adds a new list containing the REST API response field names to pass to utils.get_item_properties so that the responses are correctly parsed and the client output contains the response data instead of empty strings. Story: 2009078 Task: 42890 [1] https://docs.openstack.org/api-ref/compute/?expanded=list-migrations-detail#list-migrations Change-Id: I8aab60619e0225047f6a1c31e44917ca8fcc799e
* | | | Fix TestListMigrationV223 test class MIGRATION_COLUMNSmelanie witt2021-07-271-6/+3
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently only the test_server_migration_list adds the 'Id' and 'Type' columns to the expected output, so if the test_server_migration_list_no_options test is run by itself, it fails as the actual response contains 'Id' and 'Type' but the reference does not. This example run fails: tox -epy38 test_server_migration_list_no_options The reason the tests pass in the gate is because test_server_migration_list (which adds the 'Id' and 'Type' columns to self.MIGRATION_COLUMNS) appears to always run before test_server_migration_list_no_options, so the latter test gets the benefit of the former test's column additions. This changes the test class to just include the 'Id' and 'Type' columns all the time as they are always returned in microversion 2.23 anyway. Story: 2009079 Task: 42891 Change-Id: I2c97e9f64790b5e978e4d04230d45b8e343b53d4
* | | Merge "volume: Add more missing 'volume backup *' options"Zuul2021-06-212-1/+159
|\ \ \
| * | | volume: Add more missing 'volume backup *' optionsStephen Finucane2021-06-102-1/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an additional '--no-property' option to the 'volume backup set' command, along with a brand spanking new 'volume backup unset' command. Change-Id: Id7ca925e0ada03e259f0ecaf3e02af11c900641e Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | Merge "volume: Add 'volume group snapshot *' commands"Zuul2021-06-212-0/+315
|\ \ \ \ | |/ / /
| * | | volume: Add 'volume group snapshot *' commandsStephen Finucane2021-06-102-0/+315
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These mirror the 'cinder group-snapshot-*' commands, with arguments copied across essentially verbatim. The only significant departure is the replacement of "tenant" terminology with "project". volume group snapshot create volume group snapshot delete volume group snapshot list volume group snapshot show Change-Id: Ia5084749b7c1a5a936fd6d6e8d89b9b80969f68c Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | Merge "volume: Add 'volume group type *' commands"Zuul2021-06-212-1/+478
|\ \ \ \ | |/ / /
| * | | volume: Add 'volume group type *' commandsStephen Finucane2021-06-032-1/+478
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These mirror the 'cinder group-type-*' commands, with arguments copied across essentially verbatim. The only significant departure is the merging of some commands, such as 'group-type-default' and 'group-type-list' into 'group type list', and 'group-type-update' and 'group-type-key' into 'group type set/unset'. volume group type create volume group type delete volume group type list volume group type show volume group type set volume group type unset Change-Id: Iee6ee2f1f276e6ef6f75a74f8f2980f14c0d5e2f Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | Merge "volume: Add 'volume group *' commands"Zuul2021-06-182-0/+608
|\ \ \ \ | |/ / /
| * | | volume: Add 'volume group *' commandsStephen Finucane2021-06-032-0/+608
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These mirror the 'cinder group-*' commands, with arguments copied across essentially verbatim. The only significant departures are the replacement of "tenant" terminology with "project" and the merging of the various volume group replication action commands into the parent volume group (e.g. 'openstack volume group set --enable-replication' instead of 'cinder group enable-replication') volume group create volume group delete volume group list volume group show volume group set volume group failover Change-Id: I3b2c0cb92b8a53cc1c0cefa3313b80f59c9e5835 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | Merge "tests: Rename 'FakeType' -> 'FakeVolumeType'"Zuul2021-06-188-84/+91
|\ \ \ \ | |/ / /
| * | | tests: Rename 'FakeType' -> 'FakeVolumeType'Stephen Finucane2021-06-038-84/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are more types than just volume types. Change-Id: I6af66f966a221437ff79fabcb0b81fd38586fe67 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | Merge "volume: Add missing 'volume backup *' options"Zuul2021-06-181-5/+150
|\ \ \ \ | |/ / /
| * | | volume: Add missing 'volume backup *' optionsStephen Finucane2021-06-031-5/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a couple of missing options to each command: volume backup create --no-incremental --property --availability-zone volume backup set --property Most of these are version dependent so we add the relevant version checks as part of this work. While we're here, we also make the formatting a little easier on the eye in places. Change-Id: I328d5c981cb32b2ee9a4b1bd43aa36b22347ff63 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | Merge "volume: Add 'volume message *' commands"Zuul2021-06-182-0/+392
|\ \ \ \ | |/ / /
| * | | volume: Add 'volume message *' commandsStephen Finucane2021-06-032-0/+392
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements the necessary commands to utilize the Messages API introduced in Cinder API version 3.3. Version 3.5 built upon this by implementing pagination support for these commands which is present in this patch as well. volume message get volume message list volume message delete Change-Id: I64aa0b4a8d4468baa8c63e5e30ee31de68df999d
* | | | Merge "volume: Add 'volume attachment *' commands"Zuul2021-06-182-0/+715
|\ \ \ \ | |/ / / | | | / | |_|/ |/| |
| * | volume: Add 'volume attachment *' commandsStephen Finucane2021-06-032-0/+715
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These mirror the 'cinder attachment-*' commands, with arguments copied across essentially verbatim. The only significant departure is the replacement of "tenant" terminology with "project". volume attachment create volume attachment delete volume attachment list volume attachment complete volume attachment set volume attachment show Full support for filtering is deferred for now since that's a more complicated change that requires additional commands be added first. TODOs are included to this effect. Change-Id: If47c2b56fe65ee2cee07c000d6ae3688d5ef3b42 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | Add support for Neutron's L3 conntrack helper resourceSlawek Kaplonski2021-06-072-0/+391
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Allow to send extra attributes in Neutron related commandsSlawek Kaplonski2021-05-262-0/+198
|/ | | | | | | | | | To deprecate and drop support for neutronclient CLI and use only OSC we need feature parity between OSC and neutronclient. Last missing piece here is possibility to send in POST/PUT requests unknown parameters to the Neutron server. This patch adds such possibility to the OSC. Change-Id: Iba09297c2be9fb9fa0be1b3dc65755277b79230e
* Merge "volume: Re-add accidentally deleted test"Zuul2021-04-061-0/+742
|\
| * volume: Re-add accidentally deleted testStephen Finucane2021-03-191-0/+742
| | | | | | | | | | | | | | | | | | | | | | | | This is essentially a partial revert of change I94aa7a9824e44f9585ffb45e5e7637b9588539b4, which removed some deprecated commands like 'openstack snapshot *' in favour of 'openstack volume snapshot *'. Unfortunately the latter appeared to have no test coverage and were relying on tests for the former to validate behavior. Re-add the tests removed back then. Change-Id: Ib2cd975221034c8997d272d43cfb18acefc319fe Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "Implements hide image"Zuul2021-04-011-0/+68
|\ \
| * | Implements hide imageValery Tschopp2021-03-251-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | openstack image set [--hidden|--unhidden] IMAGE openstack image list --hidden Task: 41734 Story: 2008581 Change-Id: Ie84f10c0f7aa2e7b7f78bfadc70132a10673866e
* | | Merge "Remove unnecessary test"Zuul2021-03-201-30/+0
|\ \ \ | |_|/ |/| |
| * | Remove unnecessary testStephen Finucane2020-11-061-30/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | As noted, we're simply testing the default behavior of Python 3 in this test. Remove it, now that this is the only version(s) of Python 3 we have to worry about. Change-Id: I5f07343df8334457d907086033d5685f59c0bf0e Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | Merge "project cleanup"5.5.0Zuul2021-03-181-0/+183
|\ \ \