update vendor

Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
Jess Frazelle 2018-09-25 12:27:46 -04:00
parent 19a32db84d
commit 94d1cfbfbf
No known key found for this signature in database
GPG key ID: 18F3685C0022BFF3
10501 changed files with 2307943 additions and 29279 deletions

11
vendor/github.com/docker/cli/scripts/test/e2e/entry generated vendored Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -eu -o pipefail
if [[ -n "${REMOTE_DAEMON-}" ]]; then
# Run tests against a remote daemon.
./scripts/test/e2e/run fetch-images
./scripts/test/e2e/run test "${DOCKER_HOST-}"
else
# Run tests against dind.
./scripts/test/e2e/wrapper
fi

53
vendor/github.com/docker/cli/scripts/test/e2e/load-image generated vendored Executable file
View file

@ -0,0 +1,53 @@
#!/usr/bin/env bash
# Fetch images used for e2e testing
set -eu -o pipefail
alpine_src=alpine@sha256:f006ecbb824d87947d0b51ab8488634bf69fe4094959d935c0c103f4820a417d
alpine_dest=registry:5000/alpine:3.6
busybox_src=busybox@sha256:3e8fa85ddfef1af9ca85a5cfb714148956984e02f00bec3f7f49d3925a91e0e7
busybox_dest=registry:5000/busybox:1.27.2
function fetch_tag_image {
local src=$1
local dest=$2
docker pull "$src"
docker tag "$src" "$dest"
}
function push_image {
local img=$1
docker push "$img"
}
cmd=${1-}
case "$cmd" in
alpine)
fetch_tag_image "$alpine_src" "$alpine_dest"
push_image "$alpine_dest"
exit
;;
busybox)
fetch_tag_image "$busybox_src" "$busybox_dest"
push_image "$busybox_dest"
exit
;;
all|"")
fetch_tag_image "$alpine_src" "$alpine_dest"
push_image "$alpine_dest"
fetch_tag_image "$busybox_src" "$busybox_dest"
push_image "$busybox_dest"
exit
;;
fetch-only)
fetch_tag_image "$alpine_src" "$alpine_dest"
fetch_tag_image "$busybox_src" "$busybox_dest"
exit
;;
*)
echo "Unknown command: $cmd"
echo "Usage:"
echo " $0 [alpine | busybox | all | fetch-only]"
exit 1
;;
esac

107
vendor/github.com/docker/cli/scripts/test/e2e/run generated vendored Executable file
View file

@ -0,0 +1,107 @@
#!/usr/bin/env bash
# Run integration tests against the latest docker-ce dind
set -eu -o pipefail
function container_ip {
local cid=$1
local network=$2
docker inspect \
-f "{{.NetworkSettings.Networks.${network}.IPAddress}}" "$cid"
}
function fetch_images {
./scripts/test/e2e/load-image fetch-only
}
function setup {
local project=$1
local file=$2
test "${DOCKERD_EXPERIMENTAL:-}" -eq "1" && file="${file}:./e2e/compose-env.experimental.yaml"
COMPOSE_PROJECT_NAME=$project COMPOSE_FILE=$file docker-compose up --build -d >&2
local network="${project}_default"
# TODO: only run if inside a container
docker network connect "$network" "$(hostname)"
engine_ip="$(container_ip "${project}_engine_1" "$network")"
engine_host="tcp://$engine_ip:2375"
(
export DOCKER_HOST="$engine_host"
timeout 200 ./scripts/test/e2e/wait-on-daemon
./scripts/test/e2e/load-image
is_swarm_enabled || docker swarm init
) >&2
echo "$engine_host"
}
function is_swarm_enabled {
docker info 2> /dev/null | grep -q 'Swarm: active'
}
function cleanup {
local project=$1
local network="${project}_default"
docker network disconnect "$network" "$(hostname)"
COMPOSE_PROJECT_NAME=$1 COMPOSE_FILE=$2 docker-compose down -v --rmi local >&2
}
function runtests {
local engine_host=$1
# shellcheck disable=SC2086
env -i \
TEST_DOCKER_HOST="$engine_host" \
TEST_DOCKER_CERT_PATH="${DOCKER_CERT_PATH-}" \
TEST_KUBECONFIG="${KUBECONFIG-}" \
TEST_REMOTE_DAEMON="${REMOTE_DAEMON-}" \
TEST_SKIP_PLUGIN_TESTS="${SKIP_PLUGIN_TESTS-}" \
GOPATH="$GOPATH" \
PATH="$PWD/build/" \
"$(which go)" test -v ./e2e/... ${TESTFLAGS-}
}
export unique_id="${E2E_UNIQUE_ID:-cliendtoendsuite}"
compose_env_file=./e2e/compose-env.yaml
cmd=${1-}
case "$cmd" in
setup)
setup "$unique_id" "$compose_env_file"
exit
;;
cleanup)
cleanup "$unique_id" "$compose_env_file"
exit
;;
fetch-images)
fetch_images
exit
;;
test)
engine_host=${2-}
if [[ -z "${engine_host}" ]]; then
echo "missing parameter docker engine host"
echo "Usage: $0 test ENGINE_HOST"
exit 3
fi
runtests "$engine_host"
;;
run|"")
engine_host="$(setup "$unique_id" "$compose_env_file")"
testexit=0
runtests "$engine_host" || testexit=$?
cleanup "$unique_id" "$compose_env_file"
exit $testexit
;;
shell)
$SHELL
;;
*)
echo "Unknown command: $cmd"
echo "Usage: "
echo " $0 [setup | cleanup | test | run] [engine_host]"
exit 1
;;
esac

View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -eu -o pipefail
echo "Waiting for docker daemon to become available at $DOCKER_HOST"
while ! docker version > /dev/null; do
sleep 0.3
done
docker version

16
vendor/github.com/docker/cli/scripts/test/e2e/wrapper generated vendored Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Setup, run and teardown e2e test suite in containers.
set -eu -o pipefail
engine_host=$(./scripts/test/e2e/run setup)
testexit=0
test_cmd="test"
if [[ -n "${TEST_DEBUG-}" ]]; then
test_cmd="shell"
fi
./scripts/test/e2e/run "$test_cmd" "$engine_host" || testexit="$?"
./scripts/test/e2e/run cleanup
exit "$testexit"

5
vendor/github.com/docker/cli/scripts/test/engine/entry generated vendored Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -eu -o pipefail
# TODO fetch images?
./scripts/test/engine/wrapper

107
vendor/github.com/docker/cli/scripts/test/engine/run generated vendored Executable file
View file

@ -0,0 +1,107 @@
#!/usr/bin/env bash
# Run engine specific integration tests against the latest containerd-in-docker
set -eu -o pipefail
function container_ip {
local cid=$1
local network=$2
docker inspect \
-f "{{.NetworkSettings.Networks.${network}.IPAddress}}" "$cid"
}
function fetch_images {
## TODO - not yet implemented
./scripts/test/engine/load-image fetch-only
}
function setup {
### start containerd and log to a file
echo "Starting containerd in the background"
containerd 2&> /tmp/containerd.err &
echo "Waiting for containerd to be responsive"
# shellcheck disable=SC2034
for i in $(seq 1 60); do
if ctr namespace ls > /dev/null; then
break
fi
sleep 1
done
ctr namespace ls > /dev/null
echo "containerd is ready"
# TODO Once https://github.com/moby/moby/pull/33355 or equivalent
# is merged, then this can be optimized to preload the image
# saved during the build phase
}
function cleanup {
#### if testexit is non-zero dump the containerd logs with a banner
if [ "${testexit}" -ne 0 ] ; then
echo "FAIL: dumping containerd logs"
echo ""
cat /tmp/containerd.err
if [ -f /var/log/engine.log ] ; then
echo ""
echo "FAIL: dumping engine log"
echo ""
else
echo ""
echo "FAIL: engine log missing"
echo ""
fi
echo "FAIL: remaining namespaces"
ctr namespace ls || /bin/tru
echo "FAIL: remaining containers"
ctr --namespace docker container ls || /bin/tru
echo "FAIL: remaining tasks"
ctr --namespace docker task ls || /bin/tru
echo "FAIL: remaining snapshots"
ctr --namespace docker snapshots ls || /bin/tru
echo "FAIL: remaining images"
ctr --namespace docker image ls || /bin/tru
fi
}
function runtests {
# shellcheck disable=SC2086
env -i \
GOPATH="$GOPATH" \
PATH="$PWD/build/:${PATH}" \
VERSION=${VERSION} \
"$(which go)" test -p 1 -parallel 1 -v ./e2eengine/... ${TESTFLAGS-}
}
cmd=${1-}
case "$cmd" in
setup)
setup
exit
;;
cleanup)
cleanup
exit
;;
fetch-images)
fetch_images
exit
;;
test)
runtests
;;
run|"")
testexit=0
runtests || testexit=$?
cleanup
exit $testexit
;;
shell)
$SHELL
;;
*)
echo "Unknown command: $cmd"
echo "Usage: "
echo " $0 [setup | cleanup | test | run]"
exit 1
;;
esac

18
vendor/github.com/docker/cli/scripts/test/engine/wrapper generated vendored Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env bash
# Setup, run and teardown engine test suite in containers.
set -eu -o pipefail
./scripts/test/engine/run setup
testexit=0
test_cmd="test"
if [[ -n "${TEST_DEBUG-}" ]]; then
test_cmd="shell"
fi
./scripts/test/engine/run "$test_cmd" || testexit="$?"
export testexit
./scripts/test/engine/run cleanup
exit "$testexit"

4
vendor/github.com/docker/cli/scripts/test/unit generated vendored Executable file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -eu -o pipefail
go test -v "$@"

20
vendor/github.com/docker/cli/scripts/test/unit-with-coverage generated vendored Executable file
View file

@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -eu -o pipefail
# install test dependencies once before running tests for each package. This
# reduces the runtime from 200s down to 23s
go test -i "$@"
echo "mode: atomic" > coverage.txt
for pkg in "$@"; do
./scripts/test/unit \
-cover \
-coverprofile=profile.out \
-covermode=atomic \
"${pkg}"
if test -f profile.out; then
grep -v "^mode:" < profile.out >> coverage.txt || true
rm profile.out
fi
done