Correct test digest lengths and enable all unit tests
Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
This commit is contained in:
parent
609bc63dd4
commit
a7740f5d0f
1 changed files with 7 additions and 7 deletions
14
docs/storage/cache/cachecheck/suite.go
vendored
14
docs/storage/cache/cachecheck/suite.go
vendored
|
@ -17,6 +17,7 @@ func CheckBlobDescriptorCache(t *testing.T, provider cache.BlobDescriptorCachePr
|
||||||
|
|
||||||
checkBlobDescriptorCacheEmptyRepository(t, ctx, provider)
|
checkBlobDescriptorCacheEmptyRepository(t, ctx, provider)
|
||||||
checkBlobDescriptorCacheSetAndRead(t, ctx, provider)
|
checkBlobDescriptorCacheSetAndRead(t, ctx, provider)
|
||||||
|
checkBlobDescriptorCacheClear(t, ctx, provider)
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkBlobDescriptorCacheEmptyRepository(t *testing.T, ctx context.Context, provider cache.BlobDescriptorCacheProvider) {
|
func checkBlobDescriptorCacheEmptyRepository(t *testing.T, ctx context.Context, provider cache.BlobDescriptorCacheProvider) {
|
||||||
|
@ -141,10 +142,10 @@ func checkBlobDescriptorCacheSetAndRead(t *testing.T, ctx context.Context, provi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkBlobDescriptorClear(t *testing.T, ctx context.Context, provider cache.BlobDescriptorCacheProvider) {
|
func checkBlobDescriptorCacheClear(t *testing.T, ctx context.Context, provider cache.BlobDescriptorCacheProvider) {
|
||||||
localDigest := digest.Digest("sha384:abc")
|
localDigest := digest.Digest("sha384:def111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111")
|
||||||
expected := distribution.Descriptor{
|
expected := distribution.Descriptor{
|
||||||
Digest: "sha256:abc",
|
Digest: "sha256:def1111111111111111111111111111111111111111111111111111111111111",
|
||||||
Size: 10,
|
Size: 10,
|
||||||
MediaType: "application/octet-stream"}
|
MediaType: "application/octet-stream"}
|
||||||
|
|
||||||
|
@ -168,12 +169,11 @@ func checkBlobDescriptorClear(t *testing.T, ctx context.Context, provider cache.
|
||||||
|
|
||||||
err = cache.Clear(ctx, localDigest)
|
err = cache.Clear(ctx, localDigest)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unexpected error deleting descriptor")
|
t.Error(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
nonExistantDigest := digest.Digest("sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
|
desc, err = cache.Stat(ctx, localDigest)
|
||||||
err = cache.Clear(ctx, nonExistantDigest)
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatalf("expected error deleting unknown descriptor")
|
t.Fatalf("expected error statting deleted blob: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue