summaryrefslogtreecommitdiff
path: root/test/e2e/restart_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/restart_test.go')
-rw-r--r--test/e2e/restart_test.go21
1 files changed, 18 insertions, 3 deletions
diff --git a/test/e2e/restart_test.go b/test/e2e/restart_test.go
index 5c914a367..1daf63a0e 100644
--- a/test/e2e/restart_test.go
+++ b/test/e2e/restart_test.go
@@ -3,7 +3,6 @@
package integration
import (
- "fmt"
"os"
"time"
@@ -25,14 +24,15 @@ var _ = Describe("Podman restart", func() {
os.Exit(1)
}
podmanTest = PodmanTestCreate(tempdir)
+ podmanTest.Setup()
podmanTest.RestoreAllArtifacts()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentGinkgoTestDescription()
- timedResult := fmt.Sprintf("Test: %s completed in %f seconds", f.TestText, f.Duration.Seconds())
- GinkgoWriter.Write([]byte(timedResult))
+ processTestResult(f)
+
})
It("Podman restart bogus container", func() {
@@ -90,6 +90,21 @@ var _ = Describe("Podman restart", func() {
Expect(restartTime.OutputToString()).To(Not(Equal(startTime.OutputToString())))
})
+ It("Podman container restart running container", func() {
+ _ = podmanTest.RunTopContainer("test1")
+ ok := WaitForContainer(podmanTest)
+ Expect(ok).To(BeTrue())
+ startTime := podmanTest.Podman([]string{"container", "inspect", "--format='{{.State.StartedAt}}'", "test1"})
+ startTime.WaitWithDefaultTimeout()
+
+ session := podmanTest.Podman([]string{"container", "restart", "test1"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ restartTime := podmanTest.Podman([]string{"container", "inspect", "--format='{{.State.StartedAt}}'", "test1"})
+ restartTime.WaitWithDefaultTimeout()
+ Expect(restartTime.OutputToString()).To(Not(Equal(startTime.OutputToString())))
+ })
+
It("Podman restart multiple containers", func() {
_, exitCode, _ := podmanTest.RunLsContainer("test1")
Expect(exitCode).To(Equal(0))