[multipass] add latest 26.04 as default for tests

This commit is contained in:
Luis Guzmán 2026-03-31 00:12:00 -06:00
parent 077ec86d47
commit 0d20c4860a
1 changed files with 16 additions and 9 deletions

View File

@ -7,6 +7,7 @@
# --clean Stop+delete+purge target VMs (by BASE-<number>, regardless of COUNT)
# Distro selection:
# --debian-13 Debian 13 only (sets IMAGE=$DEBIAN13_IMAGE_URL and BASE=deb13)
# --ubuntu-release VER Use specific Ubuntu release (e.g., 24.04, 26.04); sets IMAGE and BASE dynamically
# --both-distros Run Ubuntu + Debian 13 in parallel: COUNT=N => 2N VMs (default order: interleaved)
# --first-ubuntu (with --both-distros) order: all Ubuntu first, then all Debian
# --first-debian (with --both-distros) order: all Debian first, then all Ubuntu
@ -46,8 +47,8 @@ SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
# Source: Debian cloud images live under cloud.debian.org/images/cloud/ ('genericcloud' includes cloud-init).
DEBIAN13_IMAGE_URL="${DEBIAN13_IMAGE_URL:-https://cloud.debian.org/images/cloud/trixie/latest/debian-13-genericcloud-${DPKG_ARCH}.qcow2}"
IMAGE="${IMAGE:-24.04}"
BASE="${BASE:-ubu2404}"
IMAGE="${IMAGE:-26.04}"
BASE="${BASE:-ubu2604}"
# cloud-init controls
CLOUD_INIT_FILE="${CLOUD_INIT_FILE:-}"
RPIOS_CLOUD_INIT_FILE="${RPIOS_CLOUD_INIT_FILE:-$SCRIPT_DIR/cloud-init-rpios-like-arm64.yaml}"
@ -100,6 +101,7 @@ Aliases:
--test-pr N (same as --run-pr N)
Image shortcuts:
--debian-13 Use Debian 13 cloud image; sets IMAGE=\$DEBIAN13_IMAGE_URL and BASE=deb13
--ubuntu-release VER Use specific Ubuntu release (e.g., 24.04, 26.04); sets IMAGE and BASE dynamically
--both-distros Run both Ubuntu + Debian 13 (COUNT=N => N + N VMs)
--first-ubuntu With --both-distros: run all Ubuntu first, then Debian
--first-debian With --both-distros: run all Debian first, then Ubuntu
@ -132,6 +134,12 @@ while [[ $# -gt 0 ]]; do
[[ $# -lt 2 ]] && { echo "[ERROR] --cloud-init needs a file path"; exit 2; }
CLOUD_INIT_FILE="$2"; shift 2 ;;
--ubuntu-release)
[[ $# -lt 2 ]] && { echo "[ERROR] --ubuntu-release needs a version (e.g. 24.04 or 26.04)"; exit 2; }
IMAGE="$2"
BASE="ubu${2//./}"
shift 2 ;;
--debian-13)
DEBIAN13_ONLY=1
IMAGE="$DEBIAN13_IMAGE_URL"
@ -231,7 +239,9 @@ else
DEB_BASE="deb13"
fi
LOGROOT="${LOGROOT:-iiab_multipass_runs_$(date +%Y%m%d)}"
LOG_MONTH="$(date +%Y%m)"
LOG_RUN="$(date +%Y%m%d_%H%M%S)"
LOGROOT="${LOGROOT:-iiab_multipass_runs_${LOG_MONTH}/${LOG_RUN}}"
mkdir -p "$LOGROOT"
echo "[INFO] Logging files stored at: $LOGROOT"
@ -346,15 +356,12 @@ clean_targets() {
local list
list="$(multipass list 2>/dev/null | awk 'NR>1 {print $1}' || true)"
# Regex modified to catch any Ubuntu base (ubu followed by 4 digits) or the Debian base
if [[ "$BOTH_DISTROS" == "1" ]]; then
local ubu_re deb_re
ubu_re="$(re_escape "$UBU_BASE")"
deb_re="$(re_escape "$DEB_BASE")"
printf '%s\n' "$list" | grep -E "^(${ubu_re}|${deb_re})-[0-9]+$" || true
printf '%s\n' "$list" | grep -E "^(ubu[0-9]{4}|${deb_re})-[0-9]+$" || true
else
local base_re
base_re="$(re_escape "$BASE")"
printf '%s\n' "$list" | grep -E "^${base_re}-[0-9]+$" || true
printf '%s\n' "$list" | grep -E "^(ubu[0-9]{4}|deb13|rpios-d13)-[0-9]+$" || true
fi
}