Skip to content

Commit

Permalink
added forgotten tests
Browse files Browse the repository at this point in the history
Signed-off-by: wangxiaoxuan273 <wangxiaoxuan119@gmail.com>
  • Loading branch information
wangxiaoxuan273 committed Mar 16, 2023
1 parent 06c6b1e commit 2cd9fa6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/e2e/suite/command/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ var _ = Describe("Common registry users:", func() {
ExpectFailure().
MatchErrKeyWords(multi_arch.LinuxAMD64.Digest.String(), "error: ", "not found").Exec()
})
It("should fail if no manifest tag or digest is provided", func() {
ORAS("manifest", "fetch", RegistryRef(Host, ImageRepo, "")).ExpectFailure().MatchErrKeyWords("Error:", "invalid image reference").Exec()
})
})

When("running `manifest push`", func() {
Expand Down Expand Up @@ -331,6 +334,9 @@ var _ = Describe("Common registry users:", func() {
ORAS("manifest", "fetch-config", "--descriptor", "--platform", "linux/amd64", RegistryRef(Host, ImageRepo, multi_arch.Tag)).
MatchContent(multi_arch.LinuxAMD64ConfigDesc).Exec()
})
It("should fail if no manifest tag or digest is provided", func() {
ORAS("manifest", "fetch-config", RegistryRef(Host, ImageRepo, "")).ExpectFailure().MatchErrKeyWords("Error:", "invalid image reference").Exec()
})
})

When("running `manifest delete`", func() {
Expand Down Expand Up @@ -446,10 +452,10 @@ var _ = Describe("OCI image layout users:", func() {
ExpectFailure().
MatchErrKeyWords("Error", "--media-type", "--oci-layout").Exec()
})
It("should fail fetching manifest without reference provided", func() {
It("should fail if no manifest tag or digest is provided", func() {
root := prepare()
ORAS("manifest", "fetch", Flags.Layout, root).ExpectFailure().
MatchErrKeyWords("Error:").Exec()
MatchErrKeyWords("Error:", "invalid image reference").Exec()
})
})

Expand Down Expand Up @@ -492,9 +498,9 @@ var _ = Describe("OCI image layout users:", func() {
ORAS("manifest", "fetch-config", "--descriptor", "--platform", "linux/amd64", Flags.Layout, LayoutRef(root, multi_arch.Tag)).
MatchContent(multi_arch.LinuxAMD64ConfigDesc).Exec()
})
It("should fail if no manifest reference provided", func() {
It("should fail if no manifest tag or digest is provided", func() {
root := prepare(foobar.Tag)
ORAS("manifest", "fetch-config", Flags.Layout, root).ExpectFailure().Exec()
ORAS("manifest", "fetch-config", Flags.Layout, root).ExpectFailure().MatchErrKeyWords("Error:", "invalid image reference").Exec()
})
})
})

0 comments on commit 2cd9fa6

Please sign in to comment.