Browse code

hack: explicit bundles for integration-cli prequisites

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 <joerg@higgsboson.tk>

Jörg Thalheim authored on 2015/04/20 19:21:21
Showing 5 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,5 @@
0
+#!/bin/bash
1
+
2
+bundle .ensure-emptyfs
3
+bundle .ensure-frozen-images
4
+bundle .ensure-httpserver
... ...
@@ -49,7 +49,8 @@ if [ -z "$DOCKER_TEST_HOST" ]; then
49 49
 		$storage_params \
50 50
 			&> "$DEST/docker.log"
51 51
 	) &
52
-	trap "source '${MAKEDIR}/.integration-daemon-stop'" EXIT # make sure that if the script exits unexpectedly, we stop this daemon we just started
52
+	# make sure that if the script exits unexpectedly, we stop this daemon we just started
53
+	trap 'bundle .integration-daemon-stop' EXIT
53 54
 else
54 55
 	export DOCKER_HOST="$DOCKER_TEST_HOST"
55 56
 fi
... ...
@@ -4,8 +4,7 @@ set -e
4 4
 # subshell so that we can export PATH and TZ without breaking other things
5 5
 (
6 6
 	export TZ=UTC # make sure our "date" variables are UTC-based
7
-
8
-	source "${MAKEDIR}/.integration-daemon-start"
7
+	bundle .integration-daemon-start
9 8
 
10 9
 	# TODO consider using frozen images for the dockercore/builder-deb tags
11 10
 
... ...
@@ -63,5 +62,5 @@ set -e
63 63
 		docker rmi "$tempImage"
64 64
 	done
65 65
 
66
-	source "${MAKEDIR}/.integration-daemon-stop"
66
+	bundle .test-integration-stop
67 67
 ) 2>&1 | tee -a "$DEST/test.log"
... ...
@@ -3,7 +3,7 @@ set -e
3 3
 
4 4
 # subshell so that we can export PATH without breaking other things
5 5
 (
6
-	source "${MAKEDIR}/.integration-daemon-start"
6
+	bundle .integration-daemon-start
7 7
 
8 8
 	dockerPy='/docker-py'
9 9
 	[ -d "$dockerPy" ] || {
... ...
@@ -14,5 +14,5 @@ set -e
14 14
 	# exporting PYTHONPATH to import "docker" from our local docker-py
15 15
 	test_env PYTHONPATH="$dockerPy" python "$dockerPy/tests/integration_test.py"
16 16
 
17
-	source "${MAKEDIR}/.integration-daemon-stop"
17
+	bundle .integration-daemon-stop
18 18
 ) 2>&1 | tee -a "$DEST/test.log"
... ...
@@ -7,13 +7,11 @@ bundle_test_integration_cli() {
7 7
 
8 8
 # subshell so that we can export PATH without breaking other things
9 9
 (
10
-	source "${MAKEDIR}/.integration-daemon-start"
10
+	bundle .integration-daemon-start
11 11
 
12
-	source "${MAKEDIR}/.ensure-frozen-images"
13
-	source "${MAKEDIR}/.ensure-httpserver"
14
-	source "${MAKEDIR}/.ensure-emptyfs"
12
+	bundle .integration-daemon-setup
15 13
 
16 14
 	bundle_test_integration_cli
17 15
 
18
-	source "${MAKEDIR}/.integration-daemon-stop"
16
+	bundle .integration-daemon-stop
19 17
 ) 2>&1 | tee -a "$DEST/test.log"