summaryrefslogtreecommitdiff
path: root/cinderclient/tests
Commit message (Collapse)AuthorAgeFilesLines
* Add missed 'Server ID' output in attachment-liststein-em4.2.2Minmin Ren2020-01-212-9/+29
| | | | | | | | | | | | | | | | | | | | | 'server_id' is not Attachment attribute, should be set by 'instance' attribute. v3/attachments respond body: {"attachments": [{"status": "attached", "instance": INSTANCE_UUID, "id": ATTACHMENT_UUID, "volume_id": VOLUME_UUID, }, ... ] } Closes-Bug: #1860393 Change-Id: Ica5d278cb7455befe1db4be0ab65114fd606ea0a (cherry picked from commit 03f228c11e0d88dcc396b30b7544b5cfde894750)
* Tests: Don't write bash-completion cache filesEric Harney2019-08-225-0/+31
| | | | | | | | | | Mock out writing of bash-completion cache files during unit tests. Related-Bug: #1817782 Change-Id: I944862c30fb4684dd034eba6953e9302d2d22439 (cherry picked from commit a39805c6f45baf94c0d14da3ae775ee204a267ee)
* Fix shell upload-to-image with no volume type4.2.1Eric Harney2019-06-031-0/+28
| | | | | | | | | Upload-to-image would error after launching the operation if the volume type is None. Closes-Bug: #1821818 Change-Id: I015e0ddfa98d62f25334e2df5effaee72a3988ab (cherry picked from commit 274fa111696783e846561d12f670967ed01ebcbc)
* Merge "Fix max version handling for help output" into stable/steinZuul2019-03-261-0/+12
|\
| * Fix max version handling for help outputSean McGinnis2019-03-251-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit fefe331f218d73ba6d1d7acf81b5eb02609c953e incorrectly set the default API version to the max the client knew about in order to get the full help output, including all microversioned commands. The original intent was to have help print out information for all versions, but still require the user to specify a version if they wanted to use any microversioned version of an API. The code accidentally made it so all commands would request the max version the client knew about. This meant an unspecified request would get the newer functionality rather than the default v3 functionality, and also meant the client could request a microversion higher than what the server knew about, resulting in an unexpected error being returned. To keep the originally intended functionality, but keep all help output, this only uses the max API version for the help command unless the user specifies otherwise. Closes-bug: #1813967 Change-Id: I20f6c5471ffefe5524a4d48c967e2e8db53233f1 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com> (cherry picked from commit bccbd510a77843824b8187e15c4d8df9c2dfa55e)
* | Merge "Replace assertRaisesRegexp with assertRaisesRegex" into stable/steinZuul2019-03-262-10/+10
|\ \
| * | Replace assertRaisesRegexp with assertRaisesRegexzhangyangyang2019-03-212-10/+10
| |/ | | | | | | | | | | | | | | This replaces the deprecated (in python 3.2) unittest.TestCase method assertRaisesRegexp() with assertRaisesRegex(). Change-Id: I85025ad141f8436913ba192716435ce63e1e2d05 (cherry picked from commit 3362a65085b562632ce15c25ad29f0fda2a67784)
* | Fix: cinder group-list not working with non-admin userwhoami-rajat2019-03-211-8/+8
|/ | | | | | | | | | | | The all_tenants filter is passed to API when it's value is 0 (when not specified) which shouldn't be the case. This patch only allows adding of all_tenants when specified manually by user. Change-Id: Ic7810c4d6e9f4be7c28c7a8778d57bb5ccb996a0 Closes-Bug: #1808621 Closes-Bug: #1808622 (cherry picked from commit 532aef0c738edc937dbfa1b54efd8d7773af2204)
* Merge "Fix encoding of query parameters"4.1.0Zuul2018-10-034-35/+38
|\
| * Fix encoding of query parametersGoutham Pacha Ravi2018-09-134-35/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IETF RFC 3986 classifies "~" as a reserved character [1], however until python3.7 [2], python's url parsing used to encode this character. urllib has seen a lot of churn in various python releases, and hence we were using a six wrapper to shield ourselves, however, this backwards-incompatible change in encoding norms forces us to deal with the problem at our end. Cinder's API accepts "~" in both, its encoded or un-encoded forms. So, let's stop encoding it within cinderclient, regardless of the version of python running it. Also fix an inconsitency around the use of the generic helper method in utils added in I3a3ae90cc6011d1aa0cc39db4329d9bc08801904 (cinderclient/utils.py - build_query_param) to allow for False as a value in the query. [1] https://tools.ietf.org/html/rfc3986.html [2] https://docs.python.org/3/library/urllib.parse.html#url-quoting Change-Id: I89809694ac3e4081ce83fd4f788f9355d6772f59 Closes-Bug: #1784728
* | Merge "Fix backwards compat for volume transfer < 3.55"Zuul2018-10-022-27/+65
|\ \
| * | Fix backwards compat for volume transfer < 3.55Sean McGinnis2018-08-042-27/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All volume transfer v3 calls were being sent to the endpoint introduced with microversion 3.55. This fixes backwards compatibility by routing calls less than 3.55 to the original API extension endpoint. Change-Id: I7205033ddd5be126b8614372a9fc82a2bc555f48 Closes-bug: #1785330 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* | | Merge "Fix functional error check for invalid volume create size"Zuul2018-10-021-2/+2
|\ \ \
| * | | Fix functional error check for invalid volume create sizeSean McGinnis2018-09-111-2/+2
| | |/ | |/| | | | | | | | | | | | | | | | | | | With the api-schema enforcement on the Cinder API side, the error message returned when specifying a volume creation of 0 has changed. This results in our functional tests failing. Change-Id: I1a9a13f683134faa01ad50f7f073db8b1845a901
* | | Merge "Fix endpoint identification for api-version query"Zuul2018-10-021-3/+14
|\ \ \ | |/ / |/| |
| * | Fix endpoint identification for api-version querySean McGinnis2018-08-061-3/+14
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | The api-version query is a GET against the root endpoint of cinder. Determining this root endpoint had a flaw with the newer wsgi deployment URLs that would cause it to find the root endpoint of the web server and not cinder. This updates the logic to work with legacy, wsgi, and custom URLs for the Cinder endpoint. Change-Id: Iaeba1f8d50ee8cc9410cc9f638770a56796871fb Closes-bug: #1785594 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* | __repr__ crashes when empty dict passedwhoami-rajat2018-08-131-0/+5
|/ | | | | | | | | | The Capabilities class __repr__ method crashes when along with any manager object, the info is passed as empty dict. This patch handles the issue. Change-Id: Ife5cfc82137d107b27b011aa83c3a9c89e78d701 Closes-Bug: #1785091
* Allow volume-transfer creation < 3.55 microversion4.0.1Sean McGinnis2018-07-312-10/+21
| | | | | | | | | | | Handling for the new `no_snapshots` option was incorrectly handling microversion evaluation that would prevent anything less than the new microversion from working. This changes the check to only handle the changed argument for 3.55 and later. Change-Id: If96889ccde6044706e6a5dcd83fde3c20fe1c1fd Closes-bug: #1784703 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* Remove unnecessary parameters from volume create APIsNeha Alhat2018-07-264-56/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As per Cinder code, following parameters are not required to be passed in the request body of create volume API. * status * user_id * attach_status * project_id * source_replica If you pass these parameters, previously it was ignored but in the schema validation changes[1] we don't allow additionalProperties to be passed in the request body. If user passes additional parameters which are not as per API specs[2], then it will be rejected with 400 error. On patch[3], tempest tests: test_volume_snapshot_create_get_list_delete, test_volume_create_get_delete" are failing because of these unnecessary parameters. This patch removes these unnecessary parameters passed to the create Volume API. [1]https://blueprints.launchpad.net/cinder/+spec/json-schema-validation [2]https://review.openstack.org/#/c/507386/ [3]https://review.openstack.org/#/c/573093/ Change-Id: I37744bfd0b0bc59682c3e680c1200f608ad3991b
* Merge "Transfer snapshots with volumes"Zuul2018-07-203-0/+115
|\
| * Transfer snapshots with volumeswanghao2018-07-193-0/+115
| | | | | | | | | | | | | | | | | | This patch will support to transfer volumes with or without snapshots in new V3 api after mircoversion 3.55. Change-Id: I61a84b5abf386a4073baea57d8820c8fd762ae03 Depends-On: https://review.openstack.org/533564/ Implements: blueprint transfer-snps-with-vols
* | Add mode option to attachment-createJohn Griffith2018-07-172-1/+45
|/ | | | | | | | | | | | We introduce a mode option in attachment-create starting with microversion 3.54. The mode option is the new/preferred way of setting ro mode (as opposed to admin-metadata). This patch adds the support for the mode option to the client for endpoints that support 3.54. Depends-on: https://review.openstack.org/532702/ Change-Id: I22cfddd0192c4a72b8f844f23d1fa51b96c57e06
* Merge "Use api version 3 for functional test"Zuul2018-06-252-4/+11
|\
| * Use api version 3 for functional testjunboli2018-06-192-4/+11
| | | | | | | | | | | | | | | | | | switch to use OS_VOLUME_API_VERSION = 3 to run functional tests. Closes-bug: #1775354 Co-Authored-By: liuyamin <liuyamin@fiberhome.com> Change-Id: If6c4291aa7d8e85a4f8c1d5665a0e4a72aa1f1d1
* | Keep is_public usage backwards compatible3.6.1Sean McGinnis2018-06-222-7/+22
| | | | | | | | | | | | | | | | | | | | | | 5a1513244caf7acbd41e181419bc8b62bf4bcaba added the ability to filter by AZ, but it changed the existing behavior if is_public was not specified. This adds handling to make sure we are still consistent with the previous behavior. Co-Authored-by: Alan Bishop <abishop@redhat.com> Change-Id: I5000aab092c1b434c8dc17bbe4b2d3d632f528c3 Closes-bug: #1778055
* | unable to create group from src in cinderclientwanghao2018-06-202-7/+8
|/ | | | | | | | | | | According the api schema of cinder, create_group_from_src should only specify one of arguments from [group_snapshot_id, source_group_id]. Now cinderclient specified them both even if one of them is None. This patch fix this issue to just pass one argument. Change-Id: Idef51ab9a1452dd5eb3be4d4b6dca095a777d611 Closes-Bug: #1777555
* Fix failing functional test casesPooja Jadhav2018-06-131-2/+4
| | | | | | | | | | | | | | After applying schema validation to volume actions APIs[1], error messages are formatted as per the standards. So the tests are failing because of error messages. This patch fixes failed functional tests by correcting error messages. [1]https://review.openstack.org/#/c/559042/ Change-Id: Id05bf637d77ab401fc0aec5be09eee423bf1a223
* Merge "Add the parameter service-id for service cleanup command"Zuul2018-05-281-2/+4
|\
| * Add the parameter service-id for service cleanup commandliuyamin2018-05-251-2/+4
| | | | | | | | | | | | | | | | There isn't service_id param in cinderclient. We have this param in cinder, so add this param in the cinderclient. Change-Id: I579741595f91802bcf117029889567f234b5b14c Closes-bug: #1771721
* | Remove useless args in create_group_from_srcwanghao2018-05-222-9/+0
| | | | | | | | | | | | | | | | | | | | | | Remove status, project_id and user_id args from create_group_from_src. Those args will cause error when using cinderclient since schema validation in Cinder side. Change-Id: Iba9a45625f9e6423e8e582425605ca184238cde9 Closes-Bug: #1772375
* | Merge "Support availability-zone in volume type"Zuul2018-05-201-0/+14
|\ \ | |/ |/|
| * Support availability-zone in volume typeTommyLike2018-05-021-0/+14
| | | | | | | | | | | | | | | | | | | | Since 3.52, new option '--filters' has been added to 'type-list' command, and it's only valid for administrator. Change-Id: I140f6d61a2747d4fcaabfbccea864dcc7eb841d1 Depends-On: I4e6aa7af707bd063e7edf2b0bf28e3071ad5c67a Partial-Implements: bp support-az-in-volumetype
* | Allow --help for specific commandsEric Harney2018-04-101-0/+11
|/ | | | | | | | | | | | This makes calls such as: $ cinder list --help work as expected, equivalent to: $ cinder help list rather than just printing the full help message. Change-Id: I038eeeea554f0bb5dd170f503eaec570441520b3
* Support cross AZ backupsGorka Eguileor2018-02-121-0/+13
| | | | | | | | | | | Add support for microversion 3.51 that allows us to specify the Availability Zone of the backup service that should create the backup. New optional parameter available for "backup-create" when using microversion 3.51 is "--availability-zone". Depends-On: I595932276088d25abd464025c99dce33a2cc502b Change-Id: Ia4bab5fcb95f6a8d1adb99c5d7dc1b3f7546c6f6
* Fix for v3 volume unit testsjeremy.zhang2018-01-256-33/+47
| | | | | | | This patch is mainly to specify the APIversion for FakeClient used in different volume resources' unit tests. Change-Id: I18eb9b57434061e95c909907e6ba263b9091a446
* Removes unicode 'u' response for "cinder get-capabilities"Abijitha Nadagouda2018-01-231-3/+3
| | | | | | | | | | | | | | | | | The output of "cinder get-capabilities" command returns unicoded response. But it would appear from the utils class that setting formatters will go through the capabilities dict and make sure all values are properly string formatted. Therefore added formatters to return string formatted response. Added formatters=sorted(prop.keys()) line instead of static values as suggested by the reviewer, to avoid tying server knowledge to the client and also any update on the server side would easily reflect here. Closes-bug: #1680444 Change-Id: Ie38236db364d59ddab42cb925d0435777b0ffe86
* Merge "Support for reporting backend state in service list"Zuul2018-01-182-0/+21
|\
| * Support for reporting backend state in service listwanghao2018-01-092-0/+21
| | | | | | | | | | | | | | | | | | | | This patch will support the feature: report backend state in service list in client side. Depends-On: I561dca3ef7c1901401621bc112389dbd178a907e Change-Id: If15e1fa50b5feecd74c7394c918f4fc9d87bcf3e Implements: blueprint report-backend-state-in-service-list
* | Merge "Migrate to keystoneauth identity cli opts."Zuul2018-01-171-0/+16
|\ \
| * | Migrate to keystoneauth identity cli opts.Zhao Chao2018-01-161-0/+16
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use keystoneauth1 to parse keystone authentication arguments. Previously these arguments are parsed in the different service clients seperately. Use keystoneauth1 instead will make this consistent across projects and less error-prone. This change is inspired by NovaClient. Co-Authored-By: Morgan Fainberg <morgan.fainberg@gmail.com> Co-Authored-By: David Hu <david.hu@hp.com> Co-Authored-By: Monty Taylor <mordred@inaugust.com> Closes-Bug: #1734945 Change-Id: I3c5141eeddd3747ff542e95b04e4848470ad9508 Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
* | Merge "Fix v2 volume unit tests"Zuul2018-01-161-17/+15
|\ \
| * | Fix v2 volume unit testsjeremy.zhang2018-01-081-17/+15
| |/ | | | | | | | | | | | | This patch is mainly to fix the wrongly used fake client in v2 volume unit tests. Change-Id: If0d0aa7a95b7d58886cc77e8a377ac2f17985f18
* | Merge "Add service cleanup command"Zuul2018-01-162-0/+31
|\ \
| * | Add service cleanup commandGorka Eguileor2017-10-032-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cinder volume services will perform cleanup on start, but when we have multiple volume services grouped in a cluster, we may want to trigger cleanup of services that are down. This patch adds command `work-cleanup` to trigger server cleanups and prints service nodes that will be cleaned and those that didn't have an alternative service in the cluster to do the cleanup. This command will only work on servers supporting API version 3.24 or higher. New command: cinder work-cleanup [--cluster <cluster-name>] [--host <hostname>] [--binary <binary>] [--is-up <True|true|False|false>] [--disabled <True|true|False|false>] [--resource-id <resource-id>] [--resource-type <Volume|Snapshot>] Specs: https://specs.openstack.org/openstack/cinder-specs/specs/newton/ha-aa-cleanup.html Change-Id: I1c33ffbffcb14f34ee2bda9042e706937b1147d7 Depends-On: If336b6569b171846954ed6eb73f5a4314c6c7e2e Implements: blueprint cinder-volume-active-active-support
* | | Merge "Add cluster support in manage listings"Zuul2018-01-161-0/+35
|\ \ \ | |/ /
| * | Add cluster support in manage listingsGorka Eguileor2017-10-031-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for API microversion 3.17, which allows us to pass --cluster optional argument to volume and snapshot manage listings. Implements: blueprint cinder-volume-active-active-support Change-Id: I97b5f2e9960d5a1f140fc638804dbc631d63ff9d
* | | Fix 'cluster' paramter using for v3 volume managejeremy.zhang2018-01-052-1/+11
| |/ |/| | | | | | | | | | | The 'cluster' paramter is wrongly provided for v3 volume manage, as it should be included in the 'volume' object. Change-Id: I12440aa6ada9c0e058138e8da7f7bc12359847bb
* | Merge "Fix the way to get backup metadata"Zuul2017-12-201-2/+13
|\ \
| * | Fix the way to get backup metadatalihaijing2017-12-131-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In v3/shell.py do_backup_update(), the metadata through 'args.metadata' is a list, like this: 'metadata': [u'k1=v1']. But we need a metadata dict like this: 'metadata': {"k1": "v1"}. So call the right method shell_utils.extract_metadata() to get metadata from args. Change-Id: I82cb96b1f89b4009d4b3f4a0e64db076a7a04977
* | | Merge "Backup create is not available from 3.0 to 3.42"Zuul2017-12-151-6/+24
|\ \ \