Pārlūkot izejas kodu

verify MaximumRetryCount for container restart policy

Signed-off-by: s00318865 <sunyuan3@huawei.com>
s00318865 10 gadi atpakaļ
vecāks
revīzija
173642c866
1 mainītis faili ar 7 papildinājumiem un 0 dzēšanām
  1. 7 0
      integration-cli/docker_cli_run_test.go

+ 7 - 0
integration-cli/docker_cli_run_test.go

@@ -3229,6 +3229,13 @@ func TestRunRestartMaxRetries(t *testing.T) {
 	if count != "3" {
 	if count != "3" {
 		t.Fatalf("Container was restarted %s times, expected %d", count, 3)
 		t.Fatalf("Container was restarted %s times, expected %d", count, 3)
 	}
 	}
+	MaximumRetryCount, err := inspectField(id, "HostConfig.RestartPolicy.MaximumRetryCount")
+	if err != nil {
+		t.Fatal(err)
+	}
+	if MaximumRetryCount != "3" {
+		t.Fatalf("Container Maximum Retry Count is %s, expected %s", MaximumRetryCount, "3")
+	}
 	logDone("run - test max-retries for --restart")
 	logDone("run - test max-retries for --restart")
 }
 }