diff options
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/push_test.go | 8 | ||||
-rw-r--r-- | test/e2e/rmi_test.go | 36 |
2 files changed, 38 insertions, 6 deletions
diff --git a/test/e2e/push_test.go b/test/e2e/push_test.go index 028f96424..f783fe418 100644 --- a/test/e2e/push_test.go +++ b/test/e2e/push_test.go @@ -35,20 +35,16 @@ var _ = Describe("Podman push", func() { session = podmanTest.Podman([]string{"rmi", ALPINE}) session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Not(Equal(0))) + Expect(session.ExitCode()).To(Equal(0)) session = podmanTest.Podman([]string{"rmi", "busybox:test"}) session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Not(Equal(0))) - - session = podmanTest.Podman([]string{"rmi", "-f", "busybox:test"}) - session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) }) // push to oci-archive, docker-archive, and dir are tested in pull_test.go - It("podman push to containers/storage", func() { + It("podman push to dir", func() { session := podmanTest.Podman([]string{"push", "--remove-signatures", ALPINE, "dir:/tmp/busybox"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) diff --git a/test/e2e/rmi_test.go b/test/e2e/rmi_test.go index 04346f5ac..67ccc1b95 100644 --- a/test/e2e/rmi_test.go +++ b/test/e2e/rmi_test.go @@ -67,4 +67,40 @@ var _ = Describe("Podman rmi", func() { }) + It("podman rmi tagged image", func() { + setup := podmanTest.Podman([]string{"images", "-q", ALPINE}) + setup.WaitWithDefaultTimeout() + Expect(setup.ExitCode()).To(Equal(0)) + + session := podmanTest.Podman([]string{"tag", "alpine", "foo:bar", "foo"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + result := podmanTest.Podman([]string{"images", "-q", "foo"}) + result.WaitWithDefaultTimeout() + Expect(result.ExitCode()).To(Equal(0)) + + Expect(result.LineInOuputContains(setup.OutputToString())).To(BeTrue()) + }) + + It("podman rmi image with tags by ID cannot be done without force", func() { + setup := podmanTest.Podman([]string{"images", "-q", ALPINE}) + setup.WaitWithDefaultTimeout() + Expect(setup.ExitCode()).To(Equal(0)) + alpineId := setup.OutputToString() + + session := podmanTest.Podman([]string{"tag", "alpine", "foo:bar", "foo"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + // Trying without --force should fail + result := podmanTest.Podman([]string{"rmi", alpineId}) + result.WaitWithDefaultTimeout() + Expect(result.ExitCode()).ToNot(Equal(0)) + + // With --force it should work + resultForce := podmanTest.Podman([]string{"rmi", "-f", alpineId}) + resultForce.WaitWithDefaultTimeout() + Expect(resultForce.ExitCode()).To(Equal(0)) + }) }) |