Fix listener tests

Signed-off-by: João Pereira <484633+joaodrp@users.noreply.github.com>
This commit is contained in:
João Pereira 2021-05-27 23:51:55 +01:00
parent 6ae6df7d75
commit 22053f57b0
No known key found for this signature in database
GPG key ID: C325CA2B821F7043

View file

@ -199,11 +199,20 @@ func checkExerciseRepository(t *testing.T, repository distribution.Repository, r
t.Fatalf("mismatching digest from payload and put") t.Fatalf("mismatching digest from payload and put")
} }
if err := repository.Tags(ctx).Tag(ctx, tag, distribution.Descriptor{Digest: dgst}); err != nil {
t.Fatalf("unexpected error tagging manifest: %v", err)
}
_, err = manifests.Get(ctx, dgst) _, err = manifests.Get(ctx, dgst)
if err != nil { if err != nil {
t.Fatalf("unexpected error fetching manifest: %v", err) t.Fatalf("unexpected error fetching manifest: %v", err)
} }
err = repository.Tags(ctx).Untag(ctx, m.Tag)
if err != nil {
t.Fatalf("unexpected error deleting tag: %v", err)
}
err = manifests.Delete(ctx, dgst) err = manifests.Delete(ctx, dgst)
if err != nil { if err != nil {
t.Fatalf("unexpected error deleting blob: %v", err) t.Fatalf("unexpected error deleting blob: %v", err)
@ -216,11 +225,6 @@ func checkExerciseRepository(t *testing.T, repository distribution.Repository, r
} }
} }
err = repository.Tags(ctx).Untag(ctx, m.Tag)
if err != nil {
t.Fatalf("unexpected error deleting tag: %v", err)
}
err = remover.Remove(ctx, repository.Named()) err = remover.Remove(ctx, repository.Named())
if err != nil { if err != nil {
t.Fatalf("unexpected error deleting repo: %v", err) t.Fatalf("unexpected error deleting repo: %v", err)