aboutsummaryrefslogtreecommitdiff
path: root/test/e2e/pause_test.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-10-29 13:53:39 -0500
committerbaude <bbaude@redhat.com>2018-11-01 14:23:55 -0500
commitb559c19c2fa739cf1c8ede50eab8f5acf74f6bf3 (patch)
treeb4d63dfa9418edf29dbbac4b00ae397e93632299 /test/e2e/pause_test.go
parent732a4c814e575ead4b39f00097f22b2f3b64bfc0 (diff)
downloadpodman-b559c19c2fa739cf1c8ede50eab8f5acf74f6bf3.tar.gz
podman-b559c19c2fa739cf1c8ede50eab8f5acf74f6bf3.tar.bz2
podman-b559c19c2fa739cf1c8ede50eab8f5acf74f6bf3.zip
Make kill, pause, and unpause parallel.
Operations like kill, pause, and unpause -- which can operation on one or more containers -- can greatly benefit from parallizing its main job (eq kill). In the case of pauseand unpause, an --all option as was added. pause --all will pause all **running** containers. And unpause --all will unpause all **paused** containers. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'test/e2e/pause_test.go')
-rw-r--r--test/e2e/pause_test.go62
1 files changed, 62 insertions, 0 deletions
diff --git a/test/e2e/pause_test.go b/test/e2e/pause_test.go
index c34964f59..24876b6d6 100644
--- a/test/e2e/pause_test.go
+++ b/test/e2e/pause_test.go
@@ -213,4 +213,66 @@ var _ = Describe("Podman pause", func() {
result.WaitWithDefaultTimeout()
})
+ It("Pause all containers (no containers exist)", func() {
+ result := podmanTest.Podman([]string{"pause", "--all"})
+ result.WaitWithDefaultTimeout()
+ Expect(result.ExitCode()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
+
+ })
+
+ It("Unpause all containers (no paused containers exist)", func() {
+ result := podmanTest.Podman([]string{"unpause", "--all"})
+ result.WaitWithDefaultTimeout()
+ Expect(result.ExitCode()).To(Equal(0))
+ Expect(podmanTest.NumberOfContainersRunning()).To(Equal(0))
+ })
+
+ It("Pause a bunch of running containers", func() {
+ podmanTest.RestoreArtifact(nginx)
+ for i := 0; i < 3; i++ {
+ name := fmt.Sprintf("test%d", i)
+ run := podmanTest.Podman([]string{"run", "-dt", "--name", name, nginx})
+ run.WaitWithDefaultTimeout()
+ Expect(run.ExitCode()).To(Equal(0))
+
+ }
+ running := podmanTest.Podman([]string{"ps", "-q"})
+ running.WaitWithDefaultTimeout()
+ Expect(running.ExitCode()).To(Equal(0))
+ Expect(len(running.OutputToStringArray())).To(Equal(3))
+
+ pause := podmanTest.Podman([]string{"pause", "--all"})
+ pause.WaitWithDefaultTimeout()
+ Expect(pause.ExitCode()).To(Equal(0))
+
+ running = podmanTest.Podman([]string{"ps", "-q"})
+ running.WaitWithDefaultTimeout()
+ Expect(running.ExitCode()).To(Equal(0))
+ Expect(len(running.OutputToStringArray())).To(Equal(0))
+ })
+
+ It("Unpause a bunch of running containers", func() {
+ podmanTest.RestoreArtifact(nginx)
+ for i := 0; i < 3; i++ {
+ name := fmt.Sprintf("test%d", i)
+ run := podmanTest.Podman([]string{"run", "-dt", "--name", name, nginx})
+ run.WaitWithDefaultTimeout()
+ Expect(run.ExitCode()).To(Equal(0))
+
+ }
+ pause := podmanTest.Podman([]string{"pause", "--all"})
+ pause.WaitWithDefaultTimeout()
+ Expect(pause.ExitCode()).To(Equal(0))
+
+ unpause := podmanTest.Podman([]string{"unpause", "--all"})
+ unpause.WaitWithDefaultTimeout()
+ Expect(unpause.ExitCode()).To(Equal(0))
+
+ running := podmanTest.Podman([]string{"ps", "-q"})
+ running.WaitWithDefaultTimeout()
+ Expect(running.ExitCode()).To(Equal(0))
+ Expect(len(running.OutputToStringArray())).To(Equal(3))
+ })
+
})