Просмотр исходного кода

Cleanup errorOut resp in nat test

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Jessica Frazelle 10 лет назад
Родитель
Сommit
17842840ec
1 измененных файлов с 13 добавлено и 5 удалено
  1. 13 5
      integration-cli/docker_cli_nat_test.go

+ 13 - 5
integration-cli/docker_cli_nat_test.go

@@ -26,17 +26,24 @@ func TestNetworkNat(t *testing.T) {
 
 	runCmd := exec.Command(dockerBinary, "run", "-dt", "-p", "8080:8080", "busybox", "nc", "-lp", "8080")
 	out, _, err := runCommandWithOutput(runCmd)
-	errorOut(err, t, fmt.Sprintf("run1 failed with errors: %v (%s)", err, out))
+	if err != nil {
+		t.Fatal(out, err)
+	}
 
 	cleanedContainerID := stripTrailingCharacters(out)
 
 	runCmd = exec.Command(dockerBinary, "run", "busybox", "sh", "-c", fmt.Sprintf("echo hello world | nc -w 30 %s 8080", ifaceIP))
 	out, _, err = runCommandWithOutput(runCmd)
-	errorOut(err, t, fmt.Sprintf("run2 failed with errors: %v (%s)", err, out))
+	if err != nil {
+		t.Fatal(out, err)
+	}
 
 	runCmd = exec.Command(dockerBinary, "logs", cleanedContainerID)
 	out, _, err = runCommandWithOutput(runCmd)
-	errorOut(err, t, fmt.Sprintf("failed to retrieve logs for container: %v %v", cleanedContainerID, err))
+	if err != nil {
+		t.Fatalf("failed to retrieve logs for container: %s, %v", out, err)
+	}
+
 	out = strings.Trim(out, "\r\n")
 
 	if expected := "hello world"; out != expected {
@@ -44,8 +51,9 @@ func TestNetworkNat(t *testing.T) {
 	}
 
 	killCmd := exec.Command(dockerBinary, "kill", cleanedContainerID)
-	out, _, err = runCommandWithOutput(killCmd)
-	errorOut(err, t, fmt.Sprintf("failed to kill container: %v %v", out, err))
+	if out, _, err = runCommandWithOutput(killCmd); err != nil {
+		t.Fatalf("failed to kill container: %s, %v", out, err)
+	}
 	deleteAllContainers()
 
 	logDone("network - make sure nat works through the host")