Add support of schema versioning for microversion
For API microversion testing, service clients can be
requested with any supported API microversions.
Compute service clients does response validation using response
schema.
To validate the corresponding microversion response with appropriate
schema, we need to add support of versioning in schema.
Each service client having multiple schema for microversions,
needs to define a list of dict with schema versions information.
Based on that information and requested microversion, schema
will be selected.
Example-
from tempest.api_schema.response.compute.v2_1 import xyz as schemav21
from tempest.api_schema.response.compute.v2_2 import xyz as schemav22
from tempest.api_schema.response.compute.v2_10 import abc as schemav210
.
.
.
schema_versions_info = [
{'min': None, 'max': '2.1', 'schema': schemav21},
{'min': '2.2', 'max': '2.9', 'schema': schemav22},
{'min': '2.10', 'max': None, 'schema': schemav210}]
This can be defined at class level or method level depends on how
schema differ for that service client.
This commits add the logic to select the valid schema for requested API
microversion.
Partially implements blueprint api-microversions-testing-support
Change-Id: I7c87287ca9f6f60a66aab8290031632945c03d59
3 files changed