2014-12-15 14:44:15 -05:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
DEST=$1
|
|
|
|
|
|
|
|
# subshell so that we can export PATH without breaking other things
|
|
|
|
(
|
2014-12-19 02:20:59 -05:00
|
|
|
source "$(dirname "$BASH_SOURCE")/.integration-daemon-start"
|
2014-12-15 14:44:15 -05:00
|
|
|
|
2015-01-13 23:09:11 -05:00
|
|
|
# we need to wrap up everything in between integration-daemon-start and
|
|
|
|
# integration-daemon-stop to make sure we kill the daemon and don't hang,
|
|
|
|
# even and especially on test failures
|
|
|
|
didFail=
|
|
|
|
if ! {
|
|
|
|
dockerPy='/docker-py'
|
|
|
|
[ -d "$dockerPy" ] || {
|
|
|
|
dockerPy="$DEST/docker-py"
|
|
|
|
git clone https://github.com/docker/docker-py.git "$dockerPy"
|
|
|
|
}
|
2014-12-15 14:44:15 -05:00
|
|
|
|
2015-01-13 23:09:11 -05:00
|
|
|
export PYTHONPATH="$dockerPy" # import "docker" from our local docker-py
|
|
|
|
python "$dockerPy/tests/integration_test.py"
|
|
|
|
}; then
|
|
|
|
didFail=1
|
|
|
|
fi
|
2014-12-15 14:44:15 -05:00
|
|
|
|
2014-12-19 02:20:59 -05:00
|
|
|
source "$(dirname "$BASH_SOURCE")/.integration-daemon-stop"
|
2015-01-13 23:09:11 -05:00
|
|
|
|
|
|
|
[ -z "$didFail" ] # "set -e" ftw
|
2015-01-09 19:28:40 -05:00
|
|
|
) 2>&1 | tee -a $DEST/test.log
|