Browse code

Verify MaximumRetryCount=0 if the restart policy is always.

Signed-off-by: Yuan Sun <sunyuan3@huawei.com>

Yuan Sun authored on 2015/03/30 10:07:58
Showing 1 changed files
... ...
@@ -191,6 +191,16 @@ func TestRestartPolicyAlways(t *testing.T) {
191 191
 		t.Fatalf("Container restart policy name is %s, expected %s", name, "always")
192 192
 	}
193 193
 
194
+	MaximumRetryCount, err := inspectField(id, "HostConfig.RestartPolicy.MaximumRetryCount")
195
+	if err != nil {
196
+		t.Fatal(err)
197
+	}
198
+
199
+	// MaximumRetryCount=0 if the restart policy is always
200
+	if MaximumRetryCount != "0" {
201
+		t.Fatalf("Container Maximum Retry Count is %s, expected %s", MaximumRetryCount, "0")
202
+	}
203
+
194 204
 	logDone("restart - recording restart policy name for --restart=always")
195 205
 }
196 206