示例#1
0
def test_watchdog(cmd_runner, watchdog=None):
    cmd = [settings.sbd_binary, "test-watchdog"]
    if watchdog:
        cmd.extend(["-w", watchdog])
    std_out, dummy_std_err, ret_val = cmd_runner.run(cmd)
    if ret_val:
        if "Multiple watchdog devices discovered" in std_out:
            raise LibraryError(reports.sbd_watchdog_test_multiple_devices())
        raise LibraryError(reports.sbd_watchdog_test_error(std_out))
    raise LibraryError(reports.sbd_watchdog_test_failed())
示例#2
0
文件: sbd.py 项目: tomjelinek/pcs
def test_watchdog(cmd_runner, watchdog=None):
    cmd = [settings.sbd_binary, "test-watchdog"]
    if watchdog:
        cmd.extend(["-w", watchdog])
    std_out, dummy_std_err, ret_val = cmd_runner.run(cmd)
    if ret_val:
        if "Multiple watchdog devices discovered" in std_out:
            raise LibraryError(reports.sbd_watchdog_test_multiple_devices())
        raise LibraryError(reports.sbd_watchdog_test_error(std_out))
    raise LibraryError(reports.sbd_watchdog_test_failed())