feat: add archive listing and resolution to restore.sh

This commit is contained in:
kbe
2026-07-25 18:57:21 +02:00
parent 49ed87b46b
commit 769eeea2b9
3 changed files with 105 additions and 0 deletions
+13
View File
@@ -47,9 +47,22 @@ test_unknown_command_exits_one() {
assert_eq "1" "$rc" "unknown command exits 1"
}
source "$HERE/lib/setup_mocks.sh"
test_list_archives() {
local mockdir out
mockdir="$(mktemp -d)"
setup_mock_bin "$mockdir"
out="$(PATH="$mockdir:$PATH" bash "$RESTORE" --list-archives)"
assert_contains "$out" "host-2026-01-01T00-00-00" "list-archives shows first archive"
assert_contains "$out" "host-2026-06-01T00-00-00" "list-archives shows latest archive"
rm -rf "$mockdir"
}
test_help_exits_zero
test_no_args_exits_one
test_unknown_command_exits_one
test_list_archives
echo "-----"
if [[ "$FAILURES" -gt 0 ]]; then