summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-02-01 08:47:54 -0500
committerGitHub <noreply@github.com>2021-02-01 08:47:54 -0500
commit81a3ba36ae8d22b767e620c0b4c804764340de52 (patch)
tree55e0c5eb89271652000572e3fc781d7582b3e42a /test
parentb045c173756dddcedf6a99a70f520bf423072826 (diff)
parent073f76c1327d296360caa04ef7d751dd00ef5a53 (diff)
downloadpodman-81a3ba36ae8d22b767e620c0b4c804764340de52.tar.gz
podman-81a3ba36ae8d22b767e620c0b4c804764340de52.tar.bz2
podman-81a3ba36ae8d22b767e620c0b4c804764340de52.zip
Merge pull request #9051 from rhatdan/rm
Switch podman stop/kill/wait handlers to use abi
Diffstat (limited to 'test')
-rw-r--r--test/e2e/kill_test.go16
-rw-r--r--test/e2e/restart_test.go22
-rw-r--r--test/e2e/stop_test.go41
3 files changed, 76 insertions, 3 deletions
diff --git a/test/e2e/kill_test.go b/test/e2e/kill_test.go
index 8b31cae72..c1c1b003e 100644
--- a/test/e2e/kill_test.go
+++ b/test/e2e/kill_test.go
@@ -167,4 +167,20 @@ var _ = Describe("Podman kill", func() {
Expect(wait.ExitCode()).To(BeZero())
})
+ It("podman stop --all", func() {
+ session := podmanTest.RunTopContainer("")
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
+
+ session = podmanTest.RunTopContainer("")
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainersRunning()).To(Equal(2))
+
+ session = podmanTest.Podman([]string{"kill", "--all"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
+ })
})
diff --git a/test/e2e/restart_test.go b/test/e2e/restart_test.go
index 584ccd22b..bcaab8947 100644
--- a/test/e2e/restart_test.go
+++ b/test/e2e/restart_test.go
@@ -225,4 +225,26 @@ var _ = Describe("Podman restart", func() {
// line count should be equal
Expect(beforeRestart.OutputToString()).To(Equal(afterRestart.OutputToString()))
})
+
+ It("podman restart --all", func() {
+ session := podmanTest.RunTopContainer("")
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
+
+ session = podmanTest.RunTopContainer("")
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainersRunning()).To(Equal(2))
+
+ session = podmanTest.Podman([]string{"stop", "--all"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"restart", "--all"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainersRunning()).To(Equal(2))
+ })
})
diff --git a/test/e2e/stop_test.go b/test/e2e/stop_test.go
index c25709a63..750d38ffb 100644
--- a/test/e2e/stop_test.go
+++ b/test/e2e/stop_test.go
@@ -164,13 +164,14 @@ var _ = Describe("Podman stop", func() {
})
It("podman stop container --timeout", func() {
- session := podmanTest.RunTopContainer("test5")
+ session := podmanTest.Podman([]string{"run", "-d", "--name", "test5", ALPINE, "sleep", "100"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
cid1 := session.OutputToString()
-
session = podmanTest.Podman([]string{"stop", "--timeout", "1", "test5"})
- session.WaitWithDefaultTimeout()
+ // Without timeout container stops in 10 seconds
+ // If not stopped in 5 seconds, then --timeout did not work
+ session.Wait(5)
Expect(session.ExitCode()).To(Equal(0))
output := session.OutputToString()
Expect(output).To(ContainSubstring(cid1))
@@ -307,4 +308,38 @@ var _ = Describe("Podman stop", func() {
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(125))
})
+
+ It("podman stop --all", func() {
+ session := podmanTest.RunTopContainer("")
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
+
+ session = podmanTest.RunTopContainer("")
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainersRunning()).To(Equal(2))
+
+ session = podmanTest.Podman([]string{"stop", "--all"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
+ })
+
+ It("podman stop --ignore", func() {
+ session := podmanTest.RunTopContainer("")
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ cid := session.OutputToString()
+ Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1))
+
+ session = podmanTest.Podman([]string{"stop", "bogus", cid})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(125))
+
+ session = podmanTest.Podman([]string{"stop", "--ignore", "bogus", cid})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
+ })
})