cinder/cinder/tests/unit/api/v3
Brian Rosmaita 5122b14658 Default volume_type set too early
If a volume_type is not specified in a volume-create request, change
I4da0c13b5b3f8174a30b8557f968d6b9e641b091 (introduced in Train) sets a
default volume_type in the REST API layer.  This prevents the
selection logic in cinder.volume.flows.api.create_volume.
ExtractVolumeRequestTask from being able to infer the appropriate
volume_type from the source volume, snapshot, or image metadata, and
has caused a regression where the created volume is of the default
type instead of the inferred type.

This patch removes setting the default volume_type in the REST API
and modifies the selection code in ExtractVolumeRequestTask slightly
to make sure a volume_type is always assigned in that function, and
adds and revises some tests.

Change-Id: I05915f2e32b1229ad320cd1c5748de3d63183b91
Closes-bug: #1879578
(cherry picked from commit 674c8e7286)
Conflicts:
  cinder/tests/unit/volume/flows/api/test_create_volume.py
  - cinder.tests.unit.test (victoria) -> cinder.test (pre-victoria)
(cherry picked from commit c1bdb233cf)
Conflicts:
  cinder/volume/flows/api/create_volume.py
  - add six, remove collections
  cinder/tests/unit/volume/flows/api/test_create_volume.py
  - add mock, remove unittest.mock
2020-07-12 16:10:27 -04:00
..
__init__.py Microversion of Bootable filter in cinder list 2016-04-21 15:17:15 +00:00
fakes.py Use newer location for iso8601 UTC 2017-09-08 07:38:35 -05:00
stubs.py Use newer location for iso8601 UTC 2017-09-08 07:38:35 -05:00
test_attachments.py Rename volume/utils.py to volume/volume_utils.py 2019-09-09 15:00:07 -04:00
test_backups.py Remove leading and trailing spaces from parameters 2018-01-17 11:45:34 +05:30
test_cluster.py V3 jsonschema validation: os-services 2018-05-14 12:44:56 +05:30
test_consistencygroups.py Replace assertRaisesRegexp with assertRaisesRegex 2018-08-23 22:03:43 -04:00
test_group_snapshots.py Add project_id in group snapshots list and show API 2019-03-01 22:59:19 +05:30
test_group_specs.py V3 jsonschema validation: Group type specs 2017-12-12 14:48:42 +05:30
test_group_types.py Fix combination of parameters for update APIs 2018-01-18 14:19:13 +05:30
test_groups.py Rename volume/utils.py to volume/volume_utils.py 2019-09-09 15:00:07 -04:00
test_limits.py Use constants for microversion values 2017-09-22 08:15:56 -05:00
test_messages.py Use constants for microversion values 2017-09-22 08:15:56 -05:00
test_resource_filters.py Use constants for microversion values 2017-09-22 08:15:56 -05:00
test_snapshot_manage.py Schedule request to scheduler when manage existing snapshot 2018-01-31 00:48:08 +00:00
test_snapshots.py Untyped to Default Volume Type 2019-09-20 05:37:54 +00:00
test_types.py Untyped to Default Volume Type 2019-09-20 05:37:54 +00:00
test_volume_manage.py Use constants for cinder-volume 2017-12-29 09:05:08 +08:00
test_volume_metadata.py Add policy test for volume metadata policy 2019-01-15 01:22:10 +00:00
test_volume_transfer.py Untyped to Default Volume Type 2019-09-20 05:37:54 +00:00
test_volumes.py Default volume_type set too early 2020-07-12 16:10:27 -04:00
test_workers.py V3 json schema validation: workers 2018-04-16 09:54:36 +05:30