summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2019-06-15 06:24:42 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2019-08-01 03:40:29 -0400
commit5370d9cb76a8075332f5ab6a0efef9fba28ba19b (patch)
tree5f537b4a2a70c140aeb6533657c301fc5e9e2b7e /test/e2e
parenta622f8d345b1853401de2e533e9fbf14ef169fa2 (diff)
downloadpodman-5370d9cb76a8075332f5ab6a0efef9fba28ba19b.tar.gz
podman-5370d9cb76a8075332f5ab6a0efef9fba28ba19b.tar.bz2
podman-5370d9cb76a8075332f5ab6a0efef9fba28ba19b.zip
Add new exit codes to rm & rmi for running containers & dependencies
This enables programs and scripts wrapping the podman command to handle 'podman rm' and 'podman rmi' failures caused by paused or running containers or due to images having other child images or dependent containers. These errors are common enough that it makes sense to have a more machine readable way of detecting them than parsing the standard error output. Signed-off-by: Ondrej Zoder <ozoder@redhat.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/checkpoint_test.go2
-rw-r--r--test/e2e/pause_test.go4
-rw-r--r--test/e2e/rm_test.go2
-rw-r--r--test/e2e/rmi_test.go2
4 files changed, 5 insertions, 5 deletions
diff --git a/test/e2e/checkpoint_test.go b/test/e2e/checkpoint_test.go
index 8f3cf5c10..0261acbd9 100644
--- a/test/e2e/checkpoint_test.go
+++ b/test/e2e/checkpoint_test.go
@@ -147,7 +147,7 @@ var _ = Describe("Podman checkpoint", func() {
result = podmanTest.Podman([]string{"rm", cid})
result.WaitWithDefaultTimeout()
- Expect(result.ExitCode()).To(Equal(125))
+ Expect(result.ExitCode()).To(Equal(2))
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
result = podmanTest.Podman([]string{"rm", "-f", cid})
diff --git a/test/e2e/pause_test.go b/test/e2e/pause_test.go
index 01fb6d91b..455f60937 100644
--- a/test/e2e/pause_test.go
+++ b/test/e2e/pause_test.go
@@ -126,7 +126,7 @@ var _ = Describe("Podman pause", func() {
result = podmanTest.Podman([]string{"rm", cid})
result.WaitWithDefaultTimeout()
- Expect(result.ExitCode()).To(Equal(125))
+ Expect(result.ExitCode()).To(Equal(2))
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
Expect(podmanTest.GetContainerStatus()).To(ContainSubstring(pausedState))
@@ -179,7 +179,7 @@ var _ = Describe("Podman pause", func() {
result = podmanTest.Podman([]string{"rm", cid})
result.WaitWithDefaultTimeout()
- Expect(result.ExitCode()).To(Equal(125))
+ Expect(result.ExitCode()).To(Equal(2))
Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
result = podmanTest.Podman([]string{"rm", "-f", cid})
diff --git a/test/e2e/rm_test.go b/test/e2e/rm_test.go
index 2dbabbf6a..8ee7dc750 100644
--- a/test/e2e/rm_test.go
+++ b/test/e2e/rm_test.go
@@ -49,7 +49,7 @@ var _ = Describe("Podman rm", func() {
result := podmanTest.Podman([]string{"rm", cid})
result.WaitWithDefaultTimeout()
- Expect(result.ExitCode()).To(Equal(125))
+ Expect(result.ExitCode()).To(Equal(2))
})
It("podman rm created container", func() {
diff --git a/test/e2e/rmi_test.go b/test/e2e/rmi_test.go
index 1b0329a83..d4e2407ec 100644
--- a/test/e2e/rmi_test.go
+++ b/test/e2e/rmi_test.go
@@ -145,7 +145,7 @@ var _ = Describe("Podman rmi", func() {
session = podmanTest.PodmanNoCache([]string{"rmi", "-f", untaggedImg})
session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Not(Equal(0)))
+ Expect(session.ExitCode()).To(Equal(2))
})
It("podman rmi image that is created from another named imaged", func() {