summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/e2e/stop_test.go12
-rw-r--r--test/system/050-stop.bats7
2 files changed, 19 insertions, 0 deletions
diff --git a/test/e2e/stop_test.go b/test/e2e/stop_test.go
index 7f178d719..fb8f92e0f 100644
--- a/test/e2e/stop_test.go
+++ b/test/e2e/stop_test.go
@@ -181,6 +181,18 @@ var _ = Describe("Podman stop", func() {
Expect(strings.TrimSpace(finalCtrs.OutputToString())).To(Equal(""))
})
+ It("podman stop container --timeout Warning", func() {
+ SkipIfRemote("warning will happen only on server side")
+ session := podmanTest.Podman([]string{"run", "-d", "--name", "test5", ALPINE, "sleep", "100"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ session = podmanTest.Podman([]string{"stop", "--timeout", "1", "test5"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ warning := session.ErrorToString()
+ Expect(warning).To(ContainSubstring("StopSignal SIGTERM failed to stop container test5 in 1 seconds, resorting to SIGKILL"))
+ })
+
It("podman stop latest containers", func() {
SkipIfRemote("--latest flag n/a")
session := podmanTest.RunTopContainer("test1")
diff --git a/test/system/050-stop.bats b/test/system/050-stop.bats
index d809507a5..e049da518 100644
--- a/test/system/050-stop.bats
+++ b/test/system/050-stop.bats
@@ -166,4 +166,11 @@ load helpers
is "$output" "137" "Exit code of killed container"
}
+@test "podman stop -t 1 Generate warning" {
+ skip_if_remote "warning only happens on server side"
+ run_podman run --rm --name stopme -d $IMAGE sleep 100
+ run_podman stop -t 1 stopme
+ is "$output" ".*StopSignal SIGTERM failed to stop container stopme in 1 seconds, resorting to SIGKILL" "stopping container should print warning"
+}
+
# vim: filetype=sh