summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-11-01 12:19:14 -0700
committerGitHub <noreply@github.com>2018-11-01 12:19:14 -0700
commit732a4c814e575ead4b39f00097f22b2f3b64bfc0 (patch)
tree1abed97a2cff7cc2b78c183986be959ba8f2a992 /test
parent26330aa99577b36afff9ff36a86d54978195ab2e (diff)
parent2011782d9d52958546e481f84892d00a548b9e12 (diff)
downloadpodman-732a4c814e575ead4b39f00097f22b2f3b64bfc0.tar.gz
podman-732a4c814e575ead4b39f00097f22b2f3b64bfc0.tar.bz2
podman-732a4c814e575ead4b39f00097f22b2f3b64bfc0.zip
Merge pull request #1738 from baude/pararestart
Make restart parallel and add --all
Diffstat (limited to 'test')
-rw-r--r--test/e2e/restart_test.go40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/e2e/restart_test.go b/test/e2e/restart_test.go
index d2fc35485..eca2bbcda 100644
--- a/test/e2e/restart_test.go
+++ b/test/e2e/restart_test.go
@@ -136,4 +136,44 @@ var _ = Describe("Podman restart", func() {
Expect(timeSince < 10*time.Second).To(BeTrue())
Expect(timeSince > 2*time.Second).To(BeTrue())
})
+
+ It("Podman restart --all", func() {
+ _, exitCode, _ := podmanTest.RunLsContainer("test1")
+ Expect(exitCode).To(Equal(0))
+
+ test2 := podmanTest.RunTopContainer("test2")
+ test2.WaitWithDefaultTimeout()
+ Expect(test2.ExitCode()).To(Equal(0))
+
+ startTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"})
+ startTime.WaitWithDefaultTimeout()
+
+ session := podmanTest.Podman([]string{"restart", "-all"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"})
+ restartTime.WaitWithDefaultTimeout()
+ Expect(restartTime.OutputToStringArray()[0]).To(Not(Equal(startTime.OutputToStringArray()[0])))
+ Expect(restartTime.OutputToStringArray()[1]).To(Not(Equal(startTime.OutputToStringArray()[1])))
+ })
+
+ It("Podman restart --all --running", func() {
+ _, exitCode, _ := podmanTest.RunLsContainer("test1")
+ Expect(exitCode).To(Equal(0))
+
+ test2 := podmanTest.RunTopContainer("test2")
+ test2.WaitWithDefaultTimeout()
+ Expect(test2.ExitCode()).To(Equal(0))
+
+ startTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"})
+ startTime.WaitWithDefaultTimeout()
+
+ session := podmanTest.Podman([]string{"restart", "-a", "--running"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"})
+ restartTime.WaitWithDefaultTimeout()
+ Expect(restartTime.OutputToStringArray()[0]).To(Equal(startTime.OutputToStringArray()[0]))
+ Expect(restartTime.OutputToStringArray()[1]).To(Not(Equal(startTime.OutputToStringArray()[1])))
+ })
})