summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/volume/v1
Commit message (Collapse)AuthorAgeFilesLines
* Refactor "volume backup restore" commandHuanxuan Ao2022-03-101-6/+46
| | | | | | | | Make the positional argument "volume" optional and add a "--force" option (volume v2 only) to the "volume backup restore" command. Closes-Bug: #1597189 Change-Id: If944e10158bd18e8331be63e96187a23e23095d7
* image: Remove FakeImage test helperStephen Finucane2021-11-171-2/+2
| | | | | | | | | 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 "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-234-36/+36
|\ \ | |/ |/|
| * Replace assertItemsEqual with assertCountEqualDirk Mueller2021-05-034-36/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | tests: Rename 'FakeType' -> 'FakeVolumeType'Stephen Finucane2021-06-033-37/+40
|/ | | | | | | There are more types than just volume types. Change-Id: I6af66f966a221437ff79fabcb0b81fd38586fe67 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Make use of comparable 'FormattableColumn' subclassesStephen Finucane2020-12-094-36/+36
| | | | | | | | | | | | This requires fixes found in cliff 3.5.0 [1] and osc-lib 2.3.0 [2]. With these fixes in place, we can remove the icky, still broken 'assertItemEqual' and 'assertListItemEqual' helpers. [1] https://review.opendev.org/761421 [2] https://review.opendev.org/761394 Change-Id: Id6c26b37c3c7d5ec6761361abca57f9219b76838 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Raise flake8-import-order version to latestSean McGinnis2020-01-106-14/+11
| | | | | | | | | | | 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>
* 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-203-606/+6
| | | | | | | | | | | | | | | | | | | | | 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>
* Use flake8-import-order pluginAkihiro Motoki2017-08-173-3/+4
| | | | | | | | | | | | | | | | 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
* Replace "Display Name" by "Name" in volume listRui Chen2017-05-261-6/+78
| | | | | | | | | | | | | | | | | | 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-281-17/+48
| | | | | | | | | | | | | | | 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-261-15/+7
| | | | | | | | | | | | | 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-271-9/+47
| | | | | | | | | | | | * 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 "Support --no-property in "volume set" command"Jenkins2017-03-061-0/+6
|\
| * Support --no-property in "volume set" commandzhiyong.dai2017-02-231-0/+6
| | | | | | | | | | | | | | Add "--no-property" option to "volume set" command in v1 and v2 and update the test cases. Change-Id: Id5660f23b3b2d9aa72f4c16b19ce83f3f7ed2fa4
* | 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 "encryption-*" options in volume type commands"Jenkins2017-02-182-6/+262
|\ \ | |/ |/|
| * Add "encryption-*" options in volume type commandsHuanxuan Ao2017-01-142-6/+262
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Support "--no-property" option in volume snapshot setzhiyong.dai2017-01-251-4/+9
|/ | | | | | | | | | | 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
* Add some options to "volume create" commandjiahui.qiang2016-12-061-0/+136
| | | | | | | | Add "--bootable", "--non-bootable", "--read-only" and "--read-write" options to "volume create" command for setting some attributes at the time of crration. Change-Id: I71b4e9fccb4ee0ab1a90e7179d6d2d34dbbae909 Implements: bp cinder-command-support
* Add options to "volume snapshot list" commandjiahui.qiang2016-11-261-3/+93
| | | | | | | | Add "--name", "--status" and "--volume" options to "volume snapshot list" command for filtering results. Change-Id: I72db1abce7701f31598deec34801a4d1f5713870 Closes-Bug:#1645252
* Merge "Refactor "snapshot" commands"Jenkins2016-12-031-12/+38
|\
| * Refactor "snapshot" commandsHuanxuan Ao2016-11-031-12/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1.change the command name ``snapshot create/delete/list/ show/set/unset`` to ``volume snapshot create/delete/list/ show/set/unset``. 2.change the optional parameter "--name <name>" to a positional parameter "<snapshot-name>"; Change the positional parameter "<volume>" to a optional parameter "--volume <volume>" Change-Id: If03276ecdf6f0d96893d5ecf91c2aaa64929cff3 Implements: bp backup-snapshot-renamed-for-volume-resource Co-Authored-By: Sheel Rana <ranasheel2000@gmail.com>
* | Merge "Add "Is Public" column in volume type list"Jenkins2016-12-021-1/+5
|\ \
| * | Add "Is Public" column in volume type listHuanxuan Ao2016-11-221-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I think admin users will like to see the "Is Public" column in volume type list since they can know the volume type is public or private, so add "Is Public" column in volume type list Change-Id: I3f6e297a7adf82a275debbd87d2c4da415aa1360 Closes-Bug: #1643861
* | | Merge "Remove outdated comments in volume unit test"Jenkins2016-12-021-4/+0
|\ \ \
| * | | Remove outdated comments in volume unit testHuanxuan Ao2016-11-221-4/+0
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Checked the volume create unit test has beed completed, so remove the TODO. Checked the FakeVolume class has been added in volume v1, so remove the note. Change-Id: I82b5f775d013e5e301bc1c18481ef516ca5baa7e
* | | Outdated test data clean up in volumeHuanxuan Ao2016-11-161-96/+0
|/ / | | | | | | | | | | | | | | Now all the volume unit tests (both v1 and v2) are using fake classes. All the old fake data and code can be removed. Change-Id: Ib35ad4b6c94c42a21215e012f80f8978a74a3d18
* | Merge "Use FakeImage class to replace duplicated image info in volume test"Jenkins2016-11-102-31/+11
|\ \
| * | Use FakeImage class to replace duplicated image info in volume testHuanxuan Ao2016-10-212-31/+11
| |/ | | | | | | | | | | | | | | FakeImage class has been added in image v1 so that we can reuse it in volume v1 unit test to replace the duplicated image info in volume v1 fake. Change-Id: I0f96e568bd65e59241b57704fc2a379319a386d8
* | Merge "Add "--read-only" and "--read-write" options in "volume set""Jenkins2016-11-101-16/+49
|\ \
| * | Add "--read-only" and "--read-write" options in "volume set"Huanxuan Ao2016-10-181-16/+49
| |/ | | | | | | | | | | | | | | Add "--read-only" and "--read-write" options in "volume set" command to set volume access mode. Implements: bp cinder-command-support Change-Id: I76ba85c7d3ff0eb026a9cbd794368d8b2b0d17fe
* | Merge "Add "volume migrate" command"Jenkins2016-11-101-0/+62
|\ \
| * | Add "volume migrate" commandHuanxuan Ao2016-10-181-0/+62
| |/ | | | | | | | | | | | | | | Add "volume migrate" command in volume v1 and v2 to support migrating volume to a new host Change-Id: Ie4e6037171a31a872006a13f9fd1e15eaa627c26 Implements: bp cinder-command-support
* | Add 'all-projects' option to 'volume backup list'Jordan Pittier2016-11-081-1/+6
| | | | | | | | | | | | | | Similar to what 'volume list --all-projects' does, 'volume backup list --all-projects' list volume backups accross all projects. Change-Id: Id5dda9b5adc822c4ddfb2dda339946d3322858e2
* | Add options to "volume backup list" commandHuanxuan Ao2016-11-081-3/+37
|/ | | | | | | | | Add "--name", "--status", "--volume", "--marker" (v2 only) and "--limit" (v2 only) options to "volume backup list" command Change-Id: If20cb7650f2359d393ee314d9e055a8659c73009 Closes-Bug: #1612484 Closes-Bug: #1639712
* Refactor qos spec unit test in volume v1Huanxuan Ao2016-10-042-159/+124
| | | | | | | Refactor qos spec unit test with FakeQos class in volume v1. Change-Id: Ia76bf41a911457282b293dfaf0af311b1a9194ce
* Add and modify options for "volume create" commandHuanxuan Ao2016-09-281-0/+62
| | | | | | | | | | | | | | 1.Add mutually exclusive options into a mutually exclusive group. 2.Add "--source-replicated", "--consistency-group", "--hint" and "multi-attach" options 3.Make --size option to be optional under some cases Closes-Bug: #1568005 Closes-Bug: #1627913 Implements: bp implement-cinder-features Co-Authored-By: Roman Vasilets <rvasilets@mirantis.com> Change-Id: I2c4c3073195d33774e477f4d7f22e383b14b41dd
* Add unit tests for backup commands in volume v1Huanxuan Ao2016-09-232-0/+435
| | | | | | | | There was not any unit tests for backup commands in volume v1 so that sometimes some small bugs maybe ignored, this patch add unit tests for them. Change-Id: Ic67c1b80243f7b3d15dabd25e4e4a1b1517a8b59
* Fix unset commands to pass normally when nothing specifiedHuanxuan Ao2016-09-234-0/+571
| | | | | | | | | | | | | | | | After I found this problem appear in "volume unset", I checked all the volume command and also found some same problems. This patch fix them all. The main reason of we ignored this problem before is there was not any tests for it. So I add tests for "nothing unset" for them all to test and aviod this problem. Also, I add unit tests for all snapshot commands in volume v1 by the way in this patch. We will need more tests to avoid some ignored problem. Change-Id: I46775f24643d715e168b30785b8b531c0431a55b Partial-bug: #1588588
* Implement "volume transfer request show/accept" commandHuanxuan Ao2016-09-222-3/+97
| | | | | | | | | | | | Add "volume transfer request show" and "volume transfer accept" commands in volume v1 and v2. Also add the unit tests, docs, release note and functional tests Implements: bp cinder-command-support Co-Authored-By: Sheel Rana <ranasheel2000@gmail.com> Change-Id: I5787fc486b3401307125caa316f517b9c96a95a5
* Fix "volume unset" command pass normally when nothing specifiedHuanxuan Ao2016-09-211-0/+99
| | | | | | | | | | | | When nothing specified in "volume unset" command, there will be an error message says that the "--properties" option is required, it is unusual behaviour, this patch fix it and also add unit test for it. Also, this patch add unit test for "volume show" command by the way. Change-Id: I5b5d587670acf0af4262b8521292455bf9f60fe5 Partial-bug: #1588588
* Refactor volume unit test with FakeVolume class in volume v1Huanxuan Ao2016-09-212-136/+131
| | | | | | | | FakeVolume class has been added in the fake.py in volume v1, this patch refactors the volume command unit tests with the FakeVolume class. Change-Id: Ic3c1a46d5bff9048d0095f5739ae9e5a34ca6b5b
* Merge "Support mark volume as bootable in volume set"Jenkins2016-09-141-0/+27
|\
| * Support mark volume as bootable in volume setqtang2016-09-141-0/+27
| | | | | | | | | | | | | | | | Add --bootable | --non-bootable option in volume set to mark or unmark volume as bootable. Change-Id: Ifa6c2dd1642202f55b6d50e3b8614d3513d488f6 Closes-Bug:#1535704
* | Replace 'MagicMock' with 'Mock'qtang2016-09-141-5/+5
| | | | | | | | | | Change-Id: I7aeceede6bd3cb88cf04f398454f9758dbee20f1 Closes-Bug: #1475722
* | Merge "Trivial: Rename ListTransferRequests to ListTransferRequest"Jenkins2016-09-121-1/+1
|\ \