From: John Spray Date: Thu, 21 Dec 2017 13:27:45 +0000 (-0500) Subject: qa: configure zabbix properly before selftest X-Git-Tag: v12.2.3~230^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=567bd5acad2d1d5598a63835b9ce874e697cf2a8;p=ceph.git qa: configure zabbix properly before selftest 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 (cherry picked from commit c64c9ff00d2df2177135bcd2735bd7aeac625643) --- diff --git a/qa/tasks/mgr/mgr_test_case.py b/qa/tasks/mgr/mgr_test_case.py index ec3f98d28bb4..70791af7d7e1 100644 --- a/qa/tasks/mgr/mgr_test_case.py +++ b/qa/tasks/mgr/mgr_test_case.py @@ -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( diff --git a/qa/tasks/mgr/test_module_selftest.py b/qa/tasks/mgr/test_module_selftest.py index 2776fb872982..5bb4602aefc9 100644 --- a/qa/tasks/mgr/test_module_selftest.py +++ b/qa/tasks/mgr/test_module_selftest.py @@ -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):