Skip service api if not supported

The Service api was fixed and supported only in ussri
Don't run it if not supported

see: https://review.opendev.org/#/c/700507/
     https://review.opendev.org/#/c/700517/
     
Change-Id: I84ddb8a075269dc475fb56e0fc5ecabd28bba1a8
This commit is contained in:
Eyal 2020-01-27 09:22:59 +02:00
parent b5fcd31c06
commit cc3455b732
3 changed files with 35 additions and 7 deletions

View File

@ -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")]

View File

@ -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),
]

View File

@ -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')