summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/e2e/restart_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/e2e/restart_test.go b/test/e2e/restart_test.go
index 46f950dd2..812ba5ac9 100644
--- a/test/e2e/restart_test.go
+++ b/test/e2e/restart_test.go
@@ -2,6 +2,7 @@ package integration
import (
"os"
+ "time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
@@ -118,4 +119,17 @@ var _ = Describe("Podman restart", func() {
Expect(restartTime.OutputToStringArray()[0]).To(Equal(startTime.OutputToStringArray()[0]))
Expect(restartTime.OutputToStringArray()[1]).To(Not(Equal(startTime.OutputToStringArray()[1])))
})
+
+ It("Podman restart non-stop container with short timeout", func() {
+ session := podmanTest.Podman([]string{"run", "-d", "--name", "test1", "--env", "STOPSIGNAL=SIGKILL", ALPINE, "sleep", "999"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ startTime := time.Now()
+ session = podmanTest.Podman([]string{"restart", "-t", "2", "test1"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ timeSince := time.Since(startTime)
+ Expect(timeSince < 10*time.Second).To(BeTrue())
+ Expect(timeSince > 2*time.Second).To(BeTrue())
+ })
})