Skip to content

Commit

Permalink
Update for ability to verify by snapshot ID
Browse files Browse the repository at this point in the history
New upstream behavior kopia/kopia#4121
  • Loading branch information
redgoat650 committed Sep 20, 2024
1 parent f6bd1c7 commit d728baf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/kopia/command/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ type SnapshotVerifyCommandArgs struct {
DirectoryID []string
FileID []string
Sources []string
SnapshotIDs []string
VerifyFilesPercent *float64
Parallelism *int
FileQueueLength *int
Expand Down Expand Up @@ -217,5 +218,9 @@ func SnapshotVerify(cmdArgs SnapshotVerifyCommandArgs) []string {
args = args.AppendLoggableKV(sourcesFlag, source)
}

for _, snapID := range cmdArgs.SnapshotIDs {
args = args.AppendLoggable(snapID)
}

return stringSliceCommand(args)
}
3 changes: 2 additions & 1 deletion pkg/kopia/command/snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,11 @@ func (kSnapshot *KopiaSnapshotTestSuite) TestSnapshotCommands(c *C) {
DirectoryID: []string{"d1", "d2"},
FileID: []string{"f1", "f2"},
Sources: []string{"s1", "s2"},
SnapshotIDs: []string{"id1", "id2"},
}
return SnapshotVerify(args)
},
expectedLog: "kopia --log-level=error --config-file=path/kopia.config --log-dir=cache/log --password=encr-key snapshot verify --verify-files-percent=12.345 --parallel=123 --file-queue-length=456 --file-parallelism=890 --directory-id=d1 --directory-id=d2 --file-id=f1 --file-id=f2 --sources=s1 --sources=s2",
expectedLog: "kopia --log-level=error --config-file=path/kopia.config --log-dir=cache/log --password=encr-key snapshot verify --verify-files-percent=12.345 --parallel=123 --file-queue-length=456 --file-parallelism=890 --directory-id=d1 --directory-id=d2 --file-id=f1 --file-id=f2 --sources=s1 --sources=s2 id1 id2",
},
} {
cmd := strings.Join(tc.f(), " ")
Expand Down

0 comments on commit d728baf

Please sign in to comment.