Recognize config options from [service_available]
Currently, settings in [service_available] for Monasca in tempest.conf do not have any effect. That can lead to the situation where the monasca-tempest-plugin is installed but monasca is not configured which results in all monasca tempest tests failing. With this patch, setting: - [service_available]monasca - [service_available]logs - [service_available]logs-search to "False" will skip all available tests for monasca. If only monasca-api is available (no monasca-log-api and/or elasticsearch), [service_available]monasca can be set to "True" and the other 2 options ("logs" and "logs-search") to "False" so only the monasca-api tempest tests are executed. Depends-On: https://review.openstack.org/634308 Change-Id: I1f0cbb95765ae5fc6dca0da7af8ab56d2daf9a7f Story: 2004917 Task: 29277
This commit is contained in:
parent
52e319e20f
commit
2bb88453ed
@ -29,6 +29,8 @@ class BaseMonascaTest(tempest.test.BaseTestCase):
|
||||
@classmethod
|
||||
def skip_checks(cls):
|
||||
super(BaseMonascaTest, cls).skip_checks()
|
||||
if not CONF.service_available.monasca:
|
||||
raise cls.skipException("Monasca support is required")
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
|
@ -93,11 +93,13 @@ def _get_data(message):
|
||||
|
||||
|
||||
class BaseLogsTestCase(test.BaseTestCase):
|
||||
"""Base test case class for all Monitoring API tests."""
|
||||
"""Base test case class for all Logs tests."""
|
||||
|
||||
@classmethod
|
||||
def skip_checks(cls):
|
||||
super(BaseLogsTestCase, cls).skip_checks()
|
||||
if not CONF.service_available.logs:
|
||||
raise cls.skipException("Monasca logs support is required")
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
@ -120,3 +122,13 @@ class BaseLogsTestCase(test.BaseTestCase):
|
||||
method(resource_id)
|
||||
except exceptions.EndpointNotFound:
|
||||
pass
|
||||
|
||||
|
||||
class BaseLogsSearchTestCase(BaseLogsTestCase):
|
||||
"""Base test case class for all LogsSearch tests."""
|
||||
@classmethod
|
||||
def skip_checks(cls):
|
||||
super(BaseLogsSearchTestCase, cls).skip_checks()
|
||||
# logs-search tests need both, 'logs' and 'logs-search'
|
||||
if not CONF.service_available.logs_search:
|
||||
raise cls.skipException("Monasca logs-search support is required")
|
||||
|
@ -22,7 +22,7 @@ _RETRY_COUNT = 15
|
||||
_RETRY_WAIT = 2
|
||||
|
||||
|
||||
class TestSingleLog(base.BaseLogsTestCase):
|
||||
class TestSingleLog(base.BaseLogsSearchTestCase):
|
||||
def _run_and_wait(self, key, data,
|
||||
content_type='application/json',
|
||||
headers=None, fields=None):
|
||||
|
@ -23,7 +23,7 @@ _RETRY_WAIT = 2
|
||||
_UNICODE_CASES = test_metric_validation.UNICODE_MESSAGES
|
||||
|
||||
|
||||
class TestUnicodeV3(base.BaseLogsTestCase):
|
||||
class TestUnicodeV3(base.BaseLogsSearchTestCase):
|
||||
|
||||
def _run_and_wait(self, key, data,
|
||||
content_type='application/json',
|
||||
|
Loading…
Reference in New Issue
Block a user