diff --git a/tests/test_backup.py b/tests/test_backup.py index ca2e47358844291bb1d973479713285717f440a6..8e760b7548dff7c84813dd77fe5666b6be2081cd 100755 --- a/tests/test_backup.py +++ b/tests/test_backup.py @@ -88,7 +88,7 @@ def test_last_backup_is_recent(server: str) -> bool: "-maxdepth 1", "-xtype l", "-name latest", - "-exec realpath {} +" # must always be last arg + "-exec realpath {} +", # must always be last arg ) cmd = "ssh -o StrictHostKeyChecking=no {} '{}'".format(server, find) status, out = subprocess.getstatusoutput(cmd) @@ -205,17 +205,17 @@ def main(): local_backup_folders = conf.get("LOCAL_BACKUP_FOLDERS") if backup_server: if not test_ssh(backup_server): - sys.exit(1) + exit(1) else: if not test_last_backup_is_recent(backup_server): - sys.exit(1) + exit(1) else: - sys.exit(0) + exit(0) elif local_backup_folders: - sys.exit(not check_local_backups(local_backup_folders)) + exit(not check_local_backups(local_backup_folders)) else: print("No backup_server defined in config, untestable") - sys.exit(2) + exit(2) if __name__ == "__main__":