mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
test: daemon restart with containers running with restart always policy
manually stopped If a container is running with a restart policy of always and it's manually stopped, then on daemon restart it will be running. Signed-off-by: Antonio Murdaca <runcom@linux.com>
This commit is contained in:
parent
8f2dca5386
commit
af59c80b4a
1 changed files with 23 additions and 0 deletions
|
@ -1527,3 +1527,26 @@ func teardownV6() error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *DockerDaemonSuite) TestDaemonRestartWithContainerWithRestartPolicyAlways(c *check.C) {
|
||||
c.Assert(s.d.StartWithBusybox(), check.IsNil)
|
||||
|
||||
out, err := s.d.Cmd("run", "-d", "--restart", "always", "busybox", "top")
|
||||
c.Assert(err, check.IsNil)
|
||||
id := strings.TrimSpace(out)
|
||||
|
||||
_, err = s.d.Cmd("stop", id)
|
||||
c.Assert(err, check.IsNil)
|
||||
_, err = s.d.Cmd("wait", id)
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
out, err = s.d.Cmd("ps", "-q")
|
||||
c.Assert(err, check.IsNil)
|
||||
c.Assert(out, check.Equals, "")
|
||||
|
||||
c.Assert(s.d.Restart(), check.IsNil)
|
||||
|
||||
out, err = s.d.Cmd("ps", "-q")
|
||||
c.Assert(err, check.IsNil)
|
||||
c.Assert(strings.TrimSpace(out), check.Equals, id[:12])
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue