X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fqa%2Ftasks%2Fmgr%2Ftest_module_selftest.py;fp=src%2Fceph%2Fqa%2Ftasks%2Fmgr%2Ftest_module_selftest.py;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=2776fb8729824b0055ca9c0f8aea286412c7f4e0;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/qa/tasks/mgr/test_module_selftest.py b/src/ceph/qa/tasks/mgr/test_module_selftest.py deleted file mode 100644 index 2776fb8..0000000 --- a/src/ceph/qa/tasks/mgr/test_module_selftest.py +++ /dev/null @@ -1,74 +0,0 @@ - -import time -import requests - -from tasks.mgr.mgr_test_case import MgrTestCase - - -class TestModuleSelftest(MgrTestCase): - """ - That modules with a self-test command can be loaded and execute it - without errors. - - This is not a substitute for really testing the modules, but it - is quick and is designed to catch regressions that could occur - if data structures change in a way that breaks how the modules - touch them. - """ - MGRS_REQUIRED = 1 - - def _selftest_plugin(self, module_name): - self._load_module(module_name) - - # Execute the module's self-test routine - self.mgr_cluster.mon_manager.raw_cluster_cmd(module_name, "self-test") - - def test_zabbix(self): - self._selftest_plugin("zabbix") - - def test_prometheus(self): - self._selftest_plugin("prometheus") - - def test_influx(self): - self._selftest_plugin("influx") - - def test_selftest_run(self): - self._load_module("selftest") - self.mgr_cluster.mon_manager.raw_cluster_cmd("mgr", "self-test", "run") - - def test_selftest_command_spam(self): - # Use the selftest module to stress the mgr daemon - self._load_module("selftest") - - # Use the dashboard to test that the mgr is still able to do its job - self._assign_ports("dashboard", "server_port") - self._load_module("dashboard") - - original_active = self.mgr_cluster.get_active_id() - original_standbys = self.mgr_cluster.get_standby_ids() - - self.mgr_cluster.mon_manager.raw_cluster_cmd("mgr", "self-test", - "background", "start", - "command_spam") - - dashboard_uri = self._get_uri("dashboard") - - delay = 10 - periods = 10 - for i in range(0, periods): - t1 = time.time() - # Check that an HTTP module remains responsive - r = requests.get(dashboard_uri) - self.assertEqual(r.status_code, 200) - - # Check that a native non-module command remains responsive - self.mgr_cluster.mon_manager.raw_cluster_cmd("osd", "df") - - time.sleep(delay - (time.time() - t1)) - - self.mgr_cluster.mon_manager.raw_cluster_cmd("mgr", "self-test", - "background", "stop") - - # Check that all mgr daemons are still running - self.assertEqual(original_active, self.mgr_cluster.get_active_id()) - self.assertEqual(original_standbys, self.mgr_cluster.get_standby_ids())