Add a config option for trusts
This commit adds a new config section identity-feature-enabled which
contains the options to select which optional/configurable features in
keystone are enabled. The only option that fits this category at this
time is trusts.
Partially implements bp config-cleanup
Change-Id: I8110156e48616534c45e9eb2c12557b2d6bdfd46
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 2173eb6..4c2cdd7 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -428,6 +428,17 @@
#admin_password=pass
+[identity-feature-enabled]
+
+#
+# Options defined in tempest.config
+#
+
+# Does the identity service have delegation and impersonation
+# enabled (boolean value)
+#trust=true
+
+
[image]
#
diff --git a/tempest/api/identity/admin/v3/test_trusts.py b/tempest/api/identity/admin/v3/test_trusts.py
index 1ecc90c..4719f17 100644
--- a/tempest/api/identity/admin/v3/test_trusts.py
+++ b/tempest/api/identity/admin/v3/test_trusts.py
@@ -17,16 +17,22 @@
from tempest.api.identity import base
from tempest import clients
from tempest.common.utils.data_utils import rand_name
+from tempest import config
from tempest import exceptions
from tempest.openstack.common import timeutils
from tempest.test import attr
+CONF = config.CONF
+
class BaseTrustsV3Test(base.BaseIdentityAdminTest):
def setUp(self):
super(BaseTrustsV3Test, self).setUp()
# Use alt_username as the trustee
+ if not CONF.identity_feature_enabled.trust:
+ raise self.skipException("Trusts aren't enabled")
+
self.trustee_username = self.config.identity.alt_username
self.trust_id = None
diff --git a/tempest/config.py b/tempest/config.py
index 6f6da50..4d86c4e 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -90,6 +90,16 @@
secret=True),
]
+identity_feature_group = cfg.OptGroup(name='identity-feature-enabled',
+ title='Enabled Identity Features')
+
+IdentityFeatureGroup = [
+ cfg.BoolOpt('trust',
+ default=True,
+ help='Does the identity service have delegation and '
+ 'impersonation enabled')
+]
+
compute_group = cfg.OptGroup(name='compute',
title='Compute Service Options')
@@ -690,6 +700,8 @@
register_opt_group(cfg.CONF, compute_features_group,
ComputeFeaturesGroup)
register_opt_group(cfg.CONF, identity_group, IdentityGroup)
+ register_opt_group(cfg.CONF, identity_feature_group,
+ IdentityFeatureGroup)
register_opt_group(cfg.CONF, image_group, ImageGroup)
register_opt_group(cfg.CONF, image_feature_group, ImageFeaturesGroup)
register_opt_group(cfg.CONF, network_group, NetworkGroup)
@@ -716,6 +728,7 @@
self.compute = cfg.CONF.compute
self.compute_feature_enabled = cfg.CONF['compute-feature-enabled']
self.identity = cfg.CONF.identity
+ self.identity_feature_enabled = cfg.CONF['identity-feature-enabled']
self.images = cfg.CONF.image
self.image_feature_enabled = cfg.CONF['image-feature-enabled']
self.network = cfg.CONF.network