summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/volume
Commit message (Collapse)AuthorAgeFilesLines
* Merge "volume: Add 'volume qos set --no-property' option"HEADmasterZuul2023-05-172-8/+23
|\
| * volume: Add 'volume qos set --no-property' optionStephen Finucane2023-05-172-8/+23
| | | | | | | | | | | | | | | | | | Supporting "--no-property" option will apply user a convenient way to clean all properties of volume qos in a short command. The patch adds "--no-property" option in "volume qos set" command and update related test cases and docs. Change-Id: I1fb5b4f0a923bbf557a3af3f63809bde9e84ffd4
* | Merge "Migrate 'volume revert' command to SDK"Zuul2023-05-171-16/+40
|\ \ | |/ |/|
| * Migrate 'volume revert' command to SDKwhoami-rajat2023-05-161-16/+40
| | | | | | | | | | | | | | This patch modifies the existing revert volume to snapshot call from cinderclient to SDK. Change-Id: Iaa9708ebae5d6ab3dfc73e4e2376af32ed098688
* | tests: Remove unnecessary nesting of compute resourcesStephen Finucane2023-05-161-1/+1
|/ | | | | Change-Id: I27326b8f2e0d84d3ef2c2fbdcb5c96a5ac1d79e4 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Blacken openstackclient.volumeStephen Finucane2023-05-1032-2401/+2753
| | | | | | | | | | Black used with the '-l 79 -S' flags. A future change will ignore this commit in git-blame history by adding a 'git-blame-ignore-revs' file. Change-Id: Ic318617c67ab7ce6527f9016b759a1d4b0b80802 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Merge "Wait for volume being available to set bootable or readonly"Zuul2023-02-222-6/+98
|\
| * Wait for volume being available to set bootable or readonlymatbu2023-02-222-6/+98
| | | | | | | | | | | | | | | | This patch add a check to be sure that the volume created is in a available state before trying to set bootable or readonly flag. Story: 2002158 Change-Id: I8db71fd8cf5bd14eb67880f76d2e9135edeb3ed2
* | Merge "volume: Remove duplication from 'consistency group create' opts"Zuul2023-02-221-2/+2
|\ \
| * | volume: Remove duplication from 'consistency group create' optsStephen Finucane2023-02-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The '--consistency-group-source' and '--consistency-group-snapshot' opts are unnecessarily verbose. Shorten them to '--source' and '--snapshot', respectively, maintaining aliases to avoid breaking users. Change-Id: I2b6656a8a09d953eb4406f1d4fd1e804743a8963 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | Deprecate positional args for 'volume group create'Stephen Finucane2023-02-171-8/+47
| |/ |/| | | | | | | | | | | | | There are now many ways to create a new volume group, thus the positional arguments don't make sense. Deprecate them. Change-Id: Id0b212426861719db1812b7d07b82613cf591de4 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Add options to create volume group from source6.1.0whoami-rajat2023-02-171-0/+131
| | | | | | | | | | | | | | | | This patch adds ``--source-group`` and ``--group-snapshot`` options to the ``volume group create`` command to allow creating group from a source group or a group snapshot. Change-Id: I87482a5dd43c519dfdcf981635aa879914a70a5c
* | Add block storage manageable list commandswhoami-rajat2023-02-172-0/+449
| | | | | | | | | | | | | | | | | | This patch adds the ``block storage volume manageable list`` and ``block storage snapshot manageable list`` commands that allow operators to list the volumes and snapshots on a particular host or cluster for management under OpenStack. Change-Id: I328dada5a0dc4e9e44c0d51db5cf3f224e27f88f
* | Add block storage cleanup commandwhoami-rajat2023-02-172-0/+210
| | | | | | | | | | | | | | | | | | This patch adds the ``block storage cleanup`` command that allow operators to cleanup resources (volumes and snapshots) with failed operations by requesting services in other hosts in the same cluster to cleanup resources of a failed service. Change-Id: I1375223f525021db5201fa0a9f9a647d17dd01f7
* | Add block storage log level {list, set} commandswhoami-rajat2023-02-162-0/+252
| | | | | | | | | | | | | | | | | | This patch adds the ``block storage log level list`` and ``block storage log level set`` commands that allow operators to list the current log levels of cinder services and also enables them to set a particular log level. Change-Id: I16cd8084fb505a9e68a35a936ef3b8b1f3cdc712
* | Add volume revert commandwhoami-rajat2023-02-161-0/+58
| | | | | | | | | | | | This command allows users to revert a volume to a given snapshot. Change-Id: If35ee394d654f5264558a281c835affff524ca50
* | Add volume summary commandwhoami-rajat2023-01-131-0/+121
|/ | | | | | | | | This patch adds the ``volume summary`` command which shows the total size, total count and metadata of all volumes. This command is available from microversion 3.12 and the metadata info is available from microversion 3.36. Change-Id: I6472337e8b1dc91aad5fbe416673a5d5a5d5fa88
* Add test for creating volume from sourcewhoami-rajat2022-11-231-0/+37
| | | | | | | | | | | | | This patch adds a test to create a new volume from source. We also include code changes to pass the right size i.e. either size passed by the user via --size argument or the source volume size. This case is already handled at the API layer[1] but it helps being consistent with passing the right size value as in case of creating a volume from snapshot or backup. [1] https://github.com/openstack/cinder/blob/7c1a5ce7b11964da4537fd6a7d157ede646b9e94/cinder/api/v3/volumes.py#L381-L382 Change-Id: Idc71636dad6bb678fe24f19b0836d2e9bd92d7d2
* Add option to create volume from backupwhoami-rajat2022-11-211-0/+73
| | | | | | | | Support for creating a volume from backup was added in microversio 3.47. This patch adds a --backup option to the volume create command to add that support. Change-Id: Ib26d2d335475d9aacbf77c0fd7b7cda2ba743943
* Merge "tests: Remove unnecessary nesting of volume resources"Zuul2022-11-0528-2536/+2351
|\
| * tests: Remove unnecessary nesting of volume resourcesStephen Finucane2022-09-3028-2536/+2351
| | | | | | | | | | Change-Id: I210ce7534d161e89115e5cb96e42ab7f27170aa1 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "tests: Remove duplicate FakeImagev1Client"Zuul2022-11-051-7/+4
|\ \ | |/
| * tests: Remove duplicate FakeImagev1ClientStephen Finucane2022-09-301-7/+4
| | | | | | | | | | | | | | | | I guess this was defined to avoid a circular import. There are easier ways to do this. Change-Id: Iab215a53691298413ea9d10def792008ab9edbce Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "tests: Move fake clients to top of file"Zuul2022-11-053-123/+123
|\ \ | |/
| * tests: Move fake clients to top of fileStephen Finucane2022-09-303-123/+123
| | | | | | | | | | | | | | | | These are important and they're easier to identify at the top of the file than nested deep inside. Change-Id: I1569c855fadfe4cdacf83ee07d08922bf3edefbc Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "volume: Volume names are optional"Zuul2022-10-261-3/+1
|\ \ | |/ |/|
| * volume: Volume names are optionalStephen Finucane2022-09-141-3/+1
| | | | | | | | | | | | | | Who knew? Change-Id: I1c1a811c0db59250e8a20a87f25c2662bc3ab3e8 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | quota: Add support for detailed volume quotasStephen Finucane2022-09-301-0/+29
|/ | | | | | | | We were stating that this was not supported. That is not true. Correct the oversight. Change-Id: Ib9d9db641a18e142be0a1eccff783e7cccdf2db5 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Merge "volume: Correct output of 'volume attachment create'"Zuul2022-06-271-1/+2
|\
| * volume: Correct output of 'volume attachment create'Stephen Finucane2022-05-161-1/+2
| | | | | | | | | | | | | | | | | | When adding these, we missed that the underlying cinder library call actually returns a dictionary and not a Resource-based object. This requires slightly different handling. Fix this. Change-Id: Ie065fe4198ae1238830cb619220e856390d4cb6e Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "Refactor "volume backup restore" command"Zuul2022-06-202-13/+113
|\ \ | |/ |/|
| * Refactor "volume backup restore" commandHuanxuan Ao2022-03-102-13/+113
| | | | | | | | | | | | | | | | 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
* | volume: Add 'block storage resource filter list' commandStephen Finucane2022-05-132-4/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are based on the 'cinder list-filters' command, which accepts an optional '--resource {resource}' option to limit the listed filters to a single resource type. block storage resource filter list block storage resource filter show We used the 'block storage resource filter' terminology rather than simply 'resource filter' to highlight the fact that this is specific to the block storage service. Note that while this feature is a bit weird, good documentation can be found at [1]. [1] https://docs.openstack.org/cinder/latest/admin/generalized_filters.html Change-Id: I21e7c0ea427aef1f6665394d4b8e9a1f30d6dbb1 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | volume: Add 'block storage cluster *' commandsStephen Finucane2022-05-132-0/+488
|/ | | | | | | | | | | | | | | | | These mirror the 'cinder cluster-*' commands, with arguments copied across essentially verbatim. The only significant departure is the replacement of "tenant" terminology with "project". block storage cluster list block storage cluster set block storage cluster show We used the 'block storage' terminology rather than simply 'volume' to allow us to start distinguishing between the volume service and a volume resource. Change-Id: I9105a9e4a139af4929e3b1f3a6de6c9a53e0b598 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Merge "image: Remove FakeImage test helper"Zuul2022-02-092-4/+4
|\
| * image: Remove FakeImage test helperStephen Finucane2021-11-172-4/+4
| | | | | | | | | | | | | | | | | | 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>
* | Switch command server add volume to sdk.Diwei Zhu2021-11-221-27/+83
|/ | | | | | | | | 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
* 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 "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-2310-84/+84
|\ \ | |/ |/|
| * Replace assertItemsEqual with assertCountEqualDirk Mueller2021-05-0310-84/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | 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>
* | 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>
* | 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>
* | 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>
* | 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>
* | 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>