2014-02-25 16:17:48 +00:00
|
|
|
#!/bin/bash
|
2014-04-08 04:14:19 +00:00
|
|
|
set -e
|
2014-02-25 16:17:48 +00:00
|
|
|
|
|
|
|
DEST=$1
|
|
|
|
|
2014-04-04 16:03:07 +00:00
|
|
|
DOCKER_GRAPHDRIVER=${DOCKER_GRAPHDRIVER:-vfs}
|
|
|
|
DOCKER_EXECDRIVER=${DOCKER_EXECDRIVER:-native}
|
2014-03-20 22:46:55 +00:00
|
|
|
|
2014-02-25 16:17:48 +00:00
|
|
|
bundle_test_integration_cli() {
|
|
|
|
go_test_dir ./integration-cli
|
|
|
|
}
|
|
|
|
|
2014-04-08 05:10:40 +00:00
|
|
|
# subshell so that we can export PATH without breaking other things
|
2014-05-18 11:17:31 +00:00
|
|
|
exec > >(tee -a $DEST/test.log) 2>&1
|
2014-04-08 05:10:40 +00:00
|
|
|
(
|
|
|
|
export PATH="$DEST/../binary:$DEST/../dynbinary:$PATH"
|
2014-04-29 04:22:31 +00:00
|
|
|
|
2014-04-08 05:10:40 +00:00
|
|
|
if ! command -v docker &> /dev/null; then
|
|
|
|
echo >&2 'error: binary or dynbinary must be run before test-integration-cli'
|
|
|
|
false
|
|
|
|
fi
|
2014-04-29 04:22:31 +00:00
|
|
|
|
2014-04-29 05:22:54 +00:00
|
|
|
# intentionally open a couple bogus file descriptors to help test that they get scrubbed in containers
|
|
|
|
exec 41>&1 42>&2
|
|
|
|
|
2014-04-08 05:10:40 +00:00
|
|
|
( set -x; exec \
|
|
|
|
docker --daemon --debug \
|
|
|
|
--storage-driver "$DOCKER_GRAPHDRIVER" \
|
|
|
|
--exec-driver "$DOCKER_EXECDRIVER" \
|
|
|
|
--pidfile "$DEST/docker.pid" \
|
|
|
|
&> "$DEST/docker.log"
|
|
|
|
) &
|
2014-04-29 04:22:31 +00:00
|
|
|
|
2014-04-08 05:10:40 +00:00
|
|
|
# pull the busybox image before running the tests
|
|
|
|
sleep 2
|
2014-04-29 04:22:31 +00:00
|
|
|
|
2014-04-29 04:23:22 +00:00
|
|
|
source "$(dirname "$BASH_SOURCE")/.ensure-busybox"
|
2014-04-12 00:49:49 +00:00
|
|
|
|
2014-04-08 05:10:40 +00:00
|
|
|
bundle_test_integration_cli
|
2014-04-29 04:22:31 +00:00
|
|
|
|
2014-07-23 18:12:42 +00:00
|
|
|
for pid in $(find "$DEST" -name docker.pid); do
|
|
|
|
DOCKER_PID=$(set -x; cat "$pid")
|
|
|
|
( set -x; kill $DOCKER_PID )
|
|
|
|
wait $DOCKERD_PID || true
|
|
|
|
done
|
2014-05-18 11:17:31 +00:00
|
|
|
)
|