Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(e2e): migrate oras tag specs to ZOT #1087

Merged
merged 31 commits into from
Aug 30, 2023
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f61b791
test(e2e): add zot
qweeah Aug 22, 2023
06abf60
add auth tests
qweeah Aug 22, 2023
8e644c6
uncomment changes
qweeah Aug 23, 2023
0c7a3ee
move auth and scenario suite to zot
qweeah Aug 23, 2023
35d8bd4
add password
qweeah Aug 23, 2023
1700e23
update description
qweeah Aug 23, 2023
7267ca4
separate prepare script out
qweeah Aug 23, 2023
a2cc4ea
check in zot config
qweeah Aug 23, 2023
e5f7398
add run access
qweeah Aug 23, 2023
2feed93
fix prepare bug
qweeah Aug 23, 2023
96fc889
remove prepare changes
qweeah Aug 24, 2023
2c2b597
run zot container via current user
qweeah Aug 25, 2023
6f9f3c2
rename zot
qweeah Aug 25, 2023
0a00292
add images repo for command suite and attach tests
qweeah Aug 25, 2023
3d60a75
update blob tests
qweeah Aug 25, 2023
c79ba60
Merge remote-tracking branch 'origin_src/main' into zot-attach
qweeah Aug 25, 2023
6e1998b
Merge remote-tracking branch 'origin_src/main' into zot-blob
qweeah Aug 28, 2023
d3d747b
Merge remote-tracking branch 'origin_src/main' into zot-attach
qweeah Aug 28, 2023
8efd185
add doc
qweeah Aug 28, 2023
f3cf89e
doc clean
qweeah Aug 28, 2023
8295d85
Merge branch 'zot-attach' into zot-blob
qweeah Aug 28, 2023
dea043d
fix e2e
qweeah Aug 28, 2023
1945b87
test(e2e): migrate `oras push` specs to ZOT
qweeah Aug 28, 2023
f028e61
fix e2e
qweeah Aug 28, 2023
a25d23f
fix e2e
qweeah Aug 29, 2023
003072a
Merge branch 'zot-push' into zot-pull
qweeah Aug 29, 2023
df78bef
test(e2e): migrate specs for `oras pull`
qweeah Aug 29, 2023
1e9bbd8
fix e2e
qweeah Aug 29, 2023
e2a4c38
Merge branch 'zot-push' into zot-pull
qweeah Aug 29, 2023
003c2c9
test(e2e): migrate `oras tag` specs to ZOT
qweeah Aug 29, 2023
36a8c38
Merge remote-tracking branch 'origin_src/main' into zot-tag
qweeah Aug 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 13 additions & 35 deletions test/e2e/suite/command/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var _ = Describe("ORAS beginners:", func() {
})

It("should fail when provided manifest reference is not found", func() {
ORAS("tag", RegistryRef(Host, ImageRepo, "i-dont-think-this-tag-exists"), "tagged").ExpectFailure().MatchErrKeyWords("Error:").Exec()
ORAS("tag", RegistryRef(ZOTHost, ImageRepo, "i-dont-think-this-tag-exists"), "tagged").ExpectFailure().MatchErrKeyWords("Error:").Exec()
})

It("should fail when provided invalid reference", func() {
Expand All @@ -52,16 +52,16 @@ var _ = Describe("1.1 registry users:", func() {
}
When("running `tag`", func() {
It("should add a tag to an existent manifest when providing tag reference", func() {
tagAndValidate(Host, ImageRepo, multi_arch.Tag, multi_arch.Digest, "tag-via-tag")
tagAndValidate(ZOTHost, ImageRepo, multi_arch.Tag, multi_arch.Digest, "tag-via-tag")
})
It("should add a tag to an existent manifest when providing digest reference", func() {
tagAndValidate(Host, ImageRepo, multi_arch.Digest, multi_arch.Digest, "tag-via-digest")
tagAndValidate(ZOTHost, ImageRepo, multi_arch.Digest, multi_arch.Digest, "tag-via-digest")
})
It("should add multiple tags to an existent manifest when providing digest reference", func() {
tagAndValidate(Host, ImageRepo, multi_arch.Digest, multi_arch.Digest, "tag1-via-digest", "tag2-via-digest", "tag3-via-digest")
tagAndValidate(ZOTHost, ImageRepo, multi_arch.Digest, multi_arch.Digest, "tag1-via-digest", "tag2-via-digest", "tag3-via-digest")
})
It("should add multiple tags to an existent manifest when providing tag reference", func() {
tagAndValidate(Host, ImageRepo, multi_arch.Tag, multi_arch.Digest, "tag1-via-tag", "tag1-via-tag", "tag1-via-tag")
tagAndValidate(ZOTHost, ImageRepo, multi_arch.Tag, multi_arch.Digest, "tag1-via-tag", "tag1-via-tag", "tag1-via-tag")
})
})
})
Expand All @@ -75,51 +75,29 @@ var _ = Describe("OCI image layout users:", func() {
ORAS("repo", "tags", Flags.Layout, LayoutRef(root, "")).MatchKeyWords(tags...).Exec()
}
When("running `tag`", func() {
prepare := func() string {
root := GinkgoT().TempDir()
ORAS("cp", RegistryRef(Host, ImageRepo, multi_arch.Tag), Flags.ToLayout, LayoutRef(root, multi_arch.Tag)).Exec()
return root
}
It("should add a tag to an existent manifest when providing tag reference", func() {
tagAndValidate(prepare(), multi_arch.Tag, multi_arch.Digest, "tag-via-tag")
tagAndValidate(PrepareTempOCI(ImageRepo), multi_arch.Tag, multi_arch.Digest, "tag-via-tag")
})
It("should add a tag to an existent manifest when providing digest reference", func() {
tagAndValidate(prepare(), multi_arch.Digest, multi_arch.Digest, "tag-via-digest")
tagAndValidate(PrepareTempOCI(ImageRepo), multi_arch.Digest, multi_arch.Digest, "tag-via-digest")
})
It("should add multiple tags to an existent manifest when providing digest reference", func() {
tagAndValidate(prepare(), multi_arch.Digest, multi_arch.Digest, "tag1-via-digest", "tag2-via-digest", "tag3-via-digest")
tagAndValidate(PrepareTempOCI(ImageRepo), multi_arch.Digest, multi_arch.Digest, "tag1-via-digest", "tag2-via-digest", "tag3-via-digest")
})
It("should add multiple tags to an existent manifest when providing tag reference", func() {
tagAndValidate(prepare(), multi_arch.Tag, multi_arch.Digest, "tag1-via-tag", "tag1-via-tag", "tag1-via-tag")
tagAndValidate(PrepareTempOCI(ImageRepo), multi_arch.Tag, multi_arch.Digest, "tag1-via-tag", "tag1-via-tag", "tag1-via-tag")
})
})
})

var _ = Describe("OCI image layout users:", func() {
var tagAndValidate = func(root string, tagOrDigest string, digest string, tags ...string) {
out := ORAS(append([]string{"tag", LayoutRef(root, tagOrDigest), Flags.Layout}, tags...)...).MatchKeyWords(tags...).Exec().Out
hint := regexp.QuoteMeta(fmt.Sprintf("Tagging [oci-layout] %s", LayoutRef(root, digest)))
gomega.Expect(out).To(gbytes.Say(hint))
gomega.Expect(out).NotTo(gbytes.Say(hint)) // should only say hint once
ORAS("repo", "tags", Flags.Layout, LayoutRef(root, "")).MatchKeyWords(tags...).Exec()
}
When("running `tag`", func() {
prepare := func() string {
root := GinkgoT().TempDir()
ORAS("cp", RegistryRef(Host, ImageRepo, multi_arch.Tag), Flags.ToLayout, LayoutRef(root, multi_arch.Tag)).Exec()
return root
qweeah marked this conversation as resolved.
Show resolved Hide resolved
}
It("should add a tag to an existent manifest when providing tag reference", func() {
tagAndValidate(prepare(), multi_arch.Tag, multi_arch.Digest, "tag-via-tag")
tagAndValidate(PrepareTempOCI(ImageRepo), multi_arch.Tag, multi_arch.Digest, "tag-via-tag")
})
It("should add a tag to an existent manifest when providing digest reference", func() {
tagAndValidate(prepare(), multi_arch.Digest, multi_arch.Digest, "tag-via-digest")
tagAndValidate(PrepareTempOCI(ImageRepo), multi_arch.Digest, multi_arch.Digest, "tag-via-digest")
})
It("should add multiple tags to an existent manifest when providing digest reference", func() {
tagAndValidate(prepare(), multi_arch.Digest, multi_arch.Digest, "tag1-via-digest", "tag2-via-digest", "tag3-via-digest")
tagAndValidate(PrepareTempOCI(ImageRepo), multi_arch.Digest, multi_arch.Digest, "tag1-via-digest", "tag2-via-digest", "tag3-via-digest")
})
It("should add multiple tags to an existent manifest when providing tag reference", func() {
tagAndValidate(prepare(), multi_arch.Tag, multi_arch.Digest, "tag1-via-tag", "tag1-via-tag", "tag1-via-tag")
tagAndValidate(PrepareTempOCI(ImageRepo), multi_arch.Tag, multi_arch.Digest, "tag1-via-tag", "tag1-via-tag", "tag1-via-tag")
})
})
})