Add extra CI tests for stopping all containers
We weren't testing cases where not all containers were running
when stop --all ran.
@@ -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(""))
+ })
+
})
