Skip to content

Commit

Permalink
Dev: unitest: Adjust unit test for previous change
Browse files Browse the repository at this point in the history
  • Loading branch information
liangxin1300 committed Mar 6, 2024
1 parent c4475eb commit 7be77c9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/unittests/test_report_collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,12 +548,19 @@ def test_dump_runtime_state(self, mock_run, mock_str2file, mock_debug, mock_get_
]
mock_run_inst = mock.Mock()
mock_run.return_value = mock_run_inst
mock_run_inst.get_stdout_or_raise_error.side_effect = ["crm_mon_data", "cib_data", "crm_node_data"]
mock_run_inst.get_stdout_or_raise_error.side_effect = [
"crm_mon_data_r1",
"crm_mon_data_n1",
"crm_mon_data_rf1",
"crm_mon_data_rnt1",
"cib_data",
"crm_node_data"
]
mock_get_dc.return_value = "node1"
mock_this_node.return_value = "node1"
collect.dump_runtime_state("/opt/workdir")
mock_debug.assert_has_calls([
mock.call(f"Dump cluster state into {constants.CRM_MON_F}"),
mock.call(f"Dump crm_mon state into {constants.CRM_MON_F}"),
mock.call(f"Dump CIB contents into {constants.CIB_F}"),
mock.call(f"Dump members of this partition into {constants.MEMBERSHIP_F}"),
mock.call(f"Current DC is node1; Touch file 'DC' in workdir")
Expand Down

0 comments on commit 7be77c9

Please sign in to comment.