diff --git a/test/e2e/suite/command/tag.go b/test/e2e/suite/command/tag.go index 4532d7655..db751804c 100644 --- a/test/e2e/suite/command/tag.go +++ b/test/e2e/suite/command/tag.go @@ -17,6 +17,7 @@ package command import ( "fmt" + "path/filepath" "regexp" . "github.com/onsi/ginkgo/v2" @@ -108,5 +109,13 @@ var _ = Describe("OCI image layout users:", func() { It("should add multiple tags to an existent manifest when providing tag reference", func() { tagAndValidate(PrepareTempOCI(ImageRepo), multi_arch.Tag, multi_arch.Digest, "tag1-via-tag", "tag1-via-tag", "tag1-via-tag") }) + It("should be able to retag a manifest at the current directory", func() { + root := PrepareTempOCI(ImageRepo) + dir := filepath.Dir(root) + ref := filepath.Base(root) + ORAS("tag", LayoutRef(ref, multi_arch.Tag), Flags.Layout, "latest").WithWorkDir(dir).MatchKeyWords("Tagging [oci-layout]", "Tagged latest").Exec() + ORAS("tag", LayoutRef(ref, multi_arch.Tag), Flags.Layout, "tag2").WithWorkDir(dir).MatchKeyWords("Tagging [oci-layout]", "Tagged tag2").Exec() + ORAS("repo", "tags", Flags.Layout, LayoutRef(ref, multi_arch.Tag)).WithWorkDir(dir).MatchKeyWords(multi_arch.Tag, "latest", "tag2").Exec() + }) }) })