File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
77BATS=${SCRIPTPATH} /../../hack/tools/bin/bats
88PATH=$PATH :${SCRIPTPATH} /../../hack/tools/bin
99
10+ # Pre-download Docker images before running tests
11+ echo " Setting up Docker images..."
12+ ${SCRIPTPATH} /setup_images.sh
13+
1014tests=(" pushpull" " pushpull_authn" " delete_images" " referrers" " metadata" " anonymous_policy"
1115 " annotations" " detect_manifest_collision" " cve" " sync" " sync_docker" " sync_replica_cluster"
1216 " scrub" " garbage_collect" " metrics" " metrics_minimal" " multiarch_index" " docker_compat" " redis_local" " redis_session_store"
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Pre-download Docker images used in blackbox tests
4+ # This script ensures all required images are available before tests start
5+
6+ set -e
7+
8+ echo " Pre-downloading Docker images for blackbox tests..."
9+
10+ # List of images used in the tests
11+ IMAGES=(
12+ " nats:2.11.1"
13+ " natsio/nats-box:latest"
14+ " python:3"
15+ " redis:latest"
16+ )
17+
18+ # Function to download an image if not already present
19+ download_image () {
20+ local image=" $1 "
21+ echo " Checking for image: $image "
22+
23+ if docker image inspect " $image " > /dev/null 2>&1 ; then
24+ echo " ✓ Image $image already exists"
25+ else
26+ echo " Downloading image: $image "
27+ if docker pull " $image " ; then
28+ echo " ✓ Successfully downloaded $image "
29+ else
30+ echo " ✗ Failed to download $image "
31+ return 1
32+ fi
33+ fi
34+ }
35+
36+ # Download all images
37+ for image in " ${IMAGES[@]} " ; do
38+ download_image " $image "
39+ done
40+
41+ echo " All Docker images are ready for testing!"
You can’t perform that action at this time.
0 commit comments