Comment 2 for bug 2016402

Revision history for this message
Yosi Ben Shimon (ybenshim) wrote :

Sure.
I'm running show_volume_type() from types_client.py in tempest using reader user.
With member and admin users, it runs as expected ("os-volume-type-access:is_public" property exists in the response).

From tempest.log (reader):
2023-04-17 19:37:38.397 141061 INFO tempest.lib.common.rest_client [req-18ee11a1-fc7e-4c23-a055-af49b80b17e9 req-18ee11a1-fc7e-4c23-a055-af49b80b17e9 ] Request (VolumeTypesReaderTests:test_show_volume_type_detail): 200 GET http://10.0.0.103:8776/v3/ec4a5e859bf14108a332b2a5386b2318/types/aee8a147-951a-4281-ada7-221536cf350b 0.586s
2023-04-17 19:37:38.398 141061 DEBUG tempest.lib.common.rest_client [req-18ee11a1-fc7e-4c23-a055-af49b80b17e9 req-18ee11a1-fc7e-4c23-a055-af49b80b17e9 ] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: None
    Response - Headers: {'date': 'Mon, 17 Apr 2023 19:37:37 GMT', 'server': 'Apache', 'content-length': '188', 'x-compute-request-id': 'req-18ee11a1-fc7e-4c23-a055-af49b80b17e9', 'openstack-api-version': 'volume 3.0', 'vary': 'OpenStack-API-Version', 'x-openstack-request-id': 'req-18ee11a1-fc7e-4c23-a055-af49b80b17e9', 'content-type': 'application/json', 'connection': 'close', 'status': '200', 'content-location': 'http://10.0.0.103:8776/v3/ec4a5e859bf14108a332b2a5386b2318/types/aee8a147-951a-4281-ada7-221536cf350b'}
        Body: b'{"volume_type": {"id": "aee8a147-951a-4281-ada7-221536cf350b", "name": "tempest-volume-type-373286999", "is_public": true, "description": "description", "extra_specs": {"key1": "value1"}}}' _log_request_full /home/stack/venv/lib64/python3.9/site-packages/tempest/lib/common/rest_client.py:464

From the terminal:
Failed validating 'required' in schema['properties']['volume_type']:
    {'additionalProperties': False,
     'properties': {'description': {'type': ['string', 'null']},
                    'extra_specs': {'patternProperties': {'^.+$': {'type': 'string'}},
                                    'type': 'object'},
                    'id': {'format': 'uuid', 'type': 'string'},
                    'is_public': {'type': 'boolean'},
                    'name': {'type': 'string'},
                    'os-volume-type-access:is_public': {'type': 'boolean'},
                    'qos_specs_id': {'format': 'uuid',
                                     'type': ['string', 'null']}},
     'required': ['name',
                  'is_public',
                  'description',
                  'id',
                  'os-volume-type-access:is_public'],
     'type': 'object'}

On instance['volume_type']:
    {'description': 'description',
     'extra_specs': {'key1': 'value1'},
     'id': 'aee8a147-951a-4281-ada7-221536cf350b',
     'is_public': True,
     'name': 'tempest-volume-type-373286999'}

From tempest.log (member):
2023-04-17 19:42:20.720 145311 INFO tempest.lib.common.rest_client [req-4de4bf72-0b65-4d87-a50f-d9f8b6a7dc5e req-4de4bf72-0b65-4d87-a50f-d9f8b6a7dc5e ] Request (VolumeTypesReaderTests:test_show_volume_type_detail): 200 GET http://10.0.0.103:8776/v3/67b858eef9d540229a9b745bb18f2315/types/3345e337-868a-416b-9509-b6bacdef667c 0.170s
2023-04-17 19:42:20.720 145311 DEBUG tempest.lib.common.rest_client [req-4de4bf72-0b65-4d87-a50f-d9f8b6a7dc5e req-4de4bf72-0b65-4d87-a50f-d9f8b6a7dc5e ] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: None
    Response - Headers: {'date': 'Mon, 17 Apr 2023 19:42:20 GMT', 'server': 'Apache', 'content-length': '229', 'x-compute-request-id': 'req-4de4bf72-0b65-4d87-a50f-d9f8b6a7dc5e', 'openstack-api-version': 'volume 3.0', 'vary': 'OpenStack-API-Version', 'x-openstack-request-id': 'req-4de4bf72-0b65-4d87-a50f-d9f8b6a7dc5e', 'content-type': 'application/json', 'connection': 'close', 'status': '200', 'content-location': 'http://10.0.0.103:8776/v3/67b858eef9d540229a9b745bb18f2315/types/3345e337-868a-416b-9509-b6bacdef667c'}
        Body: b'{"volume_type": {"id": "3345e337-868a-416b-9509-b6bacdef667c", "name": "tempest-volume-type-861239725", "is_public": true, "description": "description", "extra_specs": {"key1": "value1"}, "os-volume-type-access:is_public": true}}' _log_request_full /home/stack/venv/lib64/python3.9/site-packages/tempest/lib/common/rest_client.py:464