mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
test: the process-level restore ladder expects restore_source_not_own
A restore from a restore target's snapshot now refuses with the typed code; the two ladder checks still read the old not_admitted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ed82716e7d
commit
c93f2e1ddc
1 file changed
+4
-4
@@ -393,8 +393,8 @@ func TestSnapshotLadderB1SnapshotQuery(t *testing.T) {
|
||||
}
|
||||
out, errOut, code := env.h.run(t, "ops", "chunk", "restore", "--master", env.h.masterAddr, "--source", "v2", "--snapshot", "x", "--target", "v3",
|
||||
"--chunk-filer", env.cluster.filerGRPC, "--chunk-path", env.chunkPath)
|
||||
if code == 0 || !strings.Contains(out, `"code":"not_admitted"`) || !strings.Contains(out, "names another volume's chunks") {
|
||||
t.Fatalf("restore from a restore target's snapshot: exit %d, want not_admitted naming another volume's chunks\n%s\n%s", code, out, errOut)
|
||||
if code == 0 || !strings.Contains(out, `"code":"restore_source_not_own"`) || !strings.Contains(out, "names another volume's chunks") {
|
||||
t.Fatalf("restore from a restore target's snapshot: exit %d, want restore_source_not_own naming another volume's chunks\n%s\n%s", code, out, errOut)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -679,8 +679,8 @@ func TestSnapshotLadderC3RestoreThenWriteThenSnapshotIt(t *testing.T) {
|
||||
|
||||
out, errOut, code := env.h.run(t, "ops", "chunk", "restore", "--master", env.h.masterAddr, "--source", "v2", "--snapshot", "mine", "--target", "v3",
|
||||
"--chunk-filer", env.cluster.filerGRPC, "--chunk-path", env.chunkPath)
|
||||
if code == 0 || !strings.Contains(out, `"code":"not_admitted"`) || !strings.Contains(out, "names another volume's chunks") {
|
||||
t.Fatalf("restore from the restored volume's snapshot: exit %d, want not_admitted naming another volume's chunks\n%s\n%s", code, out, errOut)
|
||||
if code == 0 || !strings.Contains(out, `"code":"restore_source_not_own"`) || !strings.Contains(out, "names another volume's chunks") {
|
||||
t.Fatalf("restore from the restored volume's snapshot: exit %d, want restore_source_not_own naming another volume's chunks\n%s\n%s", code, out, errOut)
|
||||
}
|
||||
env.requireImage(t, "n-v2", mergeImages(src, own, ownLater), srcLater)
|
||||
env.restoreInto(t, "v1", "base", "v4") // the source's snapshot is unchanged
|
||||
|
||||
Reference in new issue
Block a user