summaryrefslogtreecommitdiff
path: root/integration-cli/docker_cli_pull_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'integration-cli/docker_cli_pull_test.go')
-rw-r--r--integration-cli/docker_cli_pull_test.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/integration-cli/docker_cli_pull_test.go b/integration-cli/docker_cli_pull_test.go
new file mode 100644
index 0000000000..13b443f3d6
--- /dev/null
+++ b/integration-cli/docker_cli_pull_test.go
@@ -0,0 +1,30 @@
+package main
+
+import (
+ "fmt"
+ "os/exec"
+ "testing"
+)
+
+// pulling an image from the central registry should work
+func TestPullImageFromCentralRegistry(t *testing.T) {
+ pullCmd := exec.Command(dockerBinary, "pull", "busybox")
+ out, exitCode, err := runCommandWithOutput(pullCmd)
+ errorOut(err, t, fmt.Sprintf("%s %s", out, err))
+
+ if err != nil || exitCode != 0 {
+ t.Fatal("pulling the busybox image from the registry has failed")
+ }
+ logDone("pull - pull busybox")
+}
+
+// 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")
+ }
+ logDone("pull - pull fooblahblah1234 (non-existing image)")
+}