summaryrefslogtreecommitdiff
path: root/test/e2e/pull_test.go
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2019-10-15 11:14:37 -0400
committerNalin Dahyabhai <nalin@redhat.com>2019-10-29 13:35:19 -0400
commit05c65e88e3992eb57aee9f0dcb622de8a6d81a70 (patch)
tree770252475297aa3d466ffd2d516dd7ccdd0186bf /test/e2e/pull_test.go
parenta4a70b4506ec4abb8b3bbc3873ee5ca015a8ed08 (diff)
downloadpodman-05c65e88e3992eb57aee9f0dcb622de8a6d81a70.tar.gz
podman-05c65e88e3992eb57aee9f0dcb622de8a6d81a70.tar.bz2
podman-05c65e88e3992eb57aee9f0dcb622de8a6d81a70.zip
Add e2e tests for manifest list support
Test that when we pull using tag or digest references from locations that are manifest lists, that we can inspect using the references that we used for pulling, that the tags show up in the RepoTag list when we inspect an image that was pulled using a tag, and that the list and instance digests always both show up in the RepoDigest list. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Diffstat (limited to 'test/e2e/pull_test.go')
-rw-r--r--test/e2e/pull_test.go137
1 files changed, 137 insertions, 0 deletions
diff --git a/test/e2e/pull_test.go b/test/e2e/pull_test.go
index 537084220..5152409af 100644
--- a/test/e2e/pull_test.go
+++ b/test/e2e/pull_test.go
@@ -93,6 +93,143 @@ var _ = Describe("Podman pull", func() {
Expect(session.ExitCode()).To(Equal(0))
})
+ It("podman pull by digest (image list)", func() {
+ session := podmanTest.PodmanNoCache([]string{"pull", "--override-arch=arm64", ALPINELISTDIGEST})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ // inspect using the digest of the list
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoTags}}", ALPINELISTDIGEST})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(string(session.Out.Contents())).To(HavePrefix("[]"))
+ // inspect using the digest of the list
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINELISTDIGEST})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
+ // inspect using the digest of the arch-specific image's manifest
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64DIGEST})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(string(session.Out.Contents())).To(HavePrefix("[]"))
+ // inspect using the digest of the arch-specific image's manifest
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64DIGEST})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
+ // inspect using the image ID
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64ID})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(string(session.Out.Contents())).To(HavePrefix("[]"))
+ // inspect using the image ID
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64ID})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
+ // remove using the digest of the list
+ session = podmanTest.PodmanNoCache([]string{"rmi", ALPINELISTDIGEST})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ })
+
+ It("podman pull by instance digest (image list)", func() {
+ session := podmanTest.PodmanNoCache([]string{"pull", "--override-arch=arm64", ALPINEARM64DIGEST})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ // inspect using the digest of the list
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoTags}}", ALPINELISTDIGEST})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Not(Equal(0)))
+ // inspect using the digest of the list
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINELISTDIGEST})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Not(Equal(0)))
+ // inspect using the digest of the arch-specific image's manifest
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64DIGEST})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(string(session.Out.Contents())).To(HavePrefix("[]"))
+ // inspect using the digest of the arch-specific image's manifest
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64DIGEST})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(string(session.Out.Contents())).To(Not(ContainSubstring(ALPINELISTDIGEST)))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
+ // inspect using the image ID
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64ID})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(string(session.Out.Contents())).To(HavePrefix("[]"))
+ // inspect using the image ID
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64ID})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(string(session.Out.Contents())).To(Not(ContainSubstring(ALPINELISTDIGEST)))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
+ // remove using the digest of the instance
+ session = podmanTest.PodmanNoCache([]string{"rmi", ALPINEARM64DIGEST})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ })
+
+ It("podman pull by tag (image list)", func() {
+ session := podmanTest.PodmanNoCache([]string{"pull", "--override-arch=arm64", ALPINELISTTAG})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ // inspect using the tag we used for pulling
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoTags}}", ALPINELISTTAG})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTTAG))
+ // inspect using the tag we used for pulling
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINELISTTAG})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
+ // inspect using the digest of the list
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoTags}}", ALPINELISTDIGEST})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTTAG))
+ // inspect using the digest of the list
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINELISTDIGEST})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
+ // inspect using the digest of the arch-specific image's manifest
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64DIGEST})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTTAG))
+ // inspect using the digest of the arch-specific image's manifest
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64DIGEST})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
+ // inspect using the image ID
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoTags}}", ALPINEARM64ID})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTTAG))
+ // inspect using the image ID
+ session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.RepoDigests}}", ALPINEARM64ID})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST))
+ Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST))
+ // remove using the tag
+ session = podmanTest.PodmanNoCache([]string{"rmi", ALPINELISTTAG})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ })
+
It("podman pull bogus image", func() {
session := podmanTest.PodmanNoCache([]string{"pull", "umohnani/get-started"})
session.WaitWithDefaultTimeout()