Browse code

Add restart policy to restart policy tests

Fixes two tests that tested containers restart policy without
actually having a restart policy

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>

Christopher Jones authored on 2016/11/10 08:13:42
Showing 1 changed files
... ...
@@ -68,7 +68,7 @@ func (s *DockerSuite) TestKillWithSignal(c *check.C) {
68 68
 func (s *DockerSuite) TestKillWithStopSignalWithSameSignalShouldDisableRestartPolicy(c *check.C) {
69 69
 	// Cannot port to Windows - does not support signals int the same way as Linux does
70 70
 	testRequires(c, DaemonIsLinux)
71
-	out, _ := dockerCmd(c, "run", "-d", "--stop-signal=TERM", "busybox", "top")
71
+	out, _ := dockerCmd(c, "run", "-d", "--stop-signal=TERM", "--restart=always", "busybox", "top")
72 72
 	cid := strings.TrimSpace(out)
73 73
 	c.Assert(waitRun(cid), check.IsNil)
74 74
 
... ...
@@ -84,7 +84,7 @@ func (s *DockerSuite) TestKillWithStopSignalWithSameSignalShouldDisableRestartPo
84 84
 func (s *DockerSuite) TestKillWithStopSignalWithDifferentSignalShouldKeepRestartPolicy(c *check.C) {
85 85
 	// Cannot port to Windows - does not support signals int the same way as Linux does
86 86
 	testRequires(c, DaemonIsLinux)
87
-	out, _ := dockerCmd(c, "run", "-d", "--stop-signal=CONT", "busybox", "top")
87
+	out, _ := dockerCmd(c, "run", "-d", "--stop-signal=CONT", "--restart=always", "busybox", "top")
88 88
 	cid := strings.TrimSpace(out)
89 89
 	c.Assert(waitRun(cid), check.IsNil)
90 90