Bind audio cache reuse to remote identity
This commit is contained in:
@@ -58,7 +58,7 @@ func TestRestorePlanIncludeAudio(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRestorePlanExistingAudioUsesSizeWithoutRemoteChecksumDownload(t *testing.T) {
|
||||
func TestRestorePlanExistingAudioRequiresVerifiedReplacement(t *testing.T) {
|
||||
cfg := restorePlanConfig(t)
|
||||
current := restorePlanCurrentState(t, cfg)
|
||||
store := &storage.FakeBackend{}
|
||||
@@ -80,8 +80,18 @@ func TestRestorePlanExistingAudioUsesSizeWithoutRemoteChecksumDownload(t *testin
|
||||
actionByRel[action.LocalRelativePath] = action
|
||||
}
|
||||
audioAction := actionByRel["audio/alice.flac"]
|
||||
if audioAction.Kind != RestoreActionSkipSame {
|
||||
t.Fatalf("audio action kind = %q, want %q", audioAction.Kind, RestoreActionSkipSame)
|
||||
if audioAction.Kind != RestoreActionConflict {
|
||||
t.Fatalf("audio action kind = %q, want %q", audioAction.Kind, RestoreActionConflict)
|
||||
}
|
||||
|
||||
forcedPlan, err := buildRestorePlan(context.Background(), cfg, current, store, RestorePlanOptions{IncludeAudio: true, Force: true})
|
||||
if err != nil {
|
||||
t.Fatalf("forced buildRestorePlan() error = %v", err)
|
||||
}
|
||||
for _, action := range forcedPlan.Actions {
|
||||
if action.LocalRelativePath == "audio/alice.flac" && action.Kind != RestoreActionDownload {
|
||||
t.Fatalf("forced audio action kind = %q, want %q", action.Kind, RestoreActionDownload)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user