e2e-run.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/usr/bin/env bash
  2. set -e -u -o pipefail
  3. # Set defaults
  4. : ${TESTFLAGS:=}
  5. : ${TESTDEBUG:=}
  6. integration_api_dirs=${TEST_INTEGRATION_DIR:-"$(
  7. find /tests/integration -type d \
  8. | grep -vE '(^/tests/integration($|/internal)|/testdata)'
  9. )"}
  10. run_test_integration() {
  11. run_test_integration_suites
  12. run_test_integration_legacy_suites
  13. }
  14. run_test_integration_suites() {
  15. local flags="-test.v -test.timeout=${TIMEOUT} $TESTFLAGS"
  16. for dir in $integration_api_dirs; do
  17. if ! (
  18. cd $dir
  19. echo "Running $PWD"
  20. test_env ./test.main $flags
  21. ); then exit 1; fi
  22. done
  23. }
  24. run_test_integration_legacy_suites() {
  25. (
  26. flags="-test.v -test.timeout=360m $TESTFLAGS"
  27. cd /tests/integration-cli
  28. echo "Running $PWD"
  29. test_env ./test.main $flags
  30. )
  31. }
  32. # use "env -i" to tightly control the environment variables that bleed into the tests
  33. test_env() {
  34. (
  35. set -e +u
  36. [ -n "$TESTDEBUG" ] && set -x
  37. env -i \
  38. DOCKER_API_VERSION="$DOCKER_API_VERSION" \
  39. DOCKER_INTEGRATION_DAEMON_DEST="$DOCKER_INTEGRATION_DAEMON_DEST" \
  40. DOCKER_TLS_VERIFY="$DOCKER_TEST_TLS_VERIFY" \
  41. DOCKER_CERT_PATH="$DOCKER_TEST_CERT_PATH" \
  42. DOCKER_GRAPHDRIVER="$DOCKER_GRAPHDRIVER" \
  43. DOCKER_USERLANDPROXY="$DOCKER_USERLANDPROXY" \
  44. DOCKER_HOST="$DOCKER_HOST" \
  45. DOCKER_REMAP_ROOT="$DOCKER_REMAP_ROOT" \
  46. DOCKER_REMOTE_DAEMON="$DOCKER_REMOTE_DAEMON" \
  47. GOPATH="$GOPATH" \
  48. GOTRACEBACK=all \
  49. HOME="$ABS_DEST/fake-HOME" \
  50. PATH="$PATH" \
  51. TEMP="$TEMP" \
  52. TEST_CLIENT_BINARY="$TEST_CLIENT_BINARY" \
  53. "$@"
  54. )
  55. }
  56. sh /scripts/build-empty-images.sh
  57. run_test_integration