tempest/tempest/lib/api_schema/response
Rajat Dhasmana 81c91f0ec2 Fix: Schema validation of volume list detail
When doing the attachment of volume with glance host, the
"server_id" field of volume attachment response is null which is
not handled in the schema validation of list volume with detail.
This caused a failure in one of the tempest volume test
"test_unmanage_manage_volume" where we do a list volume with
detail request and one volume (probably from other test running
in parallel) existed with an active attachment to the glance host[2].
We can see that the "server_id" field of the attached volume is null[3].
The "server_id" field is only present when doing the attachment
with nova.
This patch allows the "server_id" to be "string" as well as "null" type
to handle both nova and glance usecase.

[1] https://86aa517b6cb393144dd6-d78b0c94e26e635eac828273888f290f.ssl.cf5.rackcdn.com/822731/1/check/glance-multistore-cinder-import/e52281e/testr_results.html

[2] Body: b'{"volumes": [{"id": "e11beb8b-e170-4c5c-945b-e854c01f85ab",
"status": "in-use",...
, "attachments":
[{"id": "e11beb8b-e170-4c5c-945b-e854c01f85ab",
"attachment_id": "5132d152-54c3-4aa6-90e8-f13d2d1d0028",
"volume_id": "e11beb8b-e170-4c5c-945b-e854c01f85ab",
"server_id": null,
"host_name": "ubuntu-focal-inmotion-iad3-0027876140",
"device": "glance_store",...

[3] "server_id": null

Closes-Bug: #1956340
Change-Id: I92d4d49bf5fe52f3417555260e0771397f18334d
2022-01-04 05:53:03 -05:00
..
compute Add microversion schemas for os-instance-actions 2021-11-04 13:32:55 +01:00
volume Fix: Schema validation of volume list detail 2022-01-04 05:53:03 -05:00
__init__.py Migrate tempest-lib code into new lib dir 2016-02-23 14:15:04 -05:00