test-docker-py 793 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. set -e
  3. DEST=$1
  4. # subshell so that we can export PATH without breaking other things
  5. (
  6. source "$(dirname "$BASH_SOURCE")/.integration-daemon-start"
  7. # we need to wrap up everything in between integration-daemon-start and
  8. # integration-daemon-stop to make sure we kill the daemon and don't hang,
  9. # even and especially on test failures
  10. didFail=
  11. if ! {
  12. dockerPy='/docker-py'
  13. [ -d "$dockerPy" ] || {
  14. dockerPy="$DEST/docker-py"
  15. git clone https://github.com/docker/docker-py.git "$dockerPy"
  16. }
  17. export PYTHONPATH="$dockerPy" # import "docker" from our local docker-py
  18. python "$dockerPy/tests/integration_test.py"
  19. }; then
  20. didFail=1
  21. fi
  22. source "$(dirname "$BASH_SOURCE")/.integration-daemon-stop"
  23. [ -z "$didFail" ] # "set -e" ftw
  24. ) 2>&1 | tee -a $DEST/test.log