From eeb009729430f0858f56be37011325f3f9486386 Mon Sep 17 00:00:00 2001 From: Jessica Frazelle Date: Tue, 14 Oct 2014 14:09:40 -0700 Subject: [PATCH] Cleanup errorOut resp pull tests Docker-DCO-1.1-Signed-off-by: Jessica Frazelle (github: jfrazelle) --- integration-cli/docker_cli_pull_test.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/integration-cli/docker_cli_pull_test.go b/integration-cli/docker_cli_pull_test.go index cadabde815..7ad6f13710 100644 --- a/integration-cli/docker_cli_pull_test.go +++ b/integration-cli/docker_cli_pull_test.go @@ -1,7 +1,6 @@ package main import ( - "fmt" "os/exec" "testing" ) @@ -11,11 +10,8 @@ import ( // pulling an image from the central registry should work func TestPullImageFromCentralRegistry(t *testing.T) { pullCmd := exec.Command(dockerBinary, "pull", "scratch") - out, exitCode, err := runCommandWithOutput(pullCmd) - errorOut(err, t, fmt.Sprintf("%s %s", out, err)) - - if err != nil || exitCode != 0 { - t.Fatal("pulling the scratch image from the registry has failed") + if out, _, err := runCommandWithOutput(pullCmd); err != nil { + t.Fatal("pulling the scratch image from the registry has failed: %s, %v", out, err) } logDone("pull - pull scratch") } @@ -23,10 +19,8 @@ func TestPullImageFromCentralRegistry(t *testing.T) { // pulling a non-existing image from the central registry should return a non-zero exit code func TestPullNonExistingImage(t *testing.T) { pullCmd := exec.Command(dockerBinary, "pull", "fooblahblah1234") - _, exitCode, err := runCommandWithOutput(pullCmd) - - if err == nil || exitCode == 0 { - t.Fatal("expected non-zero exit status when pulling non-existing image") + if out, _, err := runCommandWithOutput(pullCmd); err == nil { + t.Fatal("expected non-zero exit status when pulling non-existing image: %s", out) } logDone("pull - pull fooblahblah1234 (non-existing image)") }