Exemplo n.º 1
0
 def test_history_not_supported(self):
     self.config.runner.pcmk.can_fence_history_manage(
         stderr="not supported",
         name="runner.pcmk.can_fence_history_manage",
         instead="runner.pcmk.can_fence_history_manage",
     )
     self.env_assist.assert_raise_library_error(
         lambda: stonith.history_update(self.env_assist.get_env()),
         [fixture.error(report_codes.FENCE_HISTORY_NOT_SUPPORTED, )],
         expected_in_processor=False)
Exemplo n.º 2
0
 def test_history_not_supported(self):
     self.config.fs.open(
         settings.crm_mon_schema,
         mock.mock_open(read_data=crm_mon_rng_without_history)(),
         name="fs.open.crm_mon_rng",
         instead="fs.open.crm_mon_rng"
     )
     self.env_assist.assert_raise_library_error(
         lambda: stonith.history_update(self.env_assist.get_env()),
         [
             fixture.error(
                 report_codes.FENCE_HISTORY_NOT_SUPPORTED,
             )
         ],
         expected_in_processor=False
     )
Exemplo n.º 3
0
 def test_history_not_supported(self):
     self.config.fs.open(
         settings.crm_mon_schema,
         mock.mock_open(read_data=crm_mon_rng_without_history)(),
         name="fs.open.crm_mon_rng",
         instead="fs.open.crm_mon_rng"
     )
     self.env_assist.assert_raise_library_error(
         lambda: stonith.history_update(self.env_assist.get_env()),
         [
             fixture.error(
                 report_codes.FENCE_HISTORY_NOT_SUPPORTED,
             )
         ],
         expected_in_processor=False
     )
Exemplo n.º 4
0
 def test_error(self):
     stdout = "some output\n"
     stderr = "some error\n"
     self.config.runner.pcmk.fence_history_update(
         stdout=stdout, stderr=stderr, returncode=1,
     )
     self.env_assist.assert_raise_library_error(
         lambda: stonith.history_update(self.env_assist.get_env()),
         [
             fixture.error(
                 reports.codes.FENCE_HISTORY_COMMAND_ERROR,
                 command=reports.const.FENCE_HISTORY_COMMAND_UPDATE,
                 reason=(stderr + stdout).strip(),
             )
         ],
         expected_in_processor=False,
     )
Exemplo n.º 5
0
 def test_error(self):
     stdout = "some output\n"
     stderr = "some error\n"
     self.config.runner.pcmk.fence_history_update(
         stdout=stdout,
         stderr=stderr,
         returncode=1,
     )
     self.env_assist.assert_raise_library_error(
         lambda: stonith.history_update(self.env_assist.get_env()),
         [
             fixture.error(
                 report_codes.FENCE_HISTORY_COMMAND_ERROR,
                 command_label="update",
                 reason=(stderr + stdout).strip(),
             )
         ],
         expected_in_processor=False
     )
Exemplo n.º 6
0
 def test_success_all_nodes(self):
     msg = "gather fencing-history from all nodes\n"
     self.config.runner.pcmk.fence_history_update(stdout=msg)
     output = stonith.history_update(self.env_assist.get_env())
     self.assertEqual(output, msg.strip())
Exemplo n.º 7
0
 def test_success_all_nodes(self):
     msg = "gather fencing-history from all nodes\n"
     self.config.runner.pcmk.fence_history_update(stdout=msg)
     output = stonith.history_update(self.env_assist.get_env())
     self.assertEqual(output, msg.strip())