cinder/cinder/tests/unit/api
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
..
contrib Tests: Fix retype unit test InvalidUUID warning 2019-10-02 20:29:31 +00:00
middleware Fix deprecation warnings 2018-08-23 12:52:34 -04:00
openstack Raise HTTPUnsupportedMediaType when content type is unsupported 2018-08-21 17:14:02 +08:00
v2 Default volume_type set too early 2020-07-12 16:10:27 -04:00
v3 Default volume_type set too early 2020-07-12 16:10:27 -04:00
views Fix version return incorrect when endpoint url end without / 2019-02-20 20:30:14 +00:00
__init__.py Move unit tests into dedicated directory 2015-04-21 18:40:40 -06:00
fakes.py Fix consisgroup V3 interfaces 2016-07-04 16:21:44 +08:00
test_api_validation.py Tests: Fix python version check 2018-02-16 14:43:53 -05:00
test_common.py Allow filtering on size for volume list 2019-05-04 10:47:46 -06:00
test_versions.py Exclude disabled API versions from listing 2018-09-26 23:31:46 +00:00