test_images.sh (2476B)
1 # test/lib/test_images.sh — pinned per-arch container images for hermetic 2 # cross-arch test execution. Sourced by test/lib/exec_target.sh (the run path) 3 # and test/lib/pull_test_images.sh (the provisioning path). 4 # 5 # The compiler test harnesses run kit-emitted ELF binaries inside a container 6 # under qemu-user. To keep ALL network off the main test path, every `podman 7 # run` uses --pull=never against these LOCAL images, which must be provisioned 8 # ahead of time with `make test-images` (the one network-touching step). 9 # 10 # Each arch is pinned to its OWN content-addressed image digest under 11 # docker.io/library/alpine. Because the references are content digests rather 12 # than the shared, mutable `alpine:latest` tag, pulling one arch can NEVER 13 # clobber another arch's rootfs in local storage — that wrong-arch-manifest 14 # trap (a `--platform riscv64` pull retagging the local `alpine:latest` to the 15 # riscv64 image, so a later `--platform amd64 --pull=never` run executes against 16 # the riscv64 rootfs) is what this scheme exists to prevent. 17 # 18 # Pin: alpine 3.23.4, manifest list 19 # docker.io/library/alpine@sha256:5b10f432ef3da1b8d4c7eb6c487f2f5a8f096bc91145e68878dd4a5019afde11 20 # To bump the pin: `podman manifest inspect <new alpine ref>` and replace the 21 # three per-arch image digests below (the `application/vnd.*.manifest.v1+json` 22 # entry for each architecture). 23 24 # Per-arch pins. `:=` so an explicit RUN_<ARCH>_IMAGE override from the caller 25 # (e.g. test/asm/hostas_cross.sh, which needs a glibc/edge variant) still wins. 26 : "${RUN_AARCH64_IMAGE:=docker.io/library/alpine@sha256:378c4c5418f7493bd500ad21ffb43818d0689daaad43e3261859fb417d1481a0}" 27 : "${RUN_X64_IMAGE:=docker.io/library/alpine@sha256:4d889c14e7d5a73929ab00be2ef8ff22437e7cbc545931e52554a7b00e123d8b}" 28 : "${RUN_RV64_IMAGE:=docker.io/library/alpine@sha256:667d07bf2f6239f094f64b5682c8ffbe24c9f3139b1fb854f85caf931a3d7439}" 29 30 # arch token ("aa64"/"aarch64"/"x64"/"rv64") -> pinned image reference. Both the 31 # short canonical token (aa64, used by the rt/bounce corpora) and the long form 32 # (aarch64, used by the provisioning path) map to the arm64 image. 33 kit_test_image_for_arch() { 34 case "$1" in 35 aa64|aarch64) printf '%s' "$RUN_AARCH64_IMAGE" ;; 36 x64) printf '%s' "$RUN_X64_IMAGE" ;; 37 rv64) printf '%s' "$RUN_RV64_IMAGE" ;; 38 *) printf '' ;; 39 esac 40 } 41 42 # The arches provisioned/runnable through a container. 43 KIT_TEST_ARCHES="aarch64 x64 rv64"