mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-05 13:11:30 +00:00
Merge pull request #12400 from coolljt0725/kill_all_containers_on_daemon_shutdown
Ensure all the running containers are killed on daemon shutdown
This commit is contained in:
@@ -1166,3 +1166,19 @@ func (s *DockerDaemonSuite) TestRunContainerWithBridgeNone(c *check.C) {
|
||||
c.Assert(strings.Contains(out, "eth0"), check.Equals, false,
|
||||
check.Commentf("There shouldn't be eth0 in container when network is disabled: %s", out))
|
||||
}
|
||||
|
||||
func (s *DockerDaemonSuite) TestDaemonRestartWithContainerRunning(t *check.C) {
|
||||
if err := s.d.StartWithBusybox(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if out, err := s.d.Cmd("run", "-ti", "-d", "--name", "test", "busybox"); err != nil {
|
||||
t.Fatal(out, err)
|
||||
}
|
||||
if err := s.d.Restart(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// Container 'test' should be removed without error
|
||||
if out, err := s.d.Cmd("rm", "test"); err != nil {
|
||||
t.Fatal(out, err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user