]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: configure zabbix properly before selftest 19831/head
authorJohn Spray <john.spray@redhat.com>
Thu, 21 Dec 2017 13:27:45 +0000 (08:27 -0500)
committerPrashant D <pdhange@redhat.com>
Mon, 8 Jan 2018 04:34:13 +0000 (23:34 -0500)
Even though the selftest routine doesn't care about
the settings, we should set them to avoid emitting
nasty log/health messages when enabling the module.

Fixes: http://tracker.ceph.com/issues/22514
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit c64c9ff00d2df2177135bcd2735bd7aeac625643)

qa/tasks/mgr/mgr_test_case.py
qa/tasks/mgr/test_module_selftest.py

index ec3f98d28bb41398451353cfd91759309c2000b6..70791af7d7e1b1639e4d6aedd4a7b13dd3cacfd4 100644 (file)
@@ -47,6 +47,12 @@ class MgrCluster(CephCluster):
     def get_standby_ids(self):
         return [s['name'] for s in self.get_mgr_map()["standbys"]]
 
+    def set_module_conf(self, module, key, val):
+        self.mon_manager.raw_cluster_cmd("config-key", "set",
+                                         "mgr/{0}/{1}".format(
+                                             module, key
+                                         ), val)
+
     def set_module_localized_conf(self, module, mgr_id, key, val):
         self.mon_manager.raw_cluster_cmd("config-key", "set",
                                          "mgr/{0}/{1}/{2}".format(
index 2776fb8729824b0055ca9c0f8aea286412c7f4e0..5bb4602aefc9ad7e510753b88990d848cfe52638 100644 (file)
@@ -24,6 +24,10 @@ class TestModuleSelftest(MgrTestCase):
         self.mgr_cluster.mon_manager.raw_cluster_cmd(module_name, "self-test")
 
     def test_zabbix(self):
+        # Set these mandatory config fields so that the zabbix module
+        # won't trigger health/log errors on load/serve.
+        self.mgr_cluster.set_module_conf("zabbix", "zabbix_host", "localhost")
+        self.mgr_cluster.set_module_conf("zabbix", "identifier", "foo")
         self._selftest_plugin("zabbix")
 
     def test_prometheus(self):