Browse Source

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
Thomas Bechtold 2 months ago
parent
commit
2bb88453ed

+ 2
- 0
monasca_tempest_tests/tests/api/base.py View File

@@ -29,6 +29,8 @@ class BaseMonascaTest(tempest.test.BaseTestCase):
29 29
     @classmethod
30 30
     def skip_checks(cls):
31 31
         super(BaseMonascaTest, cls).skip_checks()
32
+        if not CONF.service_available.monasca:
33
+            raise cls.skipException("Monasca support is required")
32 34
 
33 35
     @classmethod
34 36
     def resource_setup(cls):

+ 13
- 1
monasca_tempest_tests/tests/log_api/base.py View File

@@ -93,11 +93,13 @@ def _get_data(message):
93 93
 
94 94
 
95 95
 class BaseLogsTestCase(test.BaseTestCase):
96
-    """Base test case class for all Monitoring API tests."""
96
+    """Base test case class for all Logs tests."""
97 97
 
98 98
     @classmethod
99 99
     def skip_checks(cls):
100 100
         super(BaseLogsTestCase, cls).skip_checks()
101
+        if not CONF.service_available.logs:
102
+            raise cls.skipException("Monasca logs support is required")
101 103
 
102 104
     @classmethod
103 105
     def resource_setup(cls):
@@ -120,3 +122,13 @@ class BaseLogsTestCase(test.BaseTestCase):
120 122
                 method(resource_id)
121 123
             except exceptions.EndpointNotFound:
122 124
                 pass
125
+
126
+
127
+class BaseLogsSearchTestCase(BaseLogsTestCase):
128
+    """Base test case class for all LogsSearch tests."""
129
+    @classmethod
130
+    def skip_checks(cls):
131
+        super(BaseLogsSearchTestCase, cls).skip_checks()
132
+        # logs-search tests need both, 'logs' and 'logs-search'
133
+        if not CONF.service_available.logs_search:
134
+            raise cls.skipException("Monasca logs-search support is required")

+ 1
- 1
monasca_tempest_tests/tests/log_api/test_single.py View File

@@ -22,7 +22,7 @@ _RETRY_COUNT = 15
22 22
 _RETRY_WAIT = 2
23 23
 
24 24
 
25
-class TestSingleLog(base.BaseLogsTestCase):
25
+class TestSingleLog(base.BaseLogsSearchTestCase):
26 26
     def _run_and_wait(self, key, data,
27 27
                       content_type='application/json',
28 28
                       headers=None, fields=None):

+ 1
- 1
monasca_tempest_tests/tests/log_api/test_unicode.py View File

@@ -23,7 +23,7 @@ _RETRY_WAIT = 2
23 23
 _UNICODE_CASES = test_metric_validation.UNICODE_MESSAGES
24 24
 
25 25
 
26
-class TestUnicodeV3(base.BaseLogsTestCase):
26
+class TestUnicodeV3(base.BaseLogsSearchTestCase):
27 27
 
28 28
     def _run_and_wait(self, key, data,
29 29
                       content_type='application/json',

Loading…
Cancel
Save