Merge "Add support for volume api microversion"

This commit is contained in:
Zuul 2018-08-17 01:42:15 +00:00 committed by Gerrit Code Review
commit d7db90e278
2 changed files with 23 additions and 2 deletions

View File

@ -15,10 +15,11 @@
import json
from tempest.lib import exceptions
from config_tempest import constants as C
from config_tempest.services.base import VersionedService
from config_tempest.utils import get_base_url
from tempest.lib import exceptions
class VolumeService(VersionedService):
@ -33,6 +34,20 @@ class VolumeService(VersionedService):
body = json.loads(body)
self.versions = self.deserialize_versions(body)
def set_api_microversion(self):
version_url = get_base_url(self.service_url)
body = self.do_get(version_url)
body = json.loads(body)
return body
def set_default_tempest_options(self, conf):
if 'v3' in self.service_url:
microversions = self.set_api_microversion()
min_microversion = microversions['versions'][1]['min_version']
max_microversion = microversions['versions'][1]['version']
conf.set('volume', 'min_microversion', min_microversion)
conf.set('volume', 'max_microversion', max_microversion)
def get_service_extension_key(self):
return 'api_extensions'

View File

@ -0,0 +1,6 @@
---
features:
- |
Add support for volume api microversion.
It discovers the minimum and maximum the microversion and set them under
volume section in tempest.conf.