Merge "Fix bugs about 'default' domain."
This commit is contained in:
commit
db4a97af41
@ -96,18 +96,18 @@ class TokensV3TestJSON(base.BaseIdentityV3AdminTest):
|
||||
self.assertEqual(['password'], token_auth['token']['methods'])
|
||||
self.assertEqual(user['id'], token_auth['token']['user']['id'])
|
||||
self.assertEqual(user['name'], token_auth['token']['user']['name'])
|
||||
self.assertEqual('default',
|
||||
self.assertEqual(CONF.identity.default_domain_id,
|
||||
token_auth['token']['user']['domain']['id'])
|
||||
self.assertEqual('Default',
|
||||
token_auth['token']['user']['domain']['name'])
|
||||
self.assertIsNotNone(token_auth['token']['user']['domain']['name'])
|
||||
self.assertNotIn('catalog', token_auth['token'])
|
||||
self.assertNotIn('project', token_auth['token'])
|
||||
self.assertNotIn('roles', token_auth['token'])
|
||||
|
||||
# Use the unscoped token to get a scoped token.
|
||||
token_auth = self.token.auth(token=token_id,
|
||||
project_name=project1_name,
|
||||
project_domain_name='Default')
|
||||
token_auth = self.token.auth(
|
||||
token=token_id,
|
||||
project_name=project1_name,
|
||||
project_domain_id=CONF.identity.default_domain_id)
|
||||
token1_id = token_auth.response['x-subject-token']
|
||||
|
||||
self.assertEqual(orig_expires_at, token_auth['token']['expires_at'],
|
||||
@ -122,10 +122,9 @@ class TokensV3TestJSON(base.BaseIdentityV3AdminTest):
|
||||
token_auth['token']['project']['id'])
|
||||
self.assertEqual(project1['name'],
|
||||
token_auth['token']['project']['name'])
|
||||
self.assertEqual('default',
|
||||
self.assertEqual(CONF.identity.default_domain_id,
|
||||
token_auth['token']['project']['domain']['id'])
|
||||
self.assertEqual('Default',
|
||||
token_auth['token']['project']['domain']['name'])
|
||||
self.assertIsNotNone(token_auth['token']['project']['domain']['name'])
|
||||
self.assertEqual(1, len(token_auth['token']['roles']))
|
||||
self.assertEqual(role['id'], token_auth['token']['roles'][0]['id'])
|
||||
self.assertEqual(role['name'], token_auth['token']['roles'][0]['name'])
|
||||
@ -134,9 +133,10 @@ class TokensV3TestJSON(base.BaseIdentityV3AdminTest):
|
||||
self.client.delete_token(token1_id)
|
||||
|
||||
# Now get another scoped token using the unscoped token.
|
||||
token_auth = self.token.auth(token=token_id,
|
||||
project_name=project2_name,
|
||||
project_domain_name='Default')
|
||||
token_auth = self.token.auth(
|
||||
token=token_id,
|
||||
project_name=project2_name,
|
||||
project_domain_id=CONF.identity.default_domain_id)
|
||||
|
||||
self.assertEqual(project2['id'],
|
||||
token_auth['token']['project']['id'])
|
||||
|
@ -47,7 +47,8 @@ class BaseTrustsV3Test(base.BaseIdentityV3AdminTest):
|
||||
# create a project that trusts will be granted on
|
||||
trustor_project_name = data_utils.rand_name(name='project')
|
||||
project = self.projects_client.create_project(
|
||||
trustor_project_name, domain_id='default')['project']
|
||||
trustor_project_name,
|
||||
domain_id=CONF.identity.default_domain_id)['project']
|
||||
self.trustor_project_id = project['id']
|
||||
self.assertIsNotNone(self.trustor_project_id)
|
||||
|
||||
@ -62,7 +63,7 @@ class BaseTrustsV3Test(base.BaseIdentityV3AdminTest):
|
||||
password=trustor_password,
|
||||
email=u_email,
|
||||
project_id=self.trustor_project_id,
|
||||
domain_id='default')['user']
|
||||
domain_id=CONF.identity.default_domain_id)['user']
|
||||
self.trustor_user_id = user['id']
|
||||
|
||||
# And two roles, one we'll delegate and one we won't
|
||||
@ -96,10 +97,10 @@ class BaseTrustsV3Test(base.BaseIdentityV3AdminTest):
|
||||
identity_version='v3',
|
||||
username=trustor_username,
|
||||
password=trustor_password,
|
||||
user_domain_id='default',
|
||||
user_domain_id=CONF.identity.default_domain_id,
|
||||
tenant_name=trustor_project_name,
|
||||
project_domain_id='default',
|
||||
domain_id='default')
|
||||
project_domain_id=CONF.identity.default_domain_id,
|
||||
domain_id=CONF.identity.default_domain_id)
|
||||
os = clients.Manager(credentials=creds)
|
||||
self.trustor_client = os.trusts_client
|
||||
|
||||
|
@ -14,10 +14,13 @@
|
||||
# under the License.
|
||||
|
||||
from tempest.api.identity import base
|
||||
from tempest import config
|
||||
from tempest.lib.common.utils import data_utils
|
||||
from tempest.lib import decorators
|
||||
from tempest.lib import exceptions as lib_exc
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class UsersNegativeTest(base.BaseIdentityV3AdminTest):
|
||||
|
||||
@ -43,4 +46,4 @@ class UsersNegativeTest(base.BaseIdentityV3AdminTest):
|
||||
self.assertRaises(lib_exc.Unauthorized, self.token.auth,
|
||||
username=user['name'],
|
||||
password=password,
|
||||
user_domain_id='default')
|
||||
user_domain_id=CONF.identity.default_domain_id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user