diff --git a/mistral_tempest_tests/config.py b/mistral_tempest_tests/config.py index 23fe862..755ce6a 100644 --- a/mistral_tempest_tests/config.py +++ b/mistral_tempest_tests/config.py @@ -15,7 +15,18 @@ from oslo_config import cfg -service_option = cfg.BoolOpt('mistral', - default=True, - help="Whether or not Mistral is expected to be" - "available") +ServiceAvailableGroup = [cfg.BoolOpt('mistral', + default=True, + help="Whether or not Mistral is expected" + " to be available")] + +service_available_group = cfg.OptGroup(name="service_available", + title="Available OpenStack Services") + +mistral_api_group = cfg.OptGroup(name="mistral_api", + title="Mistral Api Service Options") + +MistralApiGroup = [cfg.BoolOpt("service_api_supported", + default=False, + help="Whether or not services api " + "is available")] diff --git a/mistral_tempest_tests/plugin.py b/mistral_tempest_tests/plugin.py index 15a9a95..5119c2b 100644 --- a/mistral_tempest_tests/plugin.py +++ b/mistral_tempest_tests/plugin.py @@ -16,6 +16,7 @@ import os +from tempest import config from tempest.test_discover import plugins from mistral_tempest_tests import config as mistral_config @@ -30,8 +31,17 @@ class MistralTempestPlugin(plugins.TempestPlugin): return full_test_dir, base_path def register_opts(self, conf): - conf.register_opt(mistral_config.service_option, - group='service_available') + config.register_opt_group(conf, + mistral_config.service_available_group, + mistral_config.ServiceAvailableGroup) + config.register_opt_group(conf, + mistral_config.mistral_api_group, + mistral_config.MistralApiGroup) def get_opt_lists(self): - return [('service_available', [mistral_config.service_option])] + return [ + (mistral_config.service_available_group.name, + mistral_config.ServiceAvailableGroup), + (mistral_config.mistral_api_group.name, + mistral_config.MistralApiGroup), + ] diff --git a/mistral_tempest_tests/tests/api/v2/test_services.py b/mistral_tempest_tests/tests/api/v2/test_services.py index 1a2a4a8..8e156bc 100644 --- a/mistral_tempest_tests/tests/api/v2/test_services.py +++ b/mistral_tempest_tests/tests/api/v2/test_services.py @@ -12,10 +12,15 @@ # License for the specific language governing permissions and limitations # under the License. +import testtools + +from tempest import config from tempest.lib import decorators from mistral_tempest_tests.tests import base +CONF = config.CONF + class ServicesTestsV2(base.TestCase): @@ -23,6 +28,8 @@ class ServicesTestsV2(base.TestCase): @decorators.attr(type='sanity') @decorators.idempotent_id('f4359ad2-9109-4305-a00a-77679878f7f9') + @testtools.skipUnless(CONF.mistral_api.service_api_supported, + 'Service api is not supported') def test_get_services_list(self): resp, body = self.client.get_list_obj('services')