mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
eeb0097294
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
26 lines
900 B
Go
26 lines
900 B
Go
package main
|
|
|
|
import (
|
|
"os/exec"
|
|
"testing"
|
|
)
|
|
|
|
// FIXME: we need a test for pulling all aliases for an image (issue #8141)
|
|
|
|
// pulling an image from the central registry should work
|
|
func TestPullImageFromCentralRegistry(t *testing.T) {
|
|
pullCmd := exec.Command(dockerBinary, "pull", "scratch")
|
|
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")
|
|
}
|
|
|
|
// 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")
|
|
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)")
|
|
}
|