Skip to content

Commit

Permalink
Fix and add hardware reboot cause determination tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sujinmkang committed Aug 18, 2022
1 parent 0dcc7fe commit 8720561
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/determine-reboot-cause_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,12 @@ def test_find_proc_cmdline_reboot_cause(self):
def test_find_hardware_reboot_cause(self):
with mock.patch("determine_reboot_cause.get_reboot_cause_from_platform", return_value=("Powerloss", None)):
result = determine_reboot_cause.find_hardware_reboot_cause()
assert result == "Powerloss (None)"
assert result == "Powerloss"

def test_find_hardware_reboot_cause_with_minor(self):
with mock.patch("determine_reboot_cause.get_reboot_cause_from_platform", return_value=("Powerloss", "under-voltage")):
result = determine_reboot_cause.find_hardware_reboot_cause()
assert result == "Powerloss (under-voltage)"

def test_get_reboot_cause_dict_watchdog(self):
reboot_cause_dict = determine_reboot_cause.get_reboot_cause_dict(REBOOT_CAUSE_WATCHDOG, "", GEN_TIME_WATCHDOG)
Expand Down

0 comments on commit 8720561

Please sign in to comment.