Revert all but TestPullImageFromCentralRegistry changes

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
This commit is contained in:
Arnaud Porterie 2015-03-24 16:27:35 -07:00
parent 5d70a97b1f
commit 8900ae2928
7 changed files with 1 additions and 91 deletions

View file

@ -164,9 +164,6 @@ RUN set -x \
&& (cd /go/src/github.com/BurntSushi/toml && git checkout -q $TOMLV_COMMIT) \
&& go install -v github.com/BurntSushi/toml/cmd/tomlv
COPY contrib/download-frozen-image.sh /go/src/github.com/docker/docker/contrib/
RUN ./contrib/download-frozen-image.sh ./integration-cli/registry registry
# Wrap all commands in the "docker-in-docker" script to allow nested containers
ENTRYPOINT ["hack/dind"]

View file

@ -1,10 +0,0 @@
#!/bin/bash
set -e
if ! docker inspect registry > /dev/null; then
if [ -d /docker-registry ]; then
( set -x; docker build -t registry /docker-registry )
else
( set -x; tar -cC integration-cli/registry . | docker load & )
fi
fi

View file

@ -19,7 +19,6 @@ if [ -z "$DOCKER_TEST_HOST" ]; then
export DOCKER_HOST="unix://$(cd "$DEST" && pwd)/docker.sock" # "pwd" tricks to make sure $DEST is an absolute path, not a relative one
( set -x; exec \
docker --daemon --debug \
--insecure-registry 0.0.0.0:5000 \
--host "$DOCKER_HOST" \
--storage-driver "$DOCKER_GRAPHDRIVER" \
--exec-driver "$DOCKER_EXECDRIVER" \

View file

@ -18,7 +18,6 @@ bundle_test_integration_cli() {
if ! {
source "$(dirname "$BASH_SOURCE")/.ensure-frozen-images"
source "$(dirname "$BASH_SOURCE")/.ensure-httpserver"
source "$(dirname "$BASH_SOURCE")/.ensure-registry"
source "$(dirname "$BASH_SOURCE")/.ensure-emptyfs"
bundle_test_integration_cli

View file

@ -96,33 +96,6 @@ func TestPullImageFromCentralRegistry(t *testing.T) {
logDone("pull - pull hello-world")
}
// pulling an image from the local registry should work
func TestPullImageFromlocalRegistry(t *testing.T) {
defer deleteAllContainers()
if err := startRegistryV1(); err != nil {
t.Fatal(err)
}
repoName := privateV1RegistryURL
defer deleteImages(repoName)
repo := fmt.Sprintf("%v/%v:%v", repoName, "busybox", "latest")
if out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "tag", "busybox", repo)); err != nil {
t.Fatalf("Failed to tag image %v: error %v, output %q", repo, err, out)
}
defer deleteImages(repo)
if out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "push", repo)); err != nil {
t.Fatalf("Failed to push image %v: error %v, output %q", repo, err, string(out))
}
pullCmd := exec.Command(dockerBinary, "pull", repo)
if out, _, err := runCommandWithOutput(pullCmd); err != nil {
t.Fatalf("pulling the hello-world image from the registry has failed: %s, %v", out, err)
}
logDone("pull - pull local hello-world")
}
// 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")

View file

@ -14,8 +14,7 @@ var (
registryImageName = "registry"
// the private registry to use for tests
privateRegistryURL = "127.0.0.1:5000"
privateV1RegistryURL = "0.0.0.0:5000"
privateRegistryURL = "127.0.0.1:5000"
dockerBasePath = "/var/lib/docker"
execDriverPath = dockerBasePath + "/execdriver/native"

View file

@ -7,9 +7,7 @@ import (
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
"time"
)
const v2binary = "registry-v2"
@ -71,48 +69,3 @@ func (r *testRegistryV2) Close() {
r.cmd.Process.Kill()
os.RemoveAll(r.dir)
}
func pingV1(ip string) error {
// We always ping through HTTP for our test registry.
resp, err := http.Get(fmt.Sprintf("http://%s/v1/search", ip))
if err != nil {
return err
}
if resp.StatusCode != 200 {
return fmt.Errorf("registry ping replied with an unexpected status code %d", resp.StatusCode)
}
return nil
}
func startRegistryV1() error {
//wait for registry image to be available
for i := 0; i < 10; i++ {
imagesCmd := exec.Command(dockerBinary, "images")
out, _, err := runCommandWithOutput(imagesCmd)
if err != nil {
return err
}
if strings.Contains(out, "registry") {
break
}
time.Sleep(60000 * time.Millisecond)
if i == 10 {
fmt.Errorf("No registry image is found to start the regictry V1 services")
}
}
if out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "run", "--name", "regserver", "-d", "-p", "5000:5000", "registry", "docker-registry")); err != nil {
fmt.Errorf("Failed to start registry: error %v, output %q", err, out)
}
ip := privateV1RegistryURL
//wait until registry server is available
for i := 0; i < 10; i++ {
if err := pingV1(ip); err == nil {
return nil
} else if i == 10 && err != nil {
return err
}
time.Sleep(2000 * time.Millisecond)
}
return nil
}