From 2b4facdf2ed6b1074a2a8abc031bf0827b6d5f33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 20 Apr 2015 12:21:21 +0200 Subject: [PATCH] hack: explicit bundles for integration-cli prequisites MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no longer load hide critical code such as in .integration-daemon-{start,stop}, if this step failed, it will had logged the corresponding module before: ---> Making bundle: .integration-daemon-start (in bundles/1.7.0-dev/daemon-start) which is nicer to debug. This will make it also easier to execute a single tests in an interactive shell. $ make shell docker> . hack/make.sh binary .integration-daemon-start .integration-daemon-setup docker> docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES docker> go test github.com/docker/docker/integration-cli Signed-off-by: Jörg Thalheim --- hack/make/.integration-daemon-setup | 5 +++++ hack/make/.integration-daemon-start | 3 ++- hack/make/build-deb | 5 ++--- hack/make/test-docker-py | 4 ++-- hack/make/test-integration-cli | 8 +++----- 5 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 hack/make/.integration-daemon-setup diff --git a/hack/make/.integration-daemon-setup b/hack/make/.integration-daemon-setup new file mode 100644 index 0000000000..ab9d45c32c --- /dev/null +++ b/hack/make/.integration-daemon-setup @@ -0,0 +1,5 @@ +#!/bin/bash + +bundle .ensure-emptyfs +bundle .ensure-frozen-images +bundle .ensure-httpserver diff --git a/hack/make/.integration-daemon-start b/hack/make/.integration-daemon-start index ba1d47bc69..9655f58335 100644 --- a/hack/make/.integration-daemon-start +++ b/hack/make/.integration-daemon-start @@ -49,7 +49,8 @@ if [ -z "$DOCKER_TEST_HOST" ]; then $storage_params \ &> "$DEST/docker.log" ) & - trap "source '${MAKEDIR}/.integration-daemon-stop'" EXIT # make sure that if the script exits unexpectedly, we stop this daemon we just started + # make sure that if the script exits unexpectedly, we stop this daemon we just started + trap 'bundle .integration-daemon-stop' EXIT else export DOCKER_HOST="$DOCKER_TEST_HOST" fi diff --git a/hack/make/build-deb b/hack/make/build-deb index 90f96bd54e..19555acc26 100644 --- a/hack/make/build-deb +++ b/hack/make/build-deb @@ -4,8 +4,7 @@ set -e # subshell so that we can export PATH and TZ without breaking other things ( export TZ=UTC # make sure our "date" variables are UTC-based - - source "${MAKEDIR}/.integration-daemon-start" + bundle .integration-daemon-start # TODO consider using frozen images for the dockercore/builder-deb tags @@ -63,5 +62,5 @@ set -e docker rmi "$tempImage" done - source "${MAKEDIR}/.integration-daemon-stop" + bundle .test-integration-stop ) 2>&1 | tee -a "$DEST/test.log" diff --git a/hack/make/test-docker-py b/hack/make/test-docker-py index cbd59adddb..ad8877877f 100644 --- a/hack/make/test-docker-py +++ b/hack/make/test-docker-py @@ -3,7 +3,7 @@ set -e # subshell so that we can export PATH without breaking other things ( - source "${MAKEDIR}/.integration-daemon-start" + bundle .integration-daemon-start dockerPy='/docker-py' [ -d "$dockerPy" ] || { @@ -14,5 +14,5 @@ set -e # exporting PYTHONPATH to import "docker" from our local docker-py test_env PYTHONPATH="$dockerPy" python "$dockerPy/tests/integration_test.py" - source "${MAKEDIR}/.integration-daemon-stop" + bundle .integration-daemon-stop ) 2>&1 | tee -a "$DEST/test.log" diff --git a/hack/make/test-integration-cli b/hack/make/test-integration-cli index 61d62f160a..1861b2222e 100644 --- a/hack/make/test-integration-cli +++ b/hack/make/test-integration-cli @@ -7,13 +7,11 @@ bundle_test_integration_cli() { # subshell so that we can export PATH without breaking other things ( - source "${MAKEDIR}/.integration-daemon-start" + bundle .integration-daemon-start - source "${MAKEDIR}/.ensure-frozen-images" - source "${MAKEDIR}/.ensure-httpserver" - source "${MAKEDIR}/.ensure-emptyfs" + bundle .integration-daemon-setup bundle_test_integration_cli - source "${MAKEDIR}/.integration-daemon-stop" + bundle .integration-daemon-stop ) 2>&1 | tee -a "$DEST/test.log"