From b206ba9acf6fef8f47b7be104c77112c44386cdc Mon Sep 17 00:00:00 2001 From: deajan Date: Tue, 9 Sep 2025 23:54:29 +0200 Subject: [PATCH] tests: Allow dump test exit code 30 (warnings) --- tests/test_npbackup-cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_npbackup-cli.py b/tests/test_npbackup-cli.py index eb0d67f..ed35e4a 100644 --- a/tests/test_npbackup-cli.py +++ b/tests/test_npbackup-cli.py @@ -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)