From 2d0c8694a4a61acbf523438b5406c781958e0f1f Mon Sep 17 00:00:00 2001 From: lkuchlan Date: Thu, 25 Nov 2021 20:16:00 +0200 Subject: [PATCH] Add enforce_scope config option for Manila Add config option to enbale the scoped token. This option allows running Manila rbac tests. Change-Id: Ief906f23ac5d898f993fc3c0909ff7d58c25a57a --- manila_tempest_tests/config.py | 9 +++++++++ manila_tempest_tests/plugin.py | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/manila_tempest_tests/config.py b/manila_tempest_tests/config.py index 6f9813cb..92cf7ba7 100644 --- a/manila_tempest_tests/config.py +++ b/manila_tempest_tests/config.py @@ -21,6 +21,15 @@ service_option = cfg.BoolOpt("manila", help="Whether or not manila is expected to be " "available") +manila_scope_enforcement = cfg.BoolOpt('manila', + default=False, + help="Does the Share service API " + "policies enforce scope? " + "This configuration value should " + "be same as manila.conf: " + "[oslo_policy].enforce_scope " + "option.") + share_group = cfg.OptGroup(name="share", title="Share Service Options") ShareGroup = [ diff --git a/manila_tempest_tests/plugin.py b/manila_tempest_tests/plugin.py index 0c32ce11..148a3686 100644 --- a/manila_tempest_tests/plugin.py +++ b/manila_tempest_tests/plugin.py @@ -33,6 +33,8 @@ class ManilaTempestPlugin(plugins.TempestPlugin): def register_opts(self, conf): conf.register_opt(config_share.service_option, group='service_available') + conf.register_opt(config_share.manila_scope_enforcement, + group='enforce_scope') conf.register_group(config_share.share_group) conf.register_opts(config_share.ShareGroup, group='share') @@ -54,7 +56,8 @@ class ManilaTempestPlugin(plugins.TempestPlugin): def get_opt_lists(self): return [(config_share.share_group.name, config_share.ShareGroup), - ('service_available', [config_share.service_option])] + ('service_available', [config_share.service_option]), + ('enforce_scope', [config_share.manila_scope_enforcement])] def get_service_clients(self): shares_config = config.service_client_config('share')