Cleanup errorOut resp in links test

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
This commit is contained in:
Jessica Frazelle 2014-10-14 12:50:35 -07:00
parent f7b3a6b292
commit 7d38ae7041
1 changed files with 7 additions and 4 deletions

View File

@ -1,7 +1,6 @@
package main
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
@ -14,7 +13,9 @@ import (
func TestLinksEtcHostsRegularFile(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "--net=host", "busybox", "ls", "-la", "/etc/hosts")
out, _, _, err := runCommandWithStdoutStderr(runCmd)
errorOut(err, t, out)
if err != nil {
t.Fatal(out, err)
}
if !strings.HasPrefix(out, "-") {
t.Errorf("/etc/hosts should be a regular file")
@ -28,7 +29,9 @@ func TestLinksEtcHostsRegularFile(t *testing.T) {
func TestLinksEtcHostsContentMatch(t *testing.T) {
runCmd := exec.Command(dockerBinary, "run", "--net=host", "busybox", "cat", "/etc/hosts")
out, _, _, err := runCommandWithStdoutStderr(runCmd)
errorOut(err, t, out)
if err != nil {
t.Fatal(out, err)
}
hosts, err := ioutil.ReadFile("/etc/hosts")
if os.IsNotExist(err) {
@ -51,7 +54,7 @@ func TestLinksPingUnlinkedContainers(t *testing.T) {
if exitCode == 0 {
t.Fatal("run ping did not fail")
} else if exitCode != 1 {
errorOut(err, t, fmt.Sprintf("run ping failed with errors: %v", err))
t.Fatalf("run ping failed with errors: %v", err)
}
logDone("links - ping unlinked container")