]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/mgr: fix influx module_selftest health warning noise
authorKobi Ginon <kginon@redhat.com>
Thu, 11 Jun 2026 13:30:59 +0000 (16:30 +0300)
committerKobi Ginon <kginon@redhat.com>
Tue, 30 Jun 2026 11:58:26 +0000 (14:58 +0300)
Skip influx selftests when the Python influxdb client is not installed.
Remove the ineffective testhost workaround and ignore the expected
MGR_INFLUX_NO_SERVER warning when the module runs without a server.

Fixes: https://tracker.ceph.com/issues/77250
Signed-off-by: Kobi Ginon <kginon@redhat.com>
qa/suites/rados/mgr/tasks/4-units/module_selftest.yaml
qa/tasks/mgr/test_module_selftest.py

index e2a2ca03cc905f4cf6dda371d1b92748638f0f71..c1c484d26ff0cc23f12653ad36f43d2d61fe6ea3 100644 (file)
@@ -6,6 +6,7 @@ overrides:
       - objects misplaced
       - Synthetic exception in serve
       - influxdb python module not found
+      - No InfluxDB server configured
       - foo bar
       - Failed to open Telegraf
       - evicting unresponsive client
index db707d9469efd92e1d23eb9487273a0c21b77fe9..0e8aa317aea8e5c8c0975d8aa4f2e8976f309d8a 100644 (file)
@@ -1,4 +1,5 @@
 
+import json
 import time
 import requests
 import errno
@@ -36,14 +37,26 @@ class TestModuleSelftest(MgrTestCase):
         self.mgr_cluster.mon_manager.raw_cluster_cmd(
                 "mgr", "self-test", "module", module_name)
 
+    def _require_mgr_module(self, module_name):
+        dump = json.loads(self.mgr_cluster.mon_manager.raw_cluster_cmd(
+            "mgr", "dump", "--format=json-pretty"))
+        mgr_map_dump = dump.get("mgrmap", dump)
+        # getting the available modules and checking if the module is in the list
+        # and if it can run, if not, skip the test
+        for entry in mgr_map_dump["available_modules"]:
+            if entry.get("name") == module_name:
+                if not entry.get("can_run", True):
+                    self.skipTest(entry.get("error_string") or
+                                  "%s module cannot run" % module_name)
+                return
+        raise RuntimeError("module %r not found in mgr dump" % module_name)
+
     def test_prometheus(self):
         self._assign_ports("prometheus", "server_port", min_port=8100)
         self._selftest_plugin("prometheus")
 
     def test_influx(self):
-        #before we are enabling influx, set config options to avoid errors
-        self.mgr_cluster.mon_manager.raw_cluster_cmd(
-            "config", "set", "mgr", "mgr/influx/hostname", "testhost")
+        self._require_mgr_module("influx")
         self._selftest_plugin("influx")
 
     def test_diskprediction_local(self):
@@ -203,11 +216,8 @@ class TestModuleSelftest(MgrTestCase):
         """
         Use the selftest module to exercise inter-module communication
         """
+        self._require_mgr_module("influx")
         self._load_module("selftest")
-        #before we are enabling influx, set config options to avoid errors
-        self.mgr_cluster.mon_manager.raw_cluster_cmd(
-            "config", "set", "mgr", "mgr/influx/hostname", "testhost")
-
         # The "self-test remote" operation just happens to call into
         # influx.
         self._load_module("influx")