diff --git a/test-pr.sh b/test-pr.sh index bd319f2d3b065..b1909ce1c0666 100755 --- a/test-pr.sh +++ b/test-pr.sh @@ -101,7 +101,7 @@ if [ -z "$BASHBREW_SECOND_STAGE" ]; then cmd=( ./test-pr.sh "$pull" "$@" ) - if [ -t 1 ]; then + if [ -t 0 ] && [ -t 1 ]; then # only add "-t" if we have a TTY args+=( -t ) fi diff --git a/test/tests/convertigo-hello-world/run.sh b/test/tests/convertigo-hello-world/run.sh index ee963f05cd424..dbc069cc399bc 100755 --- a/test/tests/convertigo-hello-world/run.sh +++ b/test/tests/convertigo-hello-world/run.sh @@ -7,6 +7,10 @@ serverImage="$1" # Use a client image with curl for testing clientImage='buildpack-deps:buster-curl' +# ensure the clientImage is ready and available +if ! docker image inspect "$clientImage" &> /dev/null; then + docker pull "$clientImage" > /dev/null +fi # Create an instance of the container-under-test cid="$(docker run -d "$serverImage")" diff --git a/test/tests/docker-registry-push-pull/run.sh b/test/tests/docker-registry-push-pull/run.sh index 516793e77cbf0..53718b5edd861 100755 --- a/test/tests/docker-registry-push-pull/run.sh +++ b/test/tests/docker-registry-push-pull/run.sh @@ -8,10 +8,16 @@ case "${image##*/}" in docker:*dind*) dockerImage="$image" registryImage='registry' + if ! docker image inspect "$registryImage" &> /dev/null; then + docker pull "$registryImage" > /dev/null + fi ;; registry:*|registry) registryImage="$image" dockerImage='docker:dind' + if ! docker image inspect "$dockerImage" &> /dev/null; then + docker pull "$dockerImage" > /dev/null + fi ;; *) echo >&2 "error: unable to determine whether '$image' is registry or docker:dind" diff --git a/test/tests/elasticsearch-basics/run.sh b/test/tests/elasticsearch-basics/run.sh index 2c34446f8cc66..714becd8b9bc7 100755 --- a/test/tests/elasticsearch-basics/run.sh +++ b/test/tests/elasticsearch-basics/run.sh @@ -10,6 +10,10 @@ image="$1" # Use a client image with curl for testing clientImage='buildpack-deps:buster-curl' +# ensure the clientImage is ready and available +if ! docker image inspect "$clientImage" &> /dev/null; then + docker pull "$clientImage" > /dev/null +fi # Create an instance of the container-under-test # (explicitly setting a low memory limit since the image defaults to 2GB) diff --git a/test/tests/ghost-basics/run.sh b/test/tests/ghost-basics/run.sh index f0ade04e24675..82db25d03cef5 100755 --- a/test/tests/ghost-basics/run.sh +++ b/test/tests/ghost-basics/run.sh @@ -7,6 +7,10 @@ serverImage="$1" # Use a client image with curl for testing clientImage='buildpack-deps:buster-curl' +# ensure the clientImage is ready and available +if ! docker image inspect "$clientImage" &> /dev/null; then + docker pull "$clientImage" > /dev/null +fi # Create an instance of the container-under-test cid="$(docker run -d "$serverImage")" diff --git a/test/tests/haproxy-basics/run.sh b/test/tests/haproxy-basics/run.sh index f1ed465b07dd2..0bcc109d038ca 100755 --- a/test/tests/haproxy-basics/run.sh +++ b/test/tests/haproxy-basics/run.sh @@ -9,6 +9,10 @@ dir="$(dirname "$(readlink -f "$BASH_SOURCE")")" image="$1" clientImage='buildpack-deps:buster-curl' +# ensure the clientImage is ready and available +if ! docker image inspect "$clientImage" &> /dev/null; then + docker pull "$clientImage" > /dev/null +fi # Create an instance of the container-under-test serverImage="$("$dir/../image-name.sh" librarytest/haproxy-basics "$image")" diff --git a/test/tests/jetty-hello-web/run.sh b/test/tests/jetty-hello-web/run.sh index 1cc363533b28f..a64f8218175db 100755 --- a/test/tests/jetty-hello-web/run.sh +++ b/test/tests/jetty-hello-web/run.sh @@ -10,6 +10,10 @@ image="$1" # Use a client image with curl for testing clientImage='buildpack-deps:buster-curl' +# ensure the clientImage is ready and available +if ! docker image inspect "$clientImage" &> /dev/null; then + docker pull "$clientImage" > /dev/null +fi # Create an instance of the container-under-test serverImage="$("$dir/../image-name.sh" librarytest/jetty-hello-web "$image")" diff --git a/test/tests/logstash-basics/run.sh b/test/tests/logstash-basics/run.sh index ead016fb31a2d..00e588bb03030 100755 --- a/test/tests/logstash-basics/run.sh +++ b/test/tests/logstash-basics/run.sh @@ -10,6 +10,10 @@ image="$1" # Use a client image with curl for testing clientImage='buildpack-deps:buster-curl' +# ensure the clientImage is ready and available +if ! docker image inspect "$clientImage" &> /dev/null; then + docker pull "$clientImage" > /dev/null +fi # input via HTTP (default port 0.0.0.0:8080) # output via stdout, newline-delimited nothing-but-the-message diff --git a/test/tests/memcached-basics/run.sh b/test/tests/memcached-basics/run.sh index ad9dcf8019874..553b45e23c293 100755 --- a/test/tests/memcached-basics/run.sh +++ b/test/tests/memcached-basics/run.sh @@ -7,6 +7,10 @@ image="$1" # for "nc" clientImage='busybox' +# ensure the clientImage is ready and available +if ! docker image inspect "$clientImage" &> /dev/null; then + docker pull "$clientImage" > /dev/null +fi cname="memcached-container-$RANDOM-$RANDOM" cid="$(docker run -d --name "$cname" "$image")" diff --git a/test/tests/mongo-express-run/run.sh b/test/tests/mongo-express-run/run.sh index bcfcb6ae8e844..029f666dbb0c8 100755 --- a/test/tests/mongo-express-run/run.sh +++ b/test/tests/mongo-express-run/run.sh @@ -3,10 +3,19 @@ set -Eeuo pipefail dir="$(dirname "$(readlink -f "$BASH_SOURCE")")" +serverImage="$1" + clientImage='buildpack-deps:buster-curl' +# ensure the clientImage is ready and available +if ! docker image inspect "$clientImage" &> /dev/null; then + docker pull "$clientImage" > /dev/null +fi mongoImage='mongo:4.0' -serverImage="$1" +# ensure the mongoImage is ready and available +if ! docker image inspect "$mongoImage" &> /dev/null; then + docker pull "$mongoImage" > /dev/null +fi # Create an instance of the container-under-test mongoCid="$(docker run -d "$mongoImage")" diff --git a/test/tests/nextcloud-apache-run/run.sh b/test/tests/nextcloud-apache-run/run.sh index 483ec96c27799..f2d6be248b52c 100755 --- a/test/tests/nextcloud-apache-run/run.sh +++ b/test/tests/nextcloud-apache-run/run.sh @@ -7,6 +7,10 @@ serverImage="$1" # Use a client image with curl for testing clientImage='buildpack-deps:buster-curl' +# ensure the clientImage is ready and available +if ! docker image inspect "$clientImage" &> /dev/null; then + docker pull "$clientImage" > /dev/null +fi # Create an instance of the container-under-test cid="$(docker run -d "$serverImage")" diff --git a/test/tests/nextcloud-cli-mysql/run.sh b/test/tests/nextcloud-cli-mysql/run.sh index 8b946e9450962..b0b5e129864d0 100755 --- a/test/tests/nextcloud-cli-mysql/run.sh +++ b/test/tests/nextcloud-cli-mysql/run.sh @@ -4,6 +4,10 @@ set -eo pipefail dir="$(dirname "$(readlink -f "$BASH_SOURCE")")" dbImage='mariadb:10.3' +# ensure the dbImage is ready and available +if ! docker image inspect "$dbImage" &> /dev/null; then + docker pull "$dbImage" > /dev/null +fi serverImage="$1" dbPass="test-$RANDOM-password-$RANDOM-$$" dbName="test-$RANDOM-db" diff --git a/test/tests/nextcloud-cli-postgres/run.sh b/test/tests/nextcloud-cli-postgres/run.sh index 23f3d086b2b84..e9a27caacabbd 100755 --- a/test/tests/nextcloud-cli-postgres/run.sh +++ b/test/tests/nextcloud-cli-postgres/run.sh @@ -4,6 +4,10 @@ set -eo pipefail dir="$(dirname "$(readlink -f "$BASH_SOURCE")")" dbImage='postgres:11-alpine' +# ensure the dbImage is ready and available +if ! docker image inspect "$dbImage" &> /dev/null; then + docker pull "$dbImage" > /dev/null +fi serverImage="$1" dbPass="test-$RANDOM-password-$RANDOM-$$" dbName="test_${RANDOM}_db" # dbName has to be set to something that does not require escaping: https://github.com/docker-library/official-images/pull/6252#issuecomment-520095703 diff --git a/test/tests/open-liberty-hello-world/run.sh b/test/tests/open-liberty-hello-world/run.sh index 1bb0a44bf2dc7..aa67aa649293f 100755 --- a/test/tests/open-liberty-hello-world/run.sh +++ b/test/tests/open-liberty-hello-world/run.sh @@ -7,6 +7,10 @@ image="$1" # Use a client image with curl for testing clientImage='buildpack-deps:buster-curl' +# ensure the clientImage is ready and available +if ! docker image inspect "$clientImage" &> /dev/null; then + docker pull "$clientImage" > /dev/null +fi serverImage="$1" diff --git a/test/tests/php-apache-hello-web/run.sh b/test/tests/php-apache-hello-web/run.sh index 7cf8f4a6ff0b4..90a731e85a4df 100755 --- a/test/tests/php-apache-hello-web/run.sh +++ b/test/tests/php-apache-hello-web/run.sh @@ -7,6 +7,10 @@ image="$1" # Use a client image with curl for testing clientImage='buildpack-deps:buster-curl' +# ensure the clientImage is ready and available +if ! docker image inspect "$clientImage" &> /dev/null; then + docker pull "$clientImage" > /dev/null +fi serverImage="$("$dir/../image-name.sh" librarytest/php-apache-hello-web "$image")" "$dir/../docker-build.sh" "$dir" "$serverImage" < /dev/null; then + docker pull "$clientImage" > /dev/null +fi # Create an instance of the container-under-test serverImage="$("$dir/../image-name.sh" librarytest/rapidoid-hello-web "$image")" diff --git a/test/tests/rapidoid-load-balancer/run.sh b/test/tests/rapidoid-load-balancer/run.sh index 90da7ee8b509d..6d9beab9b1982 100755 --- a/test/tests/rapidoid-load-balancer/run.sh +++ b/test/tests/rapidoid-load-balancer/run.sh @@ -10,6 +10,10 @@ image="$1" # Use a client image with curl for testing clientImage='buildpack-deps:buster-curl' +# ensure the clientImage is ready and available +if ! docker image inspect "$clientImage" &> /dev/null; then + docker pull "$clientImage" > /dev/null +fi app1id="$(docker run -d "$image" rapidoid.port=80 id=app1 app.services=ping,status)" app2id="$(docker run -d "$image" rapidoid.port=80 id=app2 app.services=ping,status)" diff --git a/test/tests/redmine-basics/run.sh b/test/tests/redmine-basics/run.sh index 34444e1563ae7..61e99f8132baa 100755 --- a/test/tests/redmine-basics/run.sh +++ b/test/tests/redmine-basics/run.sh @@ -7,6 +7,10 @@ serverImage="$1" # Use a client image with curl for testing clientImage='buildpack-deps:buster-curl' +# ensure the clientImage is ready and available +if ! docker image inspect "$clientImage" &> /dev/null; then + docker pull "$clientImage" > /dev/null +fi # Create an instance of the container-under-test cid="$(docker run -d "$serverImage")" diff --git a/test/tests/silverpeas-basics/run.sh b/test/tests/silverpeas-basics/run.sh index 756eea9e69217..38187be0fd999 100755 --- a/test/tests/silverpeas-basics/run.sh +++ b/test/tests/silverpeas-basics/run.sh @@ -7,6 +7,10 @@ image="$1" # Use a client image with curl for testing clientImage='buildpack-deps:buster-curl' +# ensure the clientImage is ready and available +if ! docker image inspect "$clientImage" &> /dev/null; then + docker pull "$clientImage" > /dev/null +fi cname="silverpeas-container-$RANDOM-$RANDOM" # when running the first time, a silverpeas process is spawn before starting Silverpeas diff --git a/test/tests/tomcat-hello-world/run.sh b/test/tests/tomcat-hello-world/run.sh index 8319da0616d13..c0dcc8a71719f 100755 --- a/test/tests/tomcat-hello-world/run.sh +++ b/test/tests/tomcat-hello-world/run.sh @@ -7,6 +7,10 @@ image="$1" # Use a client image with curl for testing clientImage='buildpack-deps:buster-curl' +# ensure the clientImage is ready and available +if ! docker image inspect "$clientImage" &> /dev/null; then + docker pull "$clientImage" > /dev/null +fi serverImage="$("$dir/../image-name.sh" librarytest/tomcat-hello-world "$image")" "$dir/../docker-build.sh" "$dir" "$serverImage" < /dev/null; then + docker pull "$clientImage" > /dev/null +fi mysqlImage='mysql:5.7' +# ensure the mysqlImage is ready and available +if ! docker image inspect "$mysqlImage" &> /dev/null; then + docker pull "$mysqlImage" > /dev/null +fi serverImage="$1" # Create an instance of the container-under-test diff --git a/test/tests/wordpress-fpm-run/run.sh b/test/tests/wordpress-fpm-run/run.sh index 14f716b9e0763..b459a8e2f5f4f 100755 --- a/test/tests/wordpress-fpm-run/run.sh +++ b/test/tests/wordpress-fpm-run/run.sh @@ -16,6 +16,10 @@ ENTRYPOINT ["cgi-fcgi"] EOF mysqlImage='mysql:5.7' +# ensure the mysqlImage is ready and available +if ! docker image inspect "$mysqlImage" &> /dev/null; then + docker pull "$mysqlImage" > /dev/null +fi # Create an instance of the container-under-test mysqlCid="$(docker run -d -e MYSQL_ROOT_PASSWORD="test-$RANDOM-password-$RANDOM-$$" "$mysqlImage")"