mirror of
https://github.com/netinvent/npbackup.git
synced 2025-10-11 05:57:48 +08:00
tests: Allow dump test exit code 30 (warnings)
This commit is contained in:
parent
edf363562f
commit
b206ba9acf
1 changed files with 3 additions and 2 deletions
|
@ -500,13 +500,14 @@ def test_npbackup_cli_dump():
|
|||
Don't use RedirectedStdout since dump will output binary data
|
||||
"""
|
||||
print("DUMPING FILE", DUMP_FILE_RESTIC_PATH, "TO", DUMP_FILE_RESTORED)
|
||||
cmd = f"{sys.executable} ..{os.sep}npbackup{os.sep}bin{os.sep}npbackup-cli -c {CONF_FILE} --debug --dump {DUMP_FILE_RESTIC_PATH} > {DUMP_FILE_RESTORED}"
|
||||
cmd = f"{sys.executable} ..{os.sep}npbackup{os.sep}bin{os.sep}npbackup-cli -c {CONF_FILE} --dump {DUMP_FILE_RESTIC_PATH} > {DUMP_FILE_RESTORED}"
|
||||
print(cmd)
|
||||
exit_code, output = command_runner(cmd, shell=True)
|
||||
print(exit_code, output)
|
||||
with open(DUMP_FILE_RESTORED, "rb") as f:
|
||||
print(f"Restored file {DUMP_FILE_RESTORED} contents:\n{f.read()}")
|
||||
assert exit_code == 0, "Dump command failed"
|
||||
# Allow exit code 30 because we get a warning for the log file creation
|
||||
assert exit_code in (0, 30), "Dump command failed"
|
||||
|
||||
original_sha = sha256sum(os.path.join("..", "npbackup", "npbackup", DUMP_FILE))
|
||||
restored_sha = sha256sum(DUMP_FILE_RESTORED)
|
||||
|
|
Loading…
Add table
Reference in a new issue