Browse code

Cleanup errorOut resp in links test

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)

Jessica Frazelle authored on 2014/10/15 04:50:35
Showing 1 changed files
... ...
@@ -1,7 +1,6 @@
1 1
 package main
2 2
 
3 3
 import (
4
-	"fmt"
5 4
 	"io/ioutil"
6 5
 	"os"
7 6
 	"os/exec"
... ...
@@ -14,7 +13,9 @@ import (
14 14
 func TestLinksEtcHostsRegularFile(t *testing.T) {
15 15
 	runCmd := exec.Command(dockerBinary, "run", "--net=host", "busybox", "ls", "-la", "/etc/hosts")
16 16
 	out, _, _, err := runCommandWithStdoutStderr(runCmd)
17
-	errorOut(err, t, out)
17
+	if err != nil {
18
+		t.Fatal(out, err)
19
+	}
18 20
 
19 21
 	if !strings.HasPrefix(out, "-") {
20 22
 		t.Errorf("/etc/hosts should be a regular file")
... ...
@@ -28,7 +29,9 @@ func TestLinksEtcHostsRegularFile(t *testing.T) {
28 28
 func TestLinksEtcHostsContentMatch(t *testing.T) {
29 29
 	runCmd := exec.Command(dockerBinary, "run", "--net=host", "busybox", "cat", "/etc/hosts")
30 30
 	out, _, _, err := runCommandWithStdoutStderr(runCmd)
31
-	errorOut(err, t, out)
31
+	if err != nil {
32
+		t.Fatal(out, err)
33
+	}
32 34
 
33 35
 	hosts, err := ioutil.ReadFile("/etc/hosts")
34 36
 	if os.IsNotExist(err) {
... ...
@@ -51,7 +54,7 @@ func TestLinksPingUnlinkedContainers(t *testing.T) {
51 51
 	if exitCode == 0 {
52 52
 		t.Fatal("run ping did not fail")
53 53
 	} else if exitCode != 1 {
54
-		errorOut(err, t, fmt.Sprintf("run ping failed with errors: %v", err))
54
+		t.Fatalf("run ping failed with errors: %v", err)
55 55
 	}
56 56
 
57 57
 	logDone("links - ping unlinked container")