Merge "Added test of default domain in Keystone"

This commit is contained in:
Jenkins 2015-05-25 16:36:08 +00:00 committed by Gerrit Code Review
commit a4758e2a53
4 changed files with 32 additions and 2 deletions

View File

@ -571,6 +571,9 @@
# applies to user and project (string value)
#admin_domain_name = <None>
# ID of the default domain (string value)
#default_domain_id = default
[identity-feature-enabled]

View File

@ -13,10 +13,13 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest.api.identity import base
from tempest import config
from tempest import test
from tempest_lib.common.utils import data_utils
from tempest.api.identity import base
from tempest import test
CONF = config.CONF
class DomainsTestJSON(base.BaseIdentityV3AdminTest):
@ -105,3 +108,18 @@ class DomainsTestJSON(base.BaseIdentityV3AdminTest):
expected_data = {'name': d_name, 'enabled': True}
self.assertIsNone(domain['description'])
self.assertDictContainsSubset(expected_data, domain)
class DefaultDomainTestJSON(base.BaseIdentityV3AdminTest):
@classmethod
def resource_setup(cls):
cls.domain_id = CONF.identity.default_domain_id
super(DefaultDomainTestJSON, cls).resource_setup()
@test.attr(type='smoke')
@test.idempotent_id('17a5de24-e6a0-4e4a-a9ee-d85b6e5612b5')
def test_default_domain_exists(self):
domain = self.client.get_domain(self.domain_id)
self.assertTrue(domain['enabled'])

View File

@ -172,6 +172,12 @@ class BaseIdentityV3AdminTest(BaseIdentityV3Test):
if len(role) > 0:
return role[0]
def delete_domain(self, domain_id):
# NOTE(mpavlase) It is necessary to disable the domain before deleting
# otherwise it raises Forbidden exception
self.client.update_domain(domain_id, enabled=False)
self.client.delete_domain(domain_id)
class DataGenerator(object):

View File

@ -142,6 +142,9 @@ IdentityGroup = [
cfg.StrOpt('admin_domain_name',
help="Admin domain name for authentication (Keystone V3)."
"The same domain applies to user and project"),
cfg.StrOpt('default_domain_id',
default='default',
help="ID of the default domain"),
]
identity_feature_group = cfg.OptGroup(name='identity-feature-enabled',