Browse Source

Small tweaks to the hack scripts to make them simpler

Please do with this as you please (including rebasing and/or squashing it), especially under clause (c) of the DCO.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
Tianon Gravi 11 years ago
parent
commit
3fb1fc0b7b
2 changed files with 8 additions and 16 deletions
  1. 1 0
      hack/make/binary
  2. 7 16
      hack/make/test-integration-cli

+ 1 - 0
hack/make/binary

@@ -11,5 +11,6 @@ go build \
 	" \
 	" \
 	./docker
 	./docker
 echo "Created binary: $DEST/docker-$VERSION"
 echo "Created binary: $DEST/docker-$VERSION"
+ln -sf "docker-$VERSION" "$DEST/docker"
 
 
 hash_files "$DEST/docker-$VERSION"
 hash_files "$DEST/docker-$VERSION"

+ 7 - 16
hack/make/test-integration-cli

@@ -1,37 +1,28 @@
 #!/bin/bash
 #!/bin/bash
 
 
 DEST=$1
 DEST=$1
-DOCKERBIN=$DEST/../binary/docker-$VERSION
-DYNDOCKERBIN=$DEST/../dynbinary/docker-$VERSION
-DOCKERINITBIN=$DEST/../dynbinary/dockerinit-$VERSION
 
 
 set -e
 set -e
 
 
+# subshell so that we can export PATH without breaking other things
+(
+export PATH="$DEST/../binary:$DEST/../dynbinary:$PATH"
+
 bundle_test_integration_cli() {
 bundle_test_integration_cli() {
 	go_test_dir ./integration-cli
 	go_test_dir ./integration-cli
 }
 }
 
 
-if [ -x "/usr/bin/docker" ]; then
-	echo "docker found at /usr/bin/docker"
-elif [ -x "$DOCKERBIN" ]; then
-	ln -s $DOCKERBIN /usr/bin/docker
-elif [ -x "$DYNDOCKERBIN" ]; then
-	ln -s $DYNDOCKERBIN /usr/bin/docker
-	ln -s $DOCKERINITBIN /usr/bin/dockerinit
-else
+if ! command -v docker &> /dev/null; then
 	echo >&2 'error: binary or dynbinary must be run before test-integration-cli'
 	echo >&2 'error: binary or dynbinary must be run before test-integration-cli'
 	false
 	false
 fi
 fi
 
 
-
 docker -d -D -p $DEST/docker.pid &> $DEST/docker.log &
 docker -d -D -p $DEST/docker.pid &> $DEST/docker.log &
-sleep 2
-docker info
-DOCKERD_PID=`cat $DEST/docker.pid`
 
 
 bundle_test_integration_cli 2>&1 \
 bundle_test_integration_cli 2>&1 \
 	| tee $DEST/test.log
 	| tee $DEST/test.log
 
 
+DOCKERD_PID=$(cat $DEST/docker.pid)
 kill $DOCKERD_PID
 kill $DOCKERD_PID
 wait $DOCKERD_PID
 wait $DOCKERD_PID
-
+)