Merge "Modify tests to load trustee user from plugin"
This commit is contained in:
@@ -15,6 +15,7 @@ import json
|
||||
import uuid
|
||||
|
||||
from keystoneclient import access as ks_access
|
||||
from keystoneclient import auth as ks_auth
|
||||
from keystoneclient.auth.identity import access as ks_auth_access
|
||||
from keystoneclient.auth.identity import v3 as ks_auth_v3
|
||||
from keystoneclient.auth import token_endpoint as ks_token_endpoint
|
||||
@@ -51,19 +52,14 @@ class KeystoneClientTest(common.HeatTestCase):
|
||||
self.m.StubOutWithMock(ks_auth_v3, 'Password')
|
||||
self.m.StubOutWithMock(ks_token_endpoint, 'Token')
|
||||
self.m.StubOutWithMock(ks_auth_access, 'AccessInfoPlugin')
|
||||
self.m.StubOutWithMock(ks_auth, 'load_from_conf_options')
|
||||
|
||||
dummy_url = 'http://server.test:5000/v2.0'
|
||||
cfg.CONF.set_override('auth_uri', dummy_url,
|
||||
group='keystone_authtoken')
|
||||
cfg.CONF.set_override('admin_user', 'heat',
|
||||
group='keystone_authtoken')
|
||||
cfg.CONF.set_override('admin_password', 'verybadpass',
|
||||
group='keystone_authtoken')
|
||||
cfg.CONF.set_override('admin_tenant_name', 'service',
|
||||
cfg.CONF.set_override('auth_uri', 'http://server.test:5000/v2.0',
|
||||
group='keystone_authtoken')
|
||||
cfg.CONF.set_override('stack_user_domain_id', 'adomain123')
|
||||
cfg.CONF.set_override('stack_domain_admin', 'adminuser123')
|
||||
cfg.CONF.set_override('stack_domain_admin_password', 'adminsecret')
|
||||
|
||||
self.addCleanup(self.m.VerifyAll)
|
||||
|
||||
def _clear_domain_override(self):
|
||||
@@ -78,11 +74,7 @@ class KeystoneClientTest(common.HeatTestCase):
|
||||
else:
|
||||
a.AndRaise(kc_exception.Unauthorized)
|
||||
|
||||
m = ks_auth_v3.Password(auth_url='http://server.test:5000/v3',
|
||||
password='verybadpass',
|
||||
user_domain_id='default',
|
||||
username='heat',
|
||||
trust_id=None)
|
||||
m = ks_auth.load_from_conf_options(cfg.CONF, 'trustee', trust_id=None)
|
||||
m.AndReturn(mock_ks_auth)
|
||||
|
||||
def _stub_domain_admin_client(self, domain_id=None):
|
||||
@@ -126,11 +118,9 @@ class KeystoneClientTest(common.HeatTestCase):
|
||||
user_domain_id='default')
|
||||
|
||||
elif method == 'trust':
|
||||
p = ks_auth_v3.Password(auth_url='http://server.test:5000/v3',
|
||||
username='heat',
|
||||
password='verybadpass',
|
||||
user_domain_id='default',
|
||||
trust_id='atrust123')
|
||||
p = ks_auth.load_from_conf_options(cfg.CONF,
|
||||
'trustee',
|
||||
trust_id='atrust123')
|
||||
|
||||
mock_auth_ref.user_id = user_id or 'trustor_user_id'
|
||||
mock_auth_ref.project_id = project_id or 'test_tenant_id'
|
||||
|
||||
Reference in New Issue
Block a user