github.com/Prakhar-Agarwal-byte/moby@v0.0.0-20231027092010-a14e3e8ab87e/hack/test/e2e-run.sh (about)

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