Move kill health test to integration

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit f8aef6a92f5961f2615ada37b7d108774a0821e0)
Signed-off-by: Dani Louca <dani.louca@docker.com>
Upstream-commit: 4cad9dd9a496bc186d8990d0135145fb3234ccc1
Component: engine
This commit is contained in:
Brian Goff
2019-08-14 16:44:11 -04:00
committed by Dani Louca
parent a5049e1961
commit 7bdaea25a0
2 changed files with 29 additions and 26 deletions
@@ -165,29 +165,3 @@ ENTRYPOINT /bin/sh -c "sleep 600"`))
waitForHealthStatus(c, name, "starting", "healthy")
}
// GitHub #37263
func (s *DockerSuite) TestHealthKillContainer(c *check.C) {
testRequires(c, DaemonIsLinux) // busybox doesn't work on Windows
imageName := "testhealth"
buildImageSuccessfully(c, imageName, build.WithDockerfile(`FROM busybox
HEALTHCHECK --interval=1s --timeout=5s --retries=5 CMD /bin/sh -c "sleep 1"
ENTRYPOINT /bin/sh -c "sleep 600"`))
name := "test_health_kill"
dockerCmd(c, "run", "-d", "--name", name, imageName)
defer func() {
dockerCmd(c, "rm", "-f", name)
dockerCmd(c, "rmi", imageName)
}()
// Start
dockerCmd(c, "start", name)
waitForHealthStatus(c, name, "starting", "healthy")
dockerCmd(c, "kill", "-s", "SIGINT", name)
out, _ := dockerCmd(c, "inspect", "--format={{.State.Health.Status}}", name)
c.Check(out, checker.Equals, "healthy\n")
}