#!/usr/bin/env bash # This script is only intended to be run inside the lima VM to configure it and start the tests. # Do not run locally. set -eo pipefail SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" && pwd ) source "$SCRIPT_DIR/lib.sh" parse_args "$@" PRESERVE_ENVS="CI_USE_REGISTRY_CACHE,CI_DESIRED_COMPOSEFS,OCI_RUNTIME,CGROUP_MANAGER,STORAGE_FS,STORAGE_OPTIONS_OVERLAY,STORAGE_OPTIONS_VFS,PODMAN_UPGRADE_FROM" # run as root or or not SUDO="" if [[ "$PRIV" == "root" ]]; then SUDO="sudo --non-interactive --preserve-env=$PRESERVE_ENVS" fi STORAGE_FS=overlay case "$DISTRO_NAME" in fedora-current) ;; fedora-prior) STORAGE_FS=vfs ;; fedora-rawhide) # On rawhide enable composefs testing CI_DESIRED_COMPOSEFS="composefs" # Enable sequoia testing TEST_BUILD_TAGS="containers_image_sequoia" # mount a tmpfs for the container storage. This is a work around for the staging pull composefs flake. # FIXME: https://github.com/containers/podman/issues/28813 sudo mount -t tmpfs -o size=75%,mode=0700 none /var/lib/containers ;; debian-sid) ;; *) die "Unknown DISTRO_NAME passed $DISTRO_NAME" ;; esac # As of July 2024, CI VMs come built-in with a registry. LCR=/var/cache/local-registry/local-cache-registry if [[ -x $LCR ]]; then # Images in cache registry are prepopulated at the time # VMs are built. If any PR adds a dependency on new images, # those must be fetched now, at VM start time. This should # be rare, and must be fixed in next automation images build. while read new_image; do $LCR cache $new_image done < <(grep '^[^#]' test/NEW-IMAGES || true) fi ## Used in tests so we need to export them export STORAGE_FS export CI_DESIRED_COMPOSEFS ### SETUP HERE # Custom storage.conf setup to test different drivers conf=/etc/containers/storage.conf if [[ -e $conf ]]; then die "FATAL! INTERNAL ERROR! Cannot override $conf" fi sudo tee $conf <