Use identity api version 3 for OSC plugin tests
Explicitly use `--os-identity-api-version` option for Baremetal OSC plugin functional tests taking it's value from config. Change-Id: I3eeb7cd029fe440684a5736eeb3b5788d1666a08 Closes-Bug: #1646837
This commit is contained in:
@@ -148,6 +148,22 @@ class FunctionalTestBase(base.ClientTestBase):
|
||||
return self.client.cmd_with_auth('ironic',
|
||||
action, flags, params)
|
||||
|
||||
def _ironic_osc(self, action, flags='', params=''):
|
||||
"""Execute baremetal commands via OpenStack Client."""
|
||||
config = self._get_config()
|
||||
id_api_version = config.get('functional', 'os_identity_api_version')
|
||||
flags += ' --os-identity-api-version {0}'.format(id_api_version)
|
||||
|
||||
for keystone_object in 'user', 'project':
|
||||
domain_attr = 'os_%s_domain_id' % keystone_object
|
||||
if hasattr(self, domain_attr):
|
||||
flags += ' --os-%(ks_obj)s-domain-id %(value)s' % {
|
||||
'ks_obj': keystone_object,
|
||||
'value': getattr(self, domain_attr)
|
||||
}
|
||||
return self.client.cmd_with_auth(
|
||||
'openstack', action, flags, params)
|
||||
|
||||
def ironic(self, action, flags='', params='', parse=True):
|
||||
"""Return parsed list of dicts with basic item info.
|
||||
|
||||
|
@@ -21,7 +21,7 @@ from ironicclient.tests.functional import base
|
||||
class TestCase(base.FunctionalTestBase):
|
||||
|
||||
def openstack(self, *args, **kwargs):
|
||||
return self.clients.openstack(*args, **kwargs)
|
||||
return self._ironic_osc(*args, **kwargs)
|
||||
|
||||
def get_opts(self, fields=None, output_format='json'):
|
||||
"""Get options for OSC output fields format.
|
||||
|
@@ -16,6 +16,7 @@ cat <<END >$CONFIG_FILE
|
||||
[functional]
|
||||
api_version = 1
|
||||
os_auth_url=$OS_AUTH_URL
|
||||
os_identity_api_version = $OS_IDENTITY_API_VERSION
|
||||
os_username=$OS_USERNAME
|
||||
os_password=$OS_PASSWORD
|
||||
os_tenant_name=$OS_TENANT_NAME
|
||||
|
Reference in New Issue
Block a user