Check service available flag for availability of gnocchi
telemetry-tempest-plugin provides the two options to toggle tests about
gnocchi.
(1) [service_available] gnocchi
(2) [telemetry_services] metric_backends
When (1) is set to False while (2) contains gnocchi, all gnocchi API
tests are skipped but the aodh API tests which requires gnocchi as
metric backend are still executed.
Although this combination might be misconfiguration, we assume that
the aodh API tests may likely fail in this case, so skip these tests in
this configuration pattern.
Change-Id: I078b93304dcb543727d715a4d7d995bf3839a70a
diff --git a/telemetry_tempest_plugin/aodh/api/gnocchi/test_alarming_api.py b/telemetry_tempest_plugin/aodh/api/gnocchi/test_alarming_api.py
index 0fd826b..f39960f 100644
--- a/telemetry_tempest_plugin/aodh/api/gnocchi/test_alarming_api.py
+++ b/telemetry_tempest_plugin/aodh/api/gnocchi/test_alarming_api.py
@@ -29,8 +29,13 @@
"""
super(TelemetryAlarmingAPIGnocchiTest, cls).skip_checks()
+ if not CONF.service_available.gnocchi:
+ msg = ("%s: Skipping Gnocchi specific tests without Gnocchi" %
+ cls.__name__)
+ raise cls.skipException(msg)
+
if 'gnocchi' not in CONF.telemetry_services.metric_backends:
- msg = ("%s: Skipping Gnocchi specific tests withouth Gnocchi" %
+ msg = ("%s: Gnocchi is not one of the configured metric backends" %
cls.__name__)
raise cls.skipException(msg)
diff --git a/telemetry_tempest_plugin/aodh/api/gnocchi/test_alarming_api_negative.py b/telemetry_tempest_plugin/aodh/api/gnocchi/test_alarming_api_negative.py
index 240dd3a..bf55dfe 100644
--- a/telemetry_tempest_plugin/aodh/api/gnocchi/test_alarming_api_negative.py
+++ b/telemetry_tempest_plugin/aodh/api/gnocchi/test_alarming_api_negative.py
@@ -39,8 +39,13 @@
"""
super(TelemetryAlarmingNegativeGnocchiTest, cls).skip_checks()
+ if not CONF.service_available.gnocchi:
+ msg = ("%s: Skipping Gnocchi specific tests without Gnocchi" %
+ cls.__name__)
+ raise cls.skipException(msg)
+
if 'gnocchi' not in CONF.telemetry_services.metric_backends:
- msg = ("%s: Skipping Gnocchi specific tests withouth Gnocchi" %
+ msg = ("%s: Gnocchi is not one of the configured metric backends" %
cls.__name__)
raise cls.skipException(msg)