Merge "Enable keystone feature flags"

This commit is contained in:
Chandan Kumar 2017-04-12 04:28:43 -04:00 committed by Gerrit Code Review
commit bd890d53b2
2 changed files with 29 additions and 0 deletions

View File

@ -176,6 +176,7 @@ def main():
configure_discovered_services(conf, services) configure_discovered_services(conf, services)
configure_boto(conf, services) configure_boto(conf, services)
configure_keystone_feature_flags(conf, services)
configure_horizon(conf) configure_horizon(conf)
# remove all unwanted values if were specified # remove all unwanted values if were specified
@ -793,6 +794,25 @@ def create_tempest_networks(clients, conf, has_neutron, public_network_id):
' must be specified') ' must be specified')
def configure_keystone_feature_flags(conf, services):
"""Set keystone feature flags based upon version ID."""
supported_versions = services.get('identity', {}).get('versions', [])
for version in supported_versions:
major, minor = version.split('.')[:2]
# We are going to enable two feature flags that are available
# after version 3.6: one related to domain specific roles and
# another one related to the security compliance feature.
# For more information, see
# https://developer.openstack.org/api-ref/identity/v3
if major == 'v3' and int(minor) >= 6:
conf.set('identity-feature-enabled',
'forbid_global_implied_dsr',
'True')
conf.set('identity-feature-enabled',
'security_compliance',
'True')
def configure_boto(conf, services): def configure_boto(conf, services):
"""Set boto URLs based on discovered APIs.""" """Set boto URLs based on discovered APIs."""
if 'ec2' in services: if 'ec2' in services:

View File

@ -234,6 +234,15 @@ class TestConfigTempest(BaseConfigTempestTest):
func2mock = 'config_tempest.api_discovery.get_identity_v3_extensions' func2mock = 'config_tempest.api_discovery.get_identity_v3_extensions'
self.useFixture(MonkeyPatch(func2mock, mock_function)) self.useFixture(MonkeyPatch(func2mock, mock_function))
def test_configure_keystone_feature_flags(self):
tool.configure_keystone_feature_flags(self.conf, self.FAKE_SERVICES)
self.assertEqual(
self.conf.get('identity-feature-enabled',
'forbid_global_implied_dsr'), 'True')
self.assertEqual(
self.conf.get('identity-feature-enabled',
'security_compliance'), 'True')
def test_configure_boto(self): def test_configure_boto(self):
tool.configure_boto(self.conf, self.FAKE_SERVICES) tool.configure_boto(self.conf, self.FAKE_SERVICES)
expected_url = "http://172.16.52.151:5000" expected_url = "http://172.16.52.151:5000"