2014-02-25 11:17:48 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
DEST=$1
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2014-03-20 18:46:55 -04:00
|
|
|
# subshell so that we can export PATH without breaking other things
|
|
|
|
(
|
|
|
|
export PATH="$DEST/../binary:$DEST/../dynbinary:$PATH"
|
|
|
|
|
2014-02-25 11:17:48 -05:00
|
|
|
bundle_test_integration_cli() {
|
|
|
|
go_test_dir ./integration-cli
|
|
|
|
}
|
|
|
|
|
2014-03-20 18:46:55 -04:00
|
|
|
if ! command -v docker &> /dev/null; then
|
2014-02-25 11:17:48 -05:00
|
|
|
echo >&2 'error: binary or dynbinary must be run before test-integration-cli'
|
|
|
|
false
|
|
|
|
fi
|
|
|
|
|
|
|
|
docker -d -D -p $DEST/docker.pid &> $DEST/docker.log &
|
|
|
|
|
2014-03-31 14:48:30 -04:00
|
|
|
# pull the busybox image before running the tests
|
|
|
|
sleep 2
|
|
|
|
docker pull busybox
|
|
|
|
|
2014-02-25 11:17:48 -05:00
|
|
|
bundle_test_integration_cli 2>&1 \
|
|
|
|
| tee $DEST/test.log
|
|
|
|
|
2014-03-20 18:46:55 -04:00
|
|
|
DOCKERD_PID=$(cat $DEST/docker.pid)
|
2014-02-25 11:17:48 -05:00
|
|
|
kill $DOCKERD_PID
|
|
|
|
wait $DOCKERD_PID
|
2014-03-20 18:46:55 -04:00
|
|
|
)
|