diff --git a/test/e2e/internal/utils/testdata.go b/test/e2e/internal/utils/testdata.go index b4aab0f84..400164387 100644 --- a/test/e2e/internal/utils/testdata.go +++ b/test/e2e/internal/utils/testdata.go @@ -22,6 +22,7 @@ const ( BlobRepo = "command/blobs" ArtifactRepo = "command/artifacts" Namespace = "command" + InvalidRepo = "INVALID" // env RegHostKey = "ORAS_REGISTRY_HOST" FallbackRegHostKey = "ORAS_REGISTRY_FALLBACK_HOST" diff --git a/test/e2e/suite/command/resolve.go b/test/e2e/suite/command/resolve.go index 459ae17ca..6fe15c624 100644 --- a/test/e2e/suite/command/resolve.go +++ b/test/e2e/suite/command/resolve.go @@ -31,6 +31,12 @@ var _ = Describe("ORAS beginners:", func() { It("should fail when no manifest reference provided", func() { ORAS("resolve").ExpectFailure().MatchErrKeyWords("Error:").Exec() }) + It("should fail when when repo is invalid", func() { + ORAS("resolve", fmt.Sprintf("%s/%s", ZOTHost, InvalidRepo)).ExpectFailure().MatchErrKeyWords("Error:", fmt.Sprintf("invalid reference: invalid repository %q", InvalidRepo)).Exec() + }) + It("should fail when no tag or digest provided", func() { + ORAS("resolve", RegistryRef(ZOTHost, ImageRepo, "")).ExpectFailure().MatchErrKeyWords("Error:", "no tag or digest when expecting ").Exec() + }) It("should fail when provided manifest reference is not found", func() { ORAS("resolve", RegistryRef(ZOTHost, ImageRepo, "i-dont-think-this-tag-exists")).ExpectFailure().MatchErrKeyWords("Error: failed to resolve digest:", "not found").Exec() }) @@ -39,7 +45,6 @@ var _ = Describe("ORAS beginners:", func() { outString := string(out.Contents()) outString = strings.TrimSpace(outString) gomega.Expect(outString).To(gomega.Equal(multi_arch.Digest)) - }) It("should resolve with with the fully qualified reference", func() { out := ORAS("resolve", "-l", RegistryRef(ZOTHost, ImageRepo, multi_arch.Tag)).Exec().Out