Many of the OpenStack components have implemented API microversions. It is important to test those microversions in Tempest or external plugins. Tempest now provides stable interfaces to support to test the API microversions. Based on the microversion range coming from the combination of both configuration and each test case, APIs request will be made with selected microversion.
This document explains the interfaces needed for microversion testing.
APIVersionRequest
(version_string=None)[source]¶This class represents an API Version Request.
This class provides convenience methods for manipulation and comparison of version numbers that we need to do to implement microversions.
Parameters: | version_string -- String representation of APIVersionRequest. Correct format is 'X.Y', where 'X' and 'Y' are int values. None value should be used to create Null APIVersionRequest, which is equal to 0.0 |
---|
get_string
()[source]¶Version string representation.
Converts object to string representation which if used to create an APIVersionRequest object results in the same version request.
is_null
()[source]¶Checks whether version is null.
Return True if version object is null otherwise False.
Returns: | boolean |
---|
matches
(min_version, max_version)[source]¶Matches the version object.
Returns whether the version object represents a version greater than or equal to the minimum version and less than or equal to the maximum version.
Parameters: |
|
---|---|
Returns: | boolean |
If min_version is null then there is no minimum limit. If max_version is null then there is no maximum limit. If self is null then raise ValueError
assert_version_header_matches_request
(api_microversion_header_name, api_microversion, response_header)[source]¶Checks API microversion in response header
Verify whether microversion is present in response header and with specified 'api_microversion' value.
Parameters: |
|
---|
check_skip_with_microversion
(test_min_version, test_max_version, cfg_min_version, cfg_max_version)[source]¶Checks API microversions range and returns whether test needs to be skip
Compare the test and configured microversion range and returns whether test microversion range is out of configured one. This method can be used to skip the test based on configured and test microversion range.
Parameters: |
|
---|---|
Returns: | boolean |
select_request_microversion
(test_min_version, cfg_min_version)[source]¶Select microversion from test and configuration min version.
Compare requested microversion and return the maximum microversion out of those.
Parameters: |
|
---|---|
Returns: | Selected microversion string |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.