Browse code

Update test-integration-cli bundlescript for consistency with other bundlescripts and slightly more verbose logging of which commands were executed

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)

Tianon Gravi authored on 2014/04/08 14:10:40
Showing 1 changed files
... ...
@@ -4,9 +4,6 @@ DEST=$1
4 4
 
5 5
 set -e
6 6
 
7
-# subshell so that we can export PATH without breaking other things
8
-(
9
-export PATH="$DEST/../binary:$DEST/../dynbinary:$PATH"
10 7
 DOCKER_GRAPHDRIVER=${DOCKER_GRAPHDRIVER:-vfs}
11 8
 DOCKER_EXECDRIVER=${DOCKER_EXECDRIVER:-native}
12 9
 
... ...
@@ -14,22 +11,30 @@ bundle_test_integration_cli() {
14 14
 	go_test_dir ./integration-cli
15 15
 }
16 16
 
17
-if ! command -v docker &> /dev/null; then
18
-	echo >&2 'error: binary or dynbinary must be run before test-integration-cli'
19
-	false
20
-fi
21
-
22
-echo "running cli integration tests using graphdriver: '$DOCKER_GRAPHDRIVER' and execdriver: '$DOCKER_EXECDRIVER'" 
23
-docker -d -D -s $DOCKER_GRAPHDRIVER -e $DOCKER_EXECDRIVER -p $DEST/docker.pid &> $DEST/docker.log &
24
-
25
-# pull the busybox image before running the tests
26
-sleep 2
27
-docker pull busybox
28
-
29
-bundle_test_integration_cli 2>&1 \
30
-	| tee $DEST/test.log
31
-
32
-DOCKERD_PID=$(cat $DEST/docker.pid)
33
-kill $DOCKERD_PID
34
-wait $DOCKERD_PID || true
35
-)
17
+# subshell so that we can export PATH without breaking other things
18
+(
19
+	export PATH="$DEST/../binary:$DEST/../dynbinary:$PATH"
20
+	
21
+	if ! command -v docker &> /dev/null; then
22
+		echo >&2 'error: binary or dynbinary must be run before test-integration-cli'
23
+		false
24
+	fi
25
+	
26
+	( set -x; exec \
27
+		docker --daemon --debug \
28
+		--storage-driver "$DOCKER_GRAPHDRIVER" \
29
+		--exec-driver "$DOCKER_EXECDRIVER" \
30
+		--pidfile "$DEST/docker.pid" \
31
+			&> "$DEST/docker.log"
32
+	) &
33
+	
34
+	# pull the busybox image before running the tests
35
+	sleep 2
36
+	( set -x; docker pull busybox )
37
+	
38
+	bundle_test_integration_cli
39
+	
40
+	DOCKERD_PID=$(set -x; cat $DEST/docker.pid)
41
+	( set -x; kill $DOCKERD_PID )
42
+	wait $DOCKERD_PID || true
43
+) 2>&1 | tee $DEST/test.log