summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/volume
Commit message (Collapse)AuthorAgeFilesLines
* Switch image to use SDKArtem Goncharov2020-03-231-4/+4
| | | | | | | | | | | | | This is a work to switch OSC from using glanceclient to OpenStackSDK. With this change only v2 is using OpenStackSDK. V1 is still using glanceclient and will be switched in a separate change. Remove the direct depend on keystoneauth- let that flow through openstacksdk. Depends-on: https://review.opendev.org/#/c/698972 Change-Id: I36f292fb70c98f6e558f58be55d533d979c47ca7
* Raise flake8-import-order version to latestSean McGinnis2020-01-1015-32/+26
| | | | | | | | | | | We had this library capped at a release that is a few years old. Now that we have dropped py2 testing, we can pick up the latest version. This uncovered a few things to clean up. Mostly the fact that mock is now a part of the StdLib unittest since Python 3.3. Change-Id: I27484dd4c25378413ff16e97a35a1a46062357bc Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* Merge "Use cliff formattable columns in volume v2 commands"Zuul2019-06-236-111/+146
|\
| * Use cliff formattable columns in volume v2 commandsAkihiro Motoki2019-06-226-111/+146
| | | | | | | | | | | | | | Partial-Bug: #1687955 Partially implement blueprint osc-formattable-columns Change-Id: I761ccac126208927594ad0d98a3cf5ad8b44bd48
* | Use cliff formattable columns in volume v1 commandsAkihiro Motoki2019-06-224-59/+119
|/ | | | | | | Partial-Bug: #1687955 Partially implement blueprint osc-formattable-columns Change-Id: Ib4c5798171e32a8ddc08a37ee1d416e366a71d76
* Remove deprecated volume commands and argsSean McGinnis2019-05-207-1412/+19
| | | | | | | | | | | | | | | | | | | | | The following were deprecated over two years ago and can now be removed: * Remove ``backup`` commands in favor of ``volume backup`` * Remove ``snapshot`` commands in favor of ``volume snapshot`` * Remove ``volume create`` options ``--project``, ``--user`` and ``--multi-attach`` * Use of an auth-key positional argument in volume transfers * ``volume transfer request`` no longer accepts 'auth_key' as a positional arg, ``--auth-key`` is now required Internal (non-user-visible) * Rename backup.py to volume_backup.py for Volume v1 and v2, update tests These are backwards incompatible changes and will require a major version bump after they are merged. Change-Id: I94aa7a9824e44f9585ffb45e5e7637b9588539b4 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com> Signed-off-by: Dean Troyer <dtroyer@gmail.com>
* Merge "Add --attached / --detached parameter to volume set"Zuul2019-03-061-0/+36
|\
| * Add --attached / --detached parameter to volume setDavid Rabel2019-02-281-0/+36
| | | | | | | | | | | | | | | | | | As to reflect cinder reset-state --attach-status functionality, this patch adds --attached / --detached parameter to OSC's volume set command. Change-Id: Ic8ee928c9ab0e579512cfb7608f63bfcc2993c7b Closes-Bug: #1745699
* | Fix: Restore output 'VolumeBackupsRestore' object is not iterablewhoami-rajat2019-02-271-2/+4
|/ | | | | | | | | | | VolumeBackupsRetore object has '_info' attribute which contains the output data of the restore command which should be returned instead of the 'VolumeBackupsRestore' object. Change-Id: I64b75649c1ac9c24e05a197f7280975564b4d386 Story: 2004740 Task: 28811
* Add volume backup import/export commandsSean McGinnis2018-11-102-0/+143
| | | | | | | | | | | | | | | | | | This adds commands to import and export volume backup records so they can be imported and restored on other Cinder instances or to the original instance if the service or database has been lost and had to be rebuilt. I know this is a commonly used process by some users, so it would be good to have this functionality in osc so they do not have to switch clients. More details about the export and import process can be found here: https://docs.openstack.org/cinder/latest/admin/blockstorage-volume-backups-export-import.html Change-Id: Ic95f87b36a416a2b50cb2193fd5759ab59336975 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* Merge "Remove invalid 'unlock-volume' migration arg"Zuul2018-11-081-24/+0
|\
| * Remove invalid 'unlock-volume' migration argSean McGinnis2018-10-261-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is an optional flag that can be passed in to a volume migration to tell Cinder to 'lock' a volume so no other process can abort the migration. This is reflected correctly with the --lock-volume argument flag to `openstack volume migrate`, but there is another --unlock-volume flag that is shown in the help text for this command that does not do anything and is not used anywhere. Since there is no action to "unlock" a volume, this just causes confusion - including for Cinder developers that know this API. To avoid confusion, this invalid flag should just be removed from the command. Change-Id: I5f111ed58803a1bf5d34e828341d735099247108
* | Merge "Address issues from volume backend commands"Zuul2018-11-021-33/+33
|\ \
| * | Address issues from volume backend commandsSean McGinnis2018-10-121-33/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes some minor issues in release notes and the command list for the new volume backend commands. Also sorts the fakes used for volume unit tests to allow for multiple command update patches to hopefully reduce the odds of merge conflicts. Change-Id: Ic6e40f4c639368338cf085c68c17038f81da5361 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* | | Merge "Handle not having cinderclient.v1 available"Zuul2018-10-152-13/+2
|\ \ \ | |/ / |/| |
| * | Handle not having cinderclient.v1 availableSean McGinnis2018-10-122-13/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Cinder v1 API was deprecated several years ago and may be removed from python-cinderclient in the near future. To handle the case where v1 is no longer present, this updates cinderclient initialization to work without it and give an appropriate error if v1 is requested with a version where it is no longer available. Change-Id: I277d7b48b8ad4cce383ec3722f8117938378f615 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* | | Add volume backend pool list commandSean McGinnis2018-10-092-0/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds an equivalent for "cinder get-pools" with "volume backend pool list" and "cinder get-pools --detail" with "volume backend pool list --long". Story: 1655624 Task: 136949 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com> Change-Id: I826c9946ffe11340d44ad57914f72fc2a72b6938
* | | Add volume backend capability show commandSean McGinnis2018-10-092-0/+134
|/ / | | | | | | | | | | | | | | | | | | | | Adds and equivalend for "cinder get-capabilities" command to show the capabilities supported by a Cinder backend. Story: 1655624 Task: 26947 Change-Id: I38686a26cd503e45ce0102705a6632994ef10274 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* | Deprecate volume create --project and --user optionsAlan Bishop2018-08-101-84/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cinder's volume create API does not support overriding the project_id and user_id, and it silently igores those API inputs. Cinder always uses the project and user info in the keystone identity associated with the API request. If a user specifies the --project or --user option, the volume create is aborted and a CommandError exception is raised. This prevents a volume from being created, but without the desired project/user values. A user wishing to specify alternate values can still do so using identity overrides (e.g. --os-username, --os-project-id). Story: 2002583 Task: 22192 Change-Id: Ia9f910ea1b0e61797e8c8c463fa28e7390f15bf9
* | Fix broken gate jobsFan Zhang2018-08-071-47/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch aims at fixing the broken gate jobs because of cinder and glance patches [1], [2], [3] and [4]. * Remove parameter `--source-replicated` to drop volume replication v1 support * Address some timing issues with volume transfer requests * Only run Image v1 tests when the test cloud has v1 available * Get tolerant of unexpected additional attributes being returned in Image data [1].https://review.openstack.org/#/c/586293/ [2].https://review.openstack.org/#/c/532503/ [3].https://review.openstack.org/#/c/533564/ [4].https://review.openstack.org/#/c/578755/ Co-Authored-By: Dean Troyer <dtroyer@gmail.com> Co-Authored-By: Monty Taylor <mordred@inaugust.com> Depends-on: https://review.openstack.org/588664 Change-Id: I2a785750e92155185d3344e6116c7f5c6fdd3cbe Signed-off-by: Fan Zhang <zh.f@outlook.com>
* | Pass volume snapshot size to volume createMonty Taylor2018-07-231-1/+1
|/ | | | | | | | | When creating a volume from a snapshot, the size parameter is required and type is checked. Since we have to pass something and it needs to be a valid data type (None is not acceptable) grab the size from the snapshot object and pass it. Change-Id: Ie23e3d23828919234e40336b5c65b22e140d337c
* Fix limits show command without Nova and CinderJude Cross2018-04-031-0/+100
| | | | | | | | | This patch implements an endpoint lookup when showing limits. This addresses the issue when showing limits without both Nova and Cinder and will display limits if one is missing. Change-Id: I2214b281e0206f8fe117aae52de2bf4c4e2c6525 Closes-bug: #1707960
* Use flake8-import-order pluginAkihiro Motoki2017-08-177-7/+8
| | | | | | | | | | | | | | | | In reviews we usually check import grouping but it is boring. By using flake8-import-order plugin, we can avoid this. It enforces loose checking so it sounds good to use it. This flake8 plugin is already used in tempest. Note that flake8-import-order version is pinned to avoid unexpected breakage of pep8 job. Setup for unit tests of hacking rules is tweaked to disable flake8-import-order checks. This extension assumes an actual file exists and causes hacking rule unit tests. Change-Id: I12b596820727aeeb379bee16c2bc993dee9eb637
* Fix unit test failures related to new os-client-config and osc-libAkihiro Motoki2017-07-121-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | [breakage related to os-client-config 1.28.0] os-client-config 1.28.0 add a check if filebased and envvars are both used. This check causes OSC unit test failure. OSC now instantiates OpenStackConfig twice as a workaround. The unit test mocks _load_config_file() and it returns a config dict, but os-client-config OpenStackConfig.__init__ updates the dict returned. As a result, when OpenStackConfig is instantiated second time, the mock of _load_config_file returns a modified version of the config dict. This hits the new check in os-client-config 1.28.0. This commit changes the mock to use side_effect rather than return_value to ensure the original dict is used. [breakage related to osc-lib 1.7.0] The change in osc-lib 1.7.0 added "if" logic to avoid calling get() twice. In tests.unit.volume.test_find_resource, kwargs is empty dict in find_resource(), so the second call to get() is NOT called now. Removing the second elements of side_effect addresses the unit failure. Co-Authored-By: Rui Chen <chenrui.momo@gmail.com> Change-Id: Ib9d14661b2755bbd6619e15c0d9023fbc9d27d70 Closes-Bug: #1703782 Closes-Bug: #1703783
* Replace "Display Name" by "Name" in volume listRui Chen2017-05-262-18/+126
| | | | | | | | | | | | | | | | | | Current "volume list --name" command use "display_name" as search_opts to send to cinder API, and show the result table with "Display Name" column title in osc, cinder list API support "name" as search opts too, and there is "name" attribute in volume response body, so we can replace all "Display Name" by "Name" in order to keep "volume list" command consistent with other commands, like: server list, network list and so on, only use "Name" attribute for all objects. Support a mapping for volume list -c "Display Name" (Volume v1 and v2) and volume create/show -c "display_name" (Volume v1) for minimal backward compatibility until R release. Change-Id: I120be0118e7bb30093b4237c5eeb69a9eedef077 Closes-Bug: #1657956 Depends-On: I1fb62219b092346ea380099811cbd082cae5bafe
* Fix volume qos spec listDean Troyer2017-04-282-17/+76
| | | | | | | | | | | | | | | This has been sporadically failing in functional tests due to the way the volume qos spec list command calls get_associations() for each spec. When tests run in parallel occasionally a spec from another test is present in the list returned and is deleted before the get_associations() call is made, causing a NotFound exception. We should just keep going when this occurs. * make v1 match v2 * add tests to ensure the exception is being caught and handled Closes-Bug: #1687083 Change-Id: If2d17c1deb53d293fc2c7f0c527a4e4ef6f69976
* Fix NoneType error for volume snapshot create commandHuanxuan Ao2017-04-262-33/+18
| | | | | | | | | | | | | In volume snapshot command, <volume> is the same as <snapshot-name> when --volume is not specified, but <volume> cannot be None, so when <snapshot-name> is not specified (<snapshot-name> is None), a NoneType error appears. So make <snapshot-name> no longer optional, it should be always present. Change-Id: I3d9f10753a8ef601e70816421c160598e2cc811f Closes-bug: #1659894
* Fix volume transfers request commandsDean Troyer2017-03-272-18/+94
| | | | | | | | | | | | * Fix volume transfer request accept to actually not crash when trying to call Volume API. * Fix volume transfer request accept syntax to have only one positional argument, which is the ID of the resource in the command * Change the output column order in volume transfer request list to have ID followed by Name then the remaining columns. Closes-bug: 1633582 Change-Id: I5cc005f039d171cc70859f60e7fe649b09ead229
* Merge "OSC Quota List"Jenkins2017-03-211-0/+50
|\
| * OSC Quota ListSindhu Devale2017-03-101-0/+50
| | | | | | | | | | | | | | | | Implement Neutron feature of Quota List into OpenStack Client. Change-Id: Idf941acf8d00b136776b7381b877c56d82622f57 Partially-Implements: blueprint neutron-client-quota
* | Merge "Support --no-property in "volume set" command"Jenkins2017-03-062-0/+24
|\ \
| * | Support --no-property in "volume set" commandzhiyong.dai2017-02-232-0/+24
| | | | | | | | | | | | | | | | | | | | | Add "--no-property" option to "volume set" command in v1 and v2 and update the test cases. Change-Id: Id5660f23b3b2d9aa72f4c16b19ce83f3f7ed2fa4
* | | Merge "Add Cinder v3 client support for volumes"Jenkins2017-03-011-0/+0
|\ \ \
| * | | Add Cinder v3 client support for volumesJustin A Wilson2017-02-201-0/+0
| |/ / | | | | | | | | | | | | | | | Initial Cinder v3 support Change-Id: Idd5074832e80697ed0671f06d3291dfd92dbfb08
* | | Fix properties format for volume qos in volume v1Huanxuan Ao2017-02-211-11/+10
| |/ |/| | | | | | | | | | | | | | | | | | | | | Notice that patch [1] fixed the error of properties format for volume qos in volume v2, but there is the same bug in volume v1, and the patch missed that, so fix the problem in v1 as well [1] https://review.openstack.org/#/c/421065/ Partial-Bug: #1656767 Change-Id: I156bf13d164dbd0d0a7ce394964176718c4ff0e5
* | Merge "Add "volume host failover" command"Jenkins2017-02-181-0/+31
|\ \
| * | Add "volume host failover" commandzhiyong.dai2016-11-211-0/+31
| | | | | | | | | | | | | | | | | | | | | Add "volume host failover" command in volume v2 (v2 only). Change-Id: Ia39e6d20bf5c9d3096e46f3432804a240827548d Implements: bp cinder-command-support
* | | Merge "Add "encryption-*" options in volume type commands"Jenkins2017-02-184-7/+568
|\ \ \ | |_|/ |/| |
| * | Add "encryption-*" options in volume type commandsHuanxuan Ao2017-01-144-7/+568
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add "--encryption-provider", "--encryption-cipher", "--encryption-key-size" and "--encryption-control-location" options to "volume type set" and "volume type create" commands. Add "--encryption-type" option to "volume type unset", "volume type list" and "volume type show" commands. Change-Id: I3572635d5913d971a723a62d7790ffe0f20ec39a Implements: bp cinder-command-support Closes-Bug: #1651117
* | | Merge "Support "--no-property" option in volume snapshot set"Jenkins2017-01-262-5/+71
|\ \ \
| * | | Support "--no-property" option in volume snapshot setzhiyong.dai2017-01-252-5/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Supporting "--no-property" option will apply user a convenient way to clean all properties of volume snapshot in a short command, and this kind of behavior is the recommended way to devref. The patch adds "--no-property" option in "volume snapshot set" command, and update related test cases and devref document. Change-Id: I5f10cc2b5814553699920c4343995b2e11416e4e Implements: blueprint allow-overwrite-set-options
* | | | Merge "Add --project and --project-domain option to "volume snapshot list""Jenkins2017-01-251-1/+14
|\ \ \ \ | |/ / / |/| | |
| * | | Add --project and --project-domain option to "volume snapshot list"jiahui.qiang2017-01-071-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add "--project" and "--project-domain" option to volume v2's "volume snapshot list" command, it will filter list result by different project. Change-Id: I7dccd6d8d9f1889fa9cb0c2d04a42d77975c645b
* | | | Error in the return of command 'volume qos create'jiahui.qiang2017-01-171-13/+15
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixed a 'volume qos create' display mistake in argument of 'specs'[1]. For command such as: $ openstack volume qos create hello [1]https://bugs.launchpad.net/python-openstackclient/+bug/1656767 Closes-bug:#1656767 Change-Id: Ia9fce833d318d9b52b97c12cfb89e2d3c5465fbe
* | | Merge "Add unit test for multi volume types delete"Jenkins2017-01-122-5/+73
|\ \ \
| * | | Add unit test for multi volume types deleteHuanxuan Ao2017-01-112-5/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Missing unit test for multi volume types delete in volume v2 (v1 has been done), this patch add it. Change-Id: I5fe67196408157f8bdfe6399ba1e559cea3dc559
* | | | Merge "Add two consistency group commands"Jenkins2017-01-111-0/+206
|\ \ \ \ | |/ / / |/| | |
| * | | Add two consistency group commandszhiyong.dai2016-12-131-0/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add commands: consistency group add volume consistency group remove volume in volume v2 (v2 only) Change-Id: I70ff287d3b5df78196b8f4b9e50402c471aef284 Implements: bp cinder-command-support Closes-Bug: #1613964
* | | | Fix filter error in os volume listjiahui.qiang2017-01-091-0/+117
| |/ / |/| | | | | | | | | | | | | | | | | | | | This patch fixed a bug of unable to filter volume list by '--project', '--user' in "openstack volume list". Modify uint test for 'volume list' to check parameter of list method. Change-Id: I1fc4296c4c7eca0f7a803dbfd5e15e3bc0d6403f
* | | Add one test for "backup set" commandzhiyong.dai2016-12-191-0/+24
| |/ |/| | | | | | | | | | | The former tests for "backup set" command miss a test for '--description' option. In this patch, one relative test is added. Change-Id: Ie755d56a68a666d48751ab1ad20c8edb50e69b94