fix: preserve snapshot symlinks and guard incomplete upgrade copies

This commit is contained in:
2026-10-18 10:12:53 +08:00
parent 1c244e135f
commit ed72985e7b
8 changed files with 192 additions and 45 deletions
+2 -1
View File
@@ -8,6 +8,7 @@ import (
"os"
"path/filepath"
"strings"
"syscall"
"testing"
)
@@ -30,7 +31,7 @@ func TestRestoreSnapshotCopyFailureDoesNotConsumeRetention(t *testing.T) {
}
configWrite(t, filepath.Join(base, name, "keep"), name)
}
if err := os.Symlink("missing-target", filepath.Join(home, "dangling")); err != nil {
if err := syscall.Mkfifo(filepath.Join(home, "dangling"), 0600); err != nil {
t.Fatal(err)
}
body := fmt.Sprintf(`{"backup_id":%q,"password":"original-password"}`, result.ID)