summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2019-04-23 13:09:22 -0400
committerMatthew Heon <mheon@redhat.com>2019-04-24 12:51:41 -0400
commit5405b4f279adc2aa8e0532acf921828890f3d258 (patch)
tree6af03616088d91cd4a9cf21e53b2b62994b36aab /test
parent4f69c07996dc3c16b39aa2f97904370d2b9a38ab (diff)
downloadpodman-5405b4f279adc2aa8e0532acf921828890f3d258.tar.gz
podman-5405b4f279adc2aa8e0532acf921828890f3d258.tar.bz2
podman-5405b4f279adc2aa8e0532acf921828890f3d258.zip
Add extra CI tests for stopping all containers
We weren't testing cases where not all containers were running when stop --all ran. Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/stop_test.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/e2e/stop_test.go b/test/e2e/stop_test.go
index 97c9287b9..61c3fedfd 100644
--- a/test/e2e/stop_test.go
+++ b/test/e2e/stop_test.go
@@ -141,4 +141,40 @@ var _ = Describe("Podman stop", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})
+
+ It("podman stop all containers with one stopped", func() {
+ session := podmanTest.RunTopContainer("test1")
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ session2 := podmanTest.RunTopContainer("test1")
+ session2.WaitWithDefaultTimeout()
+ Expect(session2.ExitCode()).To(Equal(0))
+ session3 := podmanTest.Podman([]string("stop", "-l", "-t", "1"))
+ session3.WaitWithDefaultTimeout()
+ Expect(session3.ExitCode()).To(Equal(0))
+ session4 := podmanTest.Podman([]string("stop", "-a", "-t", "1"))
+ session4.WaitWithDefaultTimeout()
+ Expect(session4.ExitCode()).To(Equal(0))
+ finalCtrs := podmanTest.Podman([]string("ps", "-q"))
+ finalCtrs.WaitWithDefaultTimeout()
+ Expect(finalCtrs.ExitCode()).To(Equal(0))
+ Expect(finalCtrs.OutputToString()).To(Equal(""))
+ })
+
+ It("podman stop all containers with one created", func() {
+ session := podmanTest.RunTopContainer("test1")
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ session2 := podmanTest.Podman([]string{"create", ALPINE, "/bin/sh"})
+ session2.WaitWithDefaultTimeout()
+ Expect(session2.ExitCode()).To(Equal(0))
+ session3 := podmanTest.Podman([]string("stop", "-a", "-t", "1"))
+ session3.WaitWithDefaultTimeout()
+ Expect(session3.ExitCode()).To(Equal(0))
+ finalCtrs := podmanTest.Podman([]string("ps", "-q"))
+ finalCtrs.WaitWithDefaultTimeout()
+ Expect(finalCtrs.ExitCode()).To(Equal(0))
+ Expect(finalCtrs.OutputToString()).To(Equal(""))
+ })
+
})