github.com/stchris/docker@v1.4.2-0.20150106053530-1510a324dbd5/integration-cli/docker_cli_pull_test.go (about)

     1  package main
     2  
     3  import (
     4  	"os/exec"
     5  	"testing"
     6  )
     7  
     8  // FIXME: we need a test for pulling all aliases for an image (issue #8141)
     9  
    10  // pulling an image from the central registry should work
    11  func TestPullImageFromCentralRegistry(t *testing.T) {
    12  	pullCmd := exec.Command(dockerBinary, "pull", "hello-world")
    13  	if out, _, err := runCommandWithOutput(pullCmd); err != nil {
    14  		t.Fatalf("pulling the hello-world image from the registry has failed: %s, %v", out, err)
    15  	}
    16  	logDone("pull - pull hello-world")
    17  }
    18  
    19  // pulling a non-existing image from the central registry should return a non-zero exit code
    20  func TestPullNonExistingImage(t *testing.T) {
    21  	pullCmd := exec.Command(dockerBinary, "pull", "fooblahblah1234")
    22  	if out, _, err := runCommandWithOutput(pullCmd); err == nil {
    23  		t.Fatalf("expected non-zero exit status when pulling non-existing image: %s", out)
    24  	}
    25  	logDone("pull - pull fooblahblah1234 (non-existing image)")
    26  }