From 05c65e88e3992eb57aee9f0dcb622de8a6d81a70 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Tue, 15 Oct 2019 11:14:37 -0400 Subject: 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 --- test/e2e/config.go | 20 ++++--- test/e2e/create_test.go | 56 ++++++++++++++++++++ test/e2e/pull_test.go | 137 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 206 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/e2e/config.go b/test/e2e/config.go index 5e0000e09..aeb7affee 100644 --- a/test/e2e/config.go +++ b/test/e2e/config.go @@ -1,11 +1,17 @@ package integration var ( - redis = "docker.io/library/redis:alpine" - fedoraMinimal = "registry.fedoraproject.org/fedora-minimal:latest" - ALPINE = "docker.io/library/alpine:latest" - infra = "k8s.gcr.io/pause:3.1" - BB = "docker.io/library/busybox:latest" - healthcheck = "docker.io/libpod/alpine_healthcheck:latest" - ImageCacheDir = "/tmp/podman/imagecachedir" + redis = "docker.io/library/redis:alpine" + fedoraMinimal = "registry.fedoraproject.org/fedora-minimal:latest" + ALPINE = "docker.io/library/alpine:latest" + ALPINELISTTAG = "docker.io/library/alpine:3.10.2" + ALPINELISTDIGEST = "docker.io/library/alpine@sha256:72c42ed48c3a2db31b7dafe17d275b634664a708d901ec9fd57b1529280f01fb" + ALPINEAMD64DIGEST = "docker.io/library/alpine@sha256:acd3ca9941a85e8ed16515bfc5328e4e2f8c128caa72959a58a127b7801ee01f" + ALPINEAMD64ID = "961769676411f082461f9ef46626dd7a2d1e2b2a38e6a44364bcbecf51e66dd4" + ALPINEARM64DIGEST = "docker.io/library/alpine@sha256:db7f3dcef3d586f7dd123f107c93d7911515a5991c4b9e51fa2a43e46335a43e" + ALPINEARM64ID = "915beeae46751fc564998c79e73a1026542e945ca4f73dc841d09ccc6c2c0672" + infra = "k8s.gcr.io/pause:3.1" + BB = "docker.io/library/busybox:latest" + healthcheck = "docker.io/libpod/alpine_healthcheck:latest" + ImageCacheDir = "/tmp/podman/imagecachedir" ) diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go index 65b747880..f2020547f 100644 --- a/test/e2e/create_test.go +++ b/test/e2e/create_test.go @@ -241,4 +241,60 @@ var _ = Describe("Podman create", func() { session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To((Equal(0))) }) + + It("podman create using image list by tag", func() { + session := podmanTest.PodmanNoCache([]string{"create", "--pull=always", "--override-arch=arm64", "--name=foo", ALPINELISTTAG}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To((Equal(0))) + session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.Image}}", "foo"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To((Equal(0))) + Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64ID)) + session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.ImageName}}", "foo"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To((Equal(0))) + Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTTAG)) + }) + + It("podman create using image list by digest", func() { + session := podmanTest.PodmanNoCache([]string{"create", "--pull=always", "--override-arch=arm64", "--name=foo", ALPINELISTDIGEST}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To((Equal(0))) + session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.Image}}", "foo"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To((Equal(0))) + Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64ID)) + session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.ImageName}}", "foo"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To((Equal(0))) + Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINELISTDIGEST)) + }) + + It("podman create using image list instance by digest", func() { + session := podmanTest.PodmanNoCache([]string{"create", "--pull=always", "--override-arch=arm64", "--name=foo", ALPINEARM64DIGEST}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To((Equal(0))) + session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.Image}}", "foo"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To((Equal(0))) + Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64ID)) + session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.ImageName}}", "foo"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To((Equal(0))) + Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST)) + }) + + It("podman create using cross-arch image list instance by digest", func() { + session := podmanTest.PodmanNoCache([]string{"create", "--pull=always", "--override-arch=ppc64le", "--name=foo", ALPINEARM64DIGEST}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To((Equal(0))) + session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.Image}}", "foo"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To((Equal(0))) + Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64ID)) + session = podmanTest.PodmanNoCache([]string{"inspect", "--format", "{{.ImageName}}", "foo"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To((Equal(0))) + Expect(string(session.Out.Contents())).To(ContainSubstring(ALPINEARM64DIGEST)) + }) }) 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() -- cgit v1.2.3-54-g00ecf