forked from TrueCloudLab/restic
Index: Test pack ID
This commit is contained in:
parent
dc6a832cc3
commit
4f780a01f9
1 changed files with 6 additions and 1 deletions
|
@ -27,9 +27,14 @@ func createFilledRepo(t testing.TB, snapshots int, dup float32) (restic.Reposito
|
||||||
|
|
||||||
func validateIndex(t testing.TB, repo restic.Repository, idx *Index) {
|
func validateIndex(t testing.TB, repo restic.Repository, idx *Index) {
|
||||||
for id := range repo.List(restic.DataFile, nil) {
|
for id := range repo.List(restic.DataFile, nil) {
|
||||||
if _, ok := idx.Packs[id]; !ok {
|
p, ok := idx.Packs[id]
|
||||||
|
if !ok {
|
||||||
t.Errorf("pack %v missing from index", id.Str())
|
t.Errorf("pack %v missing from index", id.Str())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !p.ID.Equal(id) {
|
||||||
|
t.Errorf("pack %v has invalid ID: want %v, got %v", id.Str(), id, p.ID)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue