@@ -25,8 +25,6 @@ RUNTIME_BINARY="${RUNTIME_BINARY:-/usr/bin/runc}"
2525
2626# UBI10-micro container image for test rootfs
2727UBI10_MICRO_IMAGE=" registry.access.redhat.com/ubi10/ubi-micro:latest"
28- ROOTFS_CACHE_DIR=" /tmp/conmon-test-images"
29- ROOTFS_CACHE_MARKER=" /tmp/conmon-test-images/.ubi10-micro-cached"
3028VALID_PATH=" /tmp"
3129INVALID_PATH=" /not/a/path"
3230
@@ -35,23 +33,12 @@ generate_ctr_id() {
3533 echo " conmon-test-$( date +%s) -$$ -$RANDOM "
3634}
3735
38- # Cache UBI10-micro rootfs for container tests
39- cache_ubi10_rootfs () {
40- if [[ -f " $ROOTFS_CACHE_MARKER " ]]; then
41- return 0
42- fi
43-
44- mkdir -p " $ROOTFS_CACHE_DIR "
45-
36+ # Pull UBI10-micro rootfs for container tests
37+ pull_ubi10_rootfs () {
4638 # Pull UBI10-micro image if not already present
47- if ! podman image exists " $UBI10_MICRO_IMAGE " 2> /dev/null; then
48- if ! podman pull " $UBI10_MICRO_IMAGE " > /dev/null 2>&1 ; then
49- skip " Failed to pull UBI10-micro image"
50- fi
39+ if ! podman pull --policy=newer " $UBI10_MICRO_IMAGE " > /dev/null 2>&1 ; then
40+ skip " Failed to pull UBI10-micro image"
5141 fi
52-
53- # Mark as cached
54- touch " $ROOTFS_CACHE_MARKER "
5542}
5643
5744# Run conmon with given arguments and capture output
@@ -340,8 +327,8 @@ setup_container_env() {
340327 local use_terminal=" $2 "
341328 setup_test_env
342329
343- # Cache UBI10-micro image
344- cache_ubi10_rootfs
330+ # Pull UBI10-micro image
331+ pull_ubi10_rootfs
345332
346333 # Create the rootfs directory
347334 mkdir -p " $ROOTFS "
0 commit comments