diff --git a/test/e2e/suite/command/attach.go b/test/e2e/suite/command/attach.go index ee19f0ba1..da86130c3 100644 --- a/test/e2e/suite/command/attach.go +++ b/test/e2e/suite/command/attach.go @@ -138,7 +138,7 @@ var _ = Describe("ORAS beginners:", func() { var _ = Describe("1.1 registry users:", func() { When("running attach command", func() { It("should attach a file to a subject and output status", func() { - testRepo := attachTestRepo("simple") + testRepo := attachTestRepo("attach-tag") CopyZOTRepo(ImageRepo, testRepo) subjectRef := RegistryRef(ZOTHost, testRepo, foobar.Tag) ORAS("attach", "--artifact-type", "test/attach", subjectRef, fmt.Sprintf("%s:%s", foobar.AttachFileName, foobar.AttachFileMedia)). @@ -147,6 +147,16 @@ var _ = Describe("1.1 registry users:", func() { MatchStatus([]match.StateKey{foobar.AttachFileStateKey}, false, 1).Exec() }) + It("should attach a file to a subject and output status", func() { + testRepo := attachTestRepo("attach-digest") + CopyZOTRepo(ImageRepo, testRepo) + subjectRef := RegistryRef(ZOTHost, testRepo, foobar.Digest) + ORAS("attach", "--artifact-type", "test/attach", subjectRef, fmt.Sprintf("%s:%s", foobar.AttachFileName, foobar.AttachFileMedia)). + WithWorkDir(PrepareTempFiles()). + MatchKeyWords(fmt.Sprintf("Attached to [registry] %s", subjectRef)). + MatchStatus([]match.StateKey{foobar.AttachFileStateKey}, false, 1).Exec() + }) + It("should attach a file to an arch-specific subject", func() { // prepare testRepo := attachTestRepo("arch-specific")