mirror of https://github.com/restic/restic.git
checker: Use TestRepository
This commit is contained in:
parent
31055d88a5
commit
0e445ec0f5
|
@ -9,7 +9,6 @@ import (
|
||||||
|
|
||||||
"restic"
|
"restic"
|
||||||
"restic/archiver"
|
"restic/archiver"
|
||||||
"restic/backend/mem"
|
|
||||||
"restic/checker"
|
"restic/checker"
|
||||||
"restic/repository"
|
"restic/repository"
|
||||||
"restic/test"
|
"restic/test"
|
||||||
|
@ -249,19 +248,15 @@ func induceError(data []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCheckerModifiedData(t *testing.T) {
|
func TestCheckerModifiedData(t *testing.T) {
|
||||||
be := mem.New()
|
repo, cleanup := repository.TestRepository(t)
|
||||||
|
defer cleanup()
|
||||||
repository.TestUseLowSecurityKDFParameters(t)
|
|
||||||
|
|
||||||
repo := repository.New(be)
|
|
||||||
test.OK(t, repo.Init(test.TestPassword))
|
|
||||||
|
|
||||||
arch := archiver.New(repo)
|
arch := archiver.New(repo)
|
||||||
_, id, err := arch.Snapshot(nil, []string{"."}, nil, nil)
|
_, id, err := arch.Snapshot(nil, []string{"."}, nil, nil)
|
||||||
test.OK(t, err)
|
test.OK(t, err)
|
||||||
t.Logf("archived as %v", id.Str())
|
t.Logf("archived as %v", id.Str())
|
||||||
|
|
||||||
beError := &errorBackend{Backend: be}
|
beError := &errorBackend{Backend: repo.Backend()}
|
||||||
checkRepo := repository.New(beError)
|
checkRepo := repository.New(beError)
|
||||||
test.OK(t, checkRepo.SearchKey(test.TestPassword, 5))
|
test.OK(t, checkRepo.SearchKey(test.TestPassword, 5))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue