diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/images_test.go | 26 | ||||
-rw-r--r-- | test/e2e/libpod_suite_test.go | 4 | ||||
-rw-r--r-- | test/e2e/run_entrypoint_test.go | 14 |
3 files changed, 31 insertions, 13 deletions
diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go index 5e30e95ec..c04ae91bd 100644 --- a/test/e2e/images_test.go +++ b/test/e2e/images_test.go @@ -100,7 +100,7 @@ var _ = Describe("Podman images", func() { It("podman images filter before image", func() { dockerfile := `FROM docker.io/library/alpine:latest ` - podmanTest.BuildImage(dockerfile, "foobar.com/before:latest") + podmanTest.BuildImage(dockerfile, "foobar.com/before:latest", "false") result := podmanTest.Podman([]string{"images", "-q", "-f", "before=foobar.com/before:latest"}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(0)) @@ -114,7 +114,7 @@ var _ = Describe("Podman images", func() { dockerfile := `FROM docker.io/library/alpine:latest ` - podmanTest.BuildImage(dockerfile, "foobar.com/before:latest") + podmanTest.BuildImage(dockerfile, "foobar.com/before:latest", "false") result := podmanTest.Podman([]string{"images", "-q", "-f", "after=docker.io/library/alpine:latest"}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(0)) @@ -124,8 +124,8 @@ var _ = Describe("Podman images", func() { It("podman images filter dangling", func() { dockerfile := `FROM docker.io/library/alpine:latest ` - podmanTest.BuildImage(dockerfile, "foobar.com/before:latest") - podmanTest.BuildImage(dockerfile, "foobar.com/before:latest") + podmanTest.BuildImage(dockerfile, "foobar.com/before:latest", "false") + podmanTest.BuildImage(dockerfile, "foobar.com/before:latest", "false") result := podmanTest.Podman([]string{"images", "-q", "-f", "dangling=true"}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(0)) @@ -165,4 +165,22 @@ var _ = Describe("Podman images", func() { return size1 < size2 })).To(BeTrue()) }) + + It("podman images --all flag", func() { + dockerfile := `FROM docker.io/library/alpine:latest +RUN mkdir hello +RUN touch test.txt +ENV foo=bar +` + podmanTest.BuildImage(dockerfile, "test", "true") + session := podmanTest.Podman([]string{"images"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(len(session.OutputToStringArray())).To(Equal(4)) + + session2 := podmanTest.Podman([]string{"images", "--all"}) + session2.WaitWithDefaultTimeout() + Expect(session2.ExitCode()).To(Equal(0)) + Expect(len(session2.OutputToStringArray())).To(Equal(6)) + }) }) diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go index d06818fd3..3d444f662 100644 --- a/test/e2e/libpod_suite_test.go +++ b/test/e2e/libpod_suite_test.go @@ -593,11 +593,11 @@ func (p *PodmanTest) GetContainerStatus() string { // BuildImage uses podman build and buildah to build an image // called imageName based on a string dockerfile -func (p *PodmanTest) BuildImage(dockerfile, imageName string) { +func (p *PodmanTest) BuildImage(dockerfile, imageName string, layers string) { dockerfilePath := filepath.Join(p.TempDir, "Dockerfile") err := ioutil.WriteFile(dockerfilePath, []byte(dockerfile), 0755) Expect(err).To(BeNil()) - session := p.Podman([]string{"build", "-t", imageName, "--file", dockerfilePath, p.TempDir}) + session := p.Podman([]string{"build", "--layers=" + layers, "-t", imageName, "--file", dockerfilePath, p.TempDir}) session.Wait(120) Expect(session.ExitCode()).To(Equal(0)) } diff --git a/test/e2e/run_entrypoint_test.go b/test/e2e/run_entrypoint_test.go index e06f8bb3a..7cae4e0df 100644 --- a/test/e2e/run_entrypoint_test.go +++ b/test/e2e/run_entrypoint_test.go @@ -33,7 +33,7 @@ var _ = Describe("Podman run entrypoint", func() { ENTRYPOINT [] CMD [] ` - podmanTest.BuildImage(dockerfile, "foobar.com/entrypoint:latest") + podmanTest.BuildImage(dockerfile, "foobar.com/entrypoint:latest", "false") session := podmanTest.Podman([]string{"run", "foobar.com/entrypoint:latest"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(125)) @@ -43,7 +43,7 @@ CMD [] dockerfile := `FROM docker.io/library/alpine:latest ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] ` - podmanTest.BuildImage(dockerfile, "foobar.com/entrypoint:latest") + podmanTest.BuildImage(dockerfile, "foobar.com/entrypoint:latest", "false") session := podmanTest.Podman([]string{"run", "foobar.com/entrypoint:latest"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -55,7 +55,7 @@ ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] CMD [ "-v"] ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] ` - podmanTest.BuildImage(dockerfile, "foobar.com/entrypoint:latest") + podmanTest.BuildImage(dockerfile, "foobar.com/entrypoint:latest", "false") session := podmanTest.Podman([]string{"run", "foobar.com/entrypoint:latest"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -67,7 +67,7 @@ ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] CMD [ "-v"] ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] ` - podmanTest.BuildImage(dockerfile, "foobar.com/entrypoint:latest") + podmanTest.BuildImage(dockerfile, "foobar.com/entrypoint:latest", "false") session := podmanTest.Podman([]string{"run", "foobar.com/entrypoint:latest", "-i"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -78,7 +78,7 @@ ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] dockerfile := `FROM docker.io/library/alpine:latest ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] ` - podmanTest.BuildImage(dockerfile, "foobar.com/entrypoint:latest") + podmanTest.BuildImage(dockerfile, "foobar.com/entrypoint:latest", "false") session := podmanTest.Podman([]string{"run", "foobar.com/entrypoint:latest", "-i"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -90,7 +90,7 @@ ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] CMD ["-i"] ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] ` - podmanTest.BuildImage(dockerfile, "foobar.com/entrypoint:latest") + podmanTest.BuildImage(dockerfile, "foobar.com/entrypoint:latest", "false") session := podmanTest.Podman([]string{"run", "--entrypoint=uname", "foobar.com/entrypoint:latest"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -102,7 +102,7 @@ ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] CMD ["-i"] ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] ` - podmanTest.BuildImage(dockerfile, "foobar.com/entrypoint:latest") + podmanTest.BuildImage(dockerfile, "foobar.com/entrypoint:latest", "false") session := podmanTest.Podman([]string{"run", "--entrypoint=uname", "foobar.com/entrypoint:latest", "-r"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) |