From dfa1ca4e9f919a1ccfcb416a678a1f018fa732f5 Mon Sep 17 00:00:00 2001 From: Alejandro Gullon Date: Fri, 30 Jan 2026 13:25:25 +0100 Subject: [PATCH 1/2] USHIFT-6073: Add Z-1 upgrade path for release testing scenarios This PR adds the capability to test Z-stream upgrades (e.g., 4.22.0 -> 4.22.7) in addition to the existing Y-stream upgrade tests (e.g., 4.21 -> 4.22). Changes include: - Add PREV_ZSTREAM version variables for tracking the first/previous z-stream of the current minor release - Add bootc containerfile and scenario files for Z-1 upgrade testing - Rename variables from confusing Y0/Z1/Y1/Y2 pattern to clearer naming: - LATEST_ZSTREAM_VERSION: Latest z-stream of current minor - PREV_ZSTREAM_VERSION: Previous z-stream of current minor (Z-1 upgrade source) - YMINUS1_VERSION: Latest z-stream of Y-1 minor - YMINUS2_VERSION: Latest z-stream of Y-2 minor - Add documentation comments explaining the version naming convention rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED --- test/assets/common_versions.sh.template | 40 +++-- test/bin/build_images.sh | 6 +- test/bin/build_rpms.sh | 12 +- test/bin/common.sh | 18 +- test/bin/common_versions.sh | 40 +++-- test/bin/manage_brew_rpms.sh | 154 +++++++++++++++--- test/bin/pyutils/build_bootc_images.py | 24 +-- ...w-prev-zstream-with-optional.containerfile | 48 ++++++ ...-bootc-brew-y1-with-optional.containerfile | 8 +- ...-bootc-brew-y2-with-optional.containerfile | 8 +- .../group1/rhel96-brew-y2-with-optionals.toml | 10 +- .../group2/rhel96-brew-y1-with-optionals.toml | 10 +- .../group3/rhel96-brew-lrel-optional.toml | 2 +- .../group3/rhel96-brew-lrel-tuned.toml | 2 +- .../rhel96-brew-nightly-with-optionals.toml | 2 +- .../rhel96-brew-lrel-optional.image-installer | 2 +- .../el96-prev-zstream@el96-lrel@standard1.sh | 37 +++++ .../el96-prev-zstream@el96-lrel@standard2.sh | 36 ++++ 18 files changed, 371 insertions(+), 88 deletions(-) create mode 100644 test/image-blueprints-bootc/layer5-release/group1/rhel96-bootc-brew-prev-zstream-with-optional.containerfile create mode 100644 test/scenarios-bootc/releases/el96-prev-zstream@el96-lrel@standard1.sh create mode 100644 test/scenarios-bootc/releases/el96-prev-zstream@el96-lrel@standard2.sh diff --git a/test/assets/common_versions.sh.template b/test/assets/common_versions.sh.template index 08a97db286..3e7ddd1414 100644 --- a/test/assets/common_versions.sh.template +++ b/test/assets/common_versions.sh.template @@ -142,22 +142,40 @@ export CNCF_SYSTEMD_LOGS_VERSION={CNCF_SYSTEMD_LOGS_VERSION} export GITOPS_VERSION={GITOPS_VERSION} # The brew release versions needed for release regression testing -BREW_Y0_RELEASE_VERSION="$(get_vrel_from_rpm "${{BREW_RPM_SOURCE}}/4.${{MINOR_VERSION}}-zstream/{ARCH}/")" -BREW_Y1_RELEASE_VERSION="$(get_vrel_from_rpm "${{BREW_RPM_SOURCE}}/4.${{PREVIOUS_MINOR_VERSION}}-zstream/{ARCH}/")" -BREW_Y2_RELEASE_VERSION="$(get_vrel_from_rpm "${{BREW_RPM_SOURCE}}/4.${{YMINUS2_MINOR_VERSION}}-zstream/{ARCH}/")" -BREW_RC_RELEASE_VERSION="$(get_vrel_from_rpm "${{BREW_RPM_SOURCE}}/4.${{MINOR_VERSION}}-rc/{ARCH}/")" -BREW_EC_RELEASE_VERSION="$(get_vrel_from_rpm "${{BREW_RPM_SOURCE}}/4.${{MINOR_VERSION}}-ec/{ARCH}/")" -BREW_NIGHTLY_RELEASE_VERSION="$(get_vrel_from_rpm "${{BREW_RPM_SOURCE}}/4.${{MINOR_VERSION}}-nightly/{ARCH}/")" -export BREW_Y0_RELEASE_VERSION -export BREW_Y1_RELEASE_VERSION -export BREW_Y2_RELEASE_VERSION +# +# Version naming convention (for X.Y.Z format where X=major, Y=minor, Z=patch): +# - LATEST_ZSTREAM: Latest z-stream of current minor (e.g., 4.22.7) - for current release testing +# - PREV_ZSTREAM: Previous z-stream of current minor (e.g., 4.22.4) - for previous Z upgrade testing +# - YMINUS1: Latest z-stream of previous minor (e.g., 4.21.26) - for Y-1 upgrade testing +# - YMINUS2: Latest z-stream of Y-2 minor (e.g., 4.20.44) - for Y-2 upgrade testing +# +LATEST_ZSTREAM_VERSION="$(find "${{BREW_RPM_SOURCE}}" -maxdepth 1 -type d -regex ".*/[45]\.${{MINOR_VERSION}}\.[0-9]+$" -printf '%f\n' | sort -V | tail -n1 || echo "")" +PREV_ZSTREAM_VERSION="$(find "${{BREW_RPM_SOURCE}}" -maxdepth 1 -type d -regex ".*/[45]\.${{MINOR_VERSION}}\.[0-9]+$" -printf '%f\n' | sort -V | head -n1 || echo "")" +YMINUS1_VERSION="$(find "${{BREW_RPM_SOURCE}}" -maxdepth 1 -type d -regex ".*/[45]\.${{PREVIOUS_MINOR_VERSION}}\.[0-9]+$" -printf '%f\n' | sort -V | tail -n1 || echo "")" +YMINUS2_VERSION="$(find "${{BREW_RPM_SOURCE}}" -maxdepth 1 -type d -regex ".*/[45]\.${{YMINUS2_MINOR_VERSION}}\.[0-9]+$" -printf '%f\n' | sort -V | tail -n1 || echo "")" +RC_VERSION="$(find "${{BREW_RPM_SOURCE}}" -maxdepth 1 -type d -regex ".*/[45]\.${{MINOR_VERSION}}\.[0-9]*-rc$" -printf '%f\n' | sort -V | tail -n1 || echo "")" +EC_VERSION="$(find "${{BREW_RPM_SOURCE}}" -maxdepth 1 -type d -regex ".*/[45]\.${{MINOR_VERSION}}\.[0-9]*-ec$" -printf '%f\n' | sort -V | tail -n1 || echo "")" +NIGHTLY_VERSION="$(find "${{BREW_RPM_SOURCE}}" -maxdepth 1 -type d -regex ".*/[45]\.${{MINOR_VERSION}}\.[0-9]*-nightly$" -printf '%f\n' | sort -V | tail -n1 || echo "")" + +BREW_LATEST_ZSTREAM_VERSION="$(get_vrel_from_rpm "${{BREW_RPM_SOURCE}}/${{LATEST_ZSTREAM_VERSION}}/{ARCH}/")" +BREW_PREV_ZSTREAM_VERSION="$(get_vrel_from_rpm "${{BREW_RPM_SOURCE}}/${{PREV_ZSTREAM_VERSION}}/{ARCH}/")" +BREW_YMINUS1_VERSION="$(get_vrel_from_rpm "${{BREW_RPM_SOURCE}}/${{YMINUS1_VERSION}}/{ARCH}/")" +BREW_YMINUS2_VERSION="$(get_vrel_from_rpm "${{BREW_RPM_SOURCE}}/${{YMINUS2_VERSION}}/{ARCH}/")" +BREW_RC_RELEASE_VERSION="$(get_vrel_from_rpm "${{BREW_RPM_SOURCE}}/${{RC_VERSION}}/{ARCH}/")" +BREW_EC_RELEASE_VERSION="$(get_vrel_from_rpm "${{BREW_RPM_SOURCE}}/${{EC_VERSION}}/{ARCH}/")" +BREW_NIGHTLY_RELEASE_VERSION="$(get_vrel_from_rpm "${{BREW_RPM_SOURCE}}/${{NIGHTLY_VERSION}}/{ARCH}/")" + +export BREW_LATEST_ZSTREAM_VERSION +export BREW_PREV_ZSTREAM_VERSION +export BREW_YMINUS1_VERSION +export BREW_YMINUS2_VERSION export BREW_RC_RELEASE_VERSION export BREW_EC_RELEASE_VERSION export BREW_NIGHTLY_RELEASE_VERSION # Set the release type based on priority: zstream > RC > EC > nightly -if [ -n "${{BREW_Y0_RELEASE_VERSION}}" ]; then - BREW_LREL_RELEASE_VERSION="${{BREW_Y0_RELEASE_VERSION}}" +if [ -n "${{BREW_LATEST_ZSTREAM_VERSION}}" ]; then + BREW_LREL_RELEASE_VERSION="${{BREW_LATEST_ZSTREAM_VERSION}}" elif [ -n "${{BREW_RC_RELEASE_VERSION}}" ]; then BREW_LREL_RELEASE_VERSION="${{BREW_RC_RELEASE_VERSION}}" elif [ -n "${{BREW_EC_RELEASE_VERSION}}" ]; then diff --git a/test/bin/build_images.sh b/test/bin/build_images.sh index 7a30a997d1..1eb95eb915 100755 --- a/test/bin/build_images.sh +++ b/test/bin/build_images.sh @@ -721,9 +721,9 @@ if ${EXTRACT_CONTAINER_IMAGES}; then extract_container_images "${PREVIOUS_RELEASE_VERSION}" "${PREVIOUS_RELEASE_REPO}" "${CONTAINER_LIST}" extract_container_images "${YMINUS2_RELEASE_VERSION}" "${YMINUS2_RELEASE_REPO}" "${CONTAINER_LIST}" # The following images are specific to the brew release versions. - [ -n "${BREW_Y0_RELEASE_VERSION}" ] && extract_container_images "${BREW_Y0_RELEASE_VERSION}" "${BREW_REPO}" "${CONTAINER_LIST}" - [ -n "${BREW_Y1_RELEASE_VERSION}" ] && extract_container_images "${BREW_Y1_RELEASE_VERSION}" "${BREW_REPO}" "${CONTAINER_LIST}" - [ -n "${BREW_Y2_RELEASE_VERSION}" ] && extract_container_images "${BREW_Y2_RELEASE_VERSION}" "${BREW_REPO}" "${CONTAINER_LIST}" + [ -n "${BREW_LATEST_ZSTREAM_VERSION}" ] && extract_container_images "${BREW_LATEST_ZSTREAM_VERSION}" "${BREW_REPO}" "${CONTAINER_LIST}" + [ -n "${BREW_YMINUS1_VERSION}" ] && extract_container_images "${BREW_YMINUS1_VERSION}" "${BREW_REPO}" "${CONTAINER_LIST}" + [ -n "${BREW_YMINUS2_VERSION}" ] && extract_container_images "${BREW_YMINUS2_VERSION}" "${BREW_REPO}" "${CONTAINER_LIST}" [ -n "${BREW_RC_RELEASE_VERSION}" ] && extract_container_images "${BREW_RC_RELEASE_VERSION}" "${BREW_REPO}" "${CONTAINER_LIST}" [ -n "${BREW_EC_RELEASE_VERSION}" ] && extract_container_images "${BREW_EC_RELEASE_VERSION}" "${BREW_REPO}" "${CONTAINER_LIST}" [ -n "${BREW_NIGHTLY_RELEASE_VERSION}" ] && extract_container_images "${BREW_NIGHTLY_RELEASE_VERSION}" "${BREW_REPO}" "${CONTAINER_LIST}" diff --git a/test/bin/build_rpms.sh b/test/bin/build_rpms.sh index c4c343ae52..4158682cc9 100755 --- a/test/bin/build_rpms.sh +++ b/test/bin/build_rpms.sh @@ -121,12 +121,12 @@ download_brew_rpms() { rm -rf "${BREW_RPM_SOURCE}" # Run the download procedure bash -x "${SCRIPTDIR}/../../scripts/fetch_tools.sh" brew - bash -x "${SCRIPTDIR}/manage_brew_rpms.sh" download "4.${MINOR_VERSION}" "${BREW_RPM_SOURCE}" "zstream" || true - bash -x "${SCRIPTDIR}/manage_brew_rpms.sh" download "4.${PREVIOUS_MINOR_VERSION}" "${BREW_RPM_SOURCE}" "zstream" || true - bash -x "${SCRIPTDIR}/manage_brew_rpms.sh" download "4.${YMINUS2_MINOR_VERSION}" "${BREW_RPM_SOURCE}" "zstream" || true - bash -x "${SCRIPTDIR}/manage_brew_rpms.sh" download "4.${MINOR_VERSION}" "${BREW_RPM_SOURCE}" "rc" || true - bash -x "${SCRIPTDIR}/manage_brew_rpms.sh" download "4.${MINOR_VERSION}" "${BREW_RPM_SOURCE}" "ec" || true - bash -x "${SCRIPTDIR}/manage_brew_rpms.sh" download "4.${MINOR_VERSION}" "${BREW_RPM_SOURCE}" "nightly" || true + bash -x "${SCRIPTDIR}/manage_brew_rpms.sh" download "4.${MINOR_VERSION}" "${BREW_RPM_SOURCE}" "rc" || echo "WARNING: Failed to download RC RPMs for 4.${MINOR_VERSION}" + bash -x "${SCRIPTDIR}/manage_brew_rpms.sh" download "4.${MINOR_VERSION}" "${BREW_RPM_SOURCE}" "ec" || echo "WARNING: Failed to download EC RPMs for 4.${MINOR_VERSION}" + bash -x "${SCRIPTDIR}/manage_brew_rpms.sh" download "4.${MINOR_VERSION}" "${BREW_RPM_SOURCE}" "zstream" || echo "WARNING: Failed to download zstream RPMs for 4.${MINOR_VERSION}" + bash -x "${SCRIPTDIR}/manage_brew_rpms.sh" download "4.${MINOR_VERSION}" "${BREW_RPM_SOURCE}" "nightly" || echo "WARNING: Failed to download nightly RPMs for 4.${MINOR_VERSION}" + bash -x "${SCRIPTDIR}/manage_brew_rpms.sh" download "4.${PREVIOUS_MINOR_VERSION}" "${BREW_RPM_SOURCE}" "zstream" || echo "WARNING: Failed to download zstream RPMs for 4.${PREVIOUS_MINOR_VERSION}" + bash -x "${SCRIPTDIR}/manage_brew_rpms.sh" download "4.${YMINUS2_MINOR_VERSION}" "${BREW_RPM_SOURCE}" "zstream" || ( echo "WARNING: Failed to download zstream RPMs for 4.${YMINUS2_MINOR_VERSION}" && return 1 ) else echo "WARNING: The Brew Hub site is not accessible, skipping the download" fi diff --git a/test/bin/common.sh b/test/bin/common.sh index 3a29c0cf58..a3367b8451 100644 --- a/test/bin/common.sh +++ b/test/bin/common.sh @@ -370,6 +370,8 @@ MICROSHIFT_MANDATORY_RPMS_LIST=( microshift microshift-release-info ) + +## Optional RPMs MICROSHIFT_Y2_OPTIONAL_RPMS_LIST=( microshift-olm microshift-olm-release-info @@ -387,9 +389,14 @@ MICROSHIFT_Y1_OPTIONAL_RPMS_LIST=( microshift-sriov microshift-sriov-release-info ) -MICROSHIFT_OPTIONAL_RPMS_LIST=( +MICROSHIFT_PREV_ZSTREAM_OPTIONAL_RPMS_LIST=( "${MICROSHIFT_Y1_OPTIONAL_RPMS_LIST[@]}" ) +MICROSHIFT_OPTIONAL_RPMS_LIST=( + "${MICROSHIFT_PREV_ZSTREAM_OPTIONAL_RPMS_LIST[@]}" +) + +## x86_64 RPMs MICROSHIFT_Y2_X86_64_RPMS_LIST=( microshift-ai-model-serving microshift-ai-model-serving-release-info @@ -397,14 +404,21 @@ MICROSHIFT_Y2_X86_64_RPMS_LIST=( MICROSHIFT_Y1_X86_64_RPMS_LIST=( "${MICROSHIFT_Y2_X86_64_RPMS_LIST[@]}" ) +MICROSHIFT_PREV_ZSTREAM_X86_64_RPMS_LIST=( + "${MICROSHIFT_Y2_X86_64_RPMS_LIST[@]}" +) MICROSHIFT_X86_64_RPMS_LIST=( - "${MICROSHIFT_Y1_X86_64_RPMS_LIST[@]}" + "${MICROSHIFT_PREV_ZSTREAM_X86_64_RPMS_LIST[@]}" ) export MICROSHIFT_MANDATORY_RPMS="${MICROSHIFT_MANDATORY_RPMS_LIST[*]}" + export MICROSHIFT_Y2_OPTIONAL_RPMS="${MICROSHIFT_Y2_OPTIONAL_RPMS_LIST[*]}" export MICROSHIFT_Y1_OPTIONAL_RPMS="${MICROSHIFT_Y1_OPTIONAL_RPMS_LIST[*]}" +export MICROSHIFT_PREV_ZSTREAM_OPTIONAL_RPMS="${MICROSHIFT_PREV_ZSTREAM_OPTIONAL_RPMS_LIST[*]}" export MICROSHIFT_OPTIONAL_RPMS="${MICROSHIFT_OPTIONAL_RPMS_LIST[*]}" + export MICROSHIFT_Y2_X86_64_RPMS="${MICROSHIFT_Y2_X86_64_RPMS_LIST[*]}" export MICROSHIFT_Y1_X86_64_RPMS="${MICROSHIFT_Y1_X86_64_RPMS_LIST[*]}" +export MICROSHIFT_PREV_ZSTREAM_X86_64_RPMS="${MICROSHIFT_PREV_ZSTREAM_X86_64_RPMS_LIST[*]}" export MICROSHIFT_X86_64_RPMS="${MICROSHIFT_X86_64_RPMS_LIST[*]}" diff --git a/test/bin/common_versions.sh b/test/bin/common_versions.sh index b0e2196885..53ae7e7093 100644 --- a/test/bin/common_versions.sh +++ b/test/bin/common_versions.sh @@ -142,22 +142,40 @@ export CNCF_SYSTEMD_LOGS_VERSION=v0.4 export GITOPS_VERSION=1.16 # The brew release versions needed for release regression testing -BREW_Y0_RELEASE_VERSION="$(get_vrel_from_rpm "${BREW_RPM_SOURCE}/4.${MINOR_VERSION}-zstream/${UNAME_M}/")" -BREW_Y1_RELEASE_VERSION="$(get_vrel_from_rpm "${BREW_RPM_SOURCE}/4.${PREVIOUS_MINOR_VERSION}-zstream/${UNAME_M}/")" -BREW_Y2_RELEASE_VERSION="$(get_vrel_from_rpm "${BREW_RPM_SOURCE}/4.${YMINUS2_MINOR_VERSION}-zstream/${UNAME_M}/")" -BREW_RC_RELEASE_VERSION="$(get_vrel_from_rpm "${BREW_RPM_SOURCE}/4.${MINOR_VERSION}-rc/${UNAME_M}/")" -BREW_EC_RELEASE_VERSION="$(get_vrel_from_rpm "${BREW_RPM_SOURCE}/4.${MINOR_VERSION}-ec/${UNAME_M}/")" -BREW_NIGHTLY_RELEASE_VERSION="$(get_vrel_from_rpm "${BREW_RPM_SOURCE}/4.${MINOR_VERSION}-nightly/${UNAME_M}/")" -export BREW_Y0_RELEASE_VERSION -export BREW_Y1_RELEASE_VERSION -export BREW_Y2_RELEASE_VERSION +# +# Version naming convention (for X.Y.Z format where X=major, Y=minor, Z=patch): +# - LATEST_ZSTREAM: Latest z-stream of current minor (e.g., 4.22.7) - for current release testing +# - PREV_ZSTREAM: Previous z-stream of current minor (e.g., 4.22.4) - for previous Z upgrade testing +# - YMINUS1: Latest z-stream of previous minor (e.g., 4.21.26) - for Y-1 upgrade testing +# - YMINUS2: Latest z-stream of Y-2 minor (e.g., 4.20.44) - for Y-2 upgrade testing +# +LATEST_ZSTREAM_VERSION="$(find "${BREW_RPM_SOURCE}" -maxdepth 1 -type d -regex ".*/[45]\.${MINOR_VERSION}\.[0-9]+$" -printf '%f\n' | sort -V | tail -n1 || echo "")" +PREV_ZSTREAM_VERSION="$(find "${BREW_RPM_SOURCE}" -maxdepth 1 -type d -regex ".*/[45]\.${MINOR_VERSION}\.[0-9]+$" -printf '%f\n' | sort -V | head -n1 || echo "")" +YMINUS1_VERSION="$(find "${BREW_RPM_SOURCE}" -maxdepth 1 -type d -regex ".*/[45]\.${PREVIOUS_MINOR_VERSION}\.[0-9]+$" -printf '%f\n' | sort -V | tail -n1 || echo "")" +YMINUS2_VERSION="$(find "${BREW_RPM_SOURCE}" -maxdepth 1 -type d -regex ".*/[45]\.${YMINUS2_MINOR_VERSION}\.[0-9]+$" -printf '%f\n' | sort -V | tail -n1 || echo "")" +RC_VERSION="$(find "${BREW_RPM_SOURCE}" -maxdepth 1 -type d -regex ".*/[45]\.${MINOR_VERSION}\.[0-9]*-rc$" -printf '%f\n' | sort -V | tail -n1 || echo "")" +EC_VERSION="$(find "${BREW_RPM_SOURCE}" -maxdepth 1 -type d -regex ".*/[45]\.${MINOR_VERSION}\.[0-9]*-ec$" -printf '%f\n' | sort -V | tail -n1 || echo "")" +NIGHTLY_VERSION="$(find "${BREW_RPM_SOURCE}" -maxdepth 1 -type d -regex ".*/[45]\.${MINOR_VERSION}\.[0-9]*-nightly$" -printf '%f\n' | sort -V | tail -n1 || echo "")" + +BREW_LATEST_ZSTREAM_VERSION="$(get_vrel_from_rpm "${BREW_RPM_SOURCE}/${LATEST_ZSTREAM_VERSION}/${UNAME_M}/")" +BREW_PREV_ZSTREAM_VERSION="$(get_vrel_from_rpm "${BREW_RPM_SOURCE}/${PREV_ZSTREAM_VERSION}/${UNAME_M}/")" +BREW_YMINUS1_VERSION="$(get_vrel_from_rpm "${BREW_RPM_SOURCE}/${YMINUS1_VERSION}/${UNAME_M}/")" +BREW_YMINUS2_VERSION="$(get_vrel_from_rpm "${BREW_RPM_SOURCE}/${YMINUS2_VERSION}/${UNAME_M}/")" +BREW_RC_RELEASE_VERSION="$(get_vrel_from_rpm "${BREW_RPM_SOURCE}/${RC_VERSION}/${UNAME_M}/")" +BREW_EC_RELEASE_VERSION="$(get_vrel_from_rpm "${BREW_RPM_SOURCE}/${EC_VERSION}/${UNAME_M}/")" +BREW_NIGHTLY_RELEASE_VERSION="$(get_vrel_from_rpm "${BREW_RPM_SOURCE}/${NIGHTLY_VERSION}/${UNAME_M}/")" + +export BREW_LATEST_ZSTREAM_VERSION +export BREW_PREV_ZSTREAM_VERSION +export BREW_YMINUS1_VERSION +export BREW_YMINUS2_VERSION export BREW_RC_RELEASE_VERSION export BREW_EC_RELEASE_VERSION export BREW_NIGHTLY_RELEASE_VERSION # Set the release type based on priority: zstream > RC > EC > nightly -if [ -n "${BREW_Y0_RELEASE_VERSION}" ]; then - BREW_LREL_RELEASE_VERSION="${BREW_Y0_RELEASE_VERSION}" +if [ -n "${BREW_LATEST_ZSTREAM_VERSION}" ]; then + BREW_LREL_RELEASE_VERSION="${BREW_LATEST_ZSTREAM_VERSION}" elif [ -n "${BREW_RC_RELEASE_VERSION}" ]; then BREW_LREL_RELEASE_VERSION="${BREW_RC_RELEASE_VERSION}" elif [ -n "${BREW_EC_RELEASE_VERSION}" ]; then diff --git a/test/bin/manage_brew_rpms.sh b/test/bin/manage_brew_rpms.sh index dc108a6888..9477a34bdc 100755 --- a/test/bin/manage_brew_rpms.sh +++ b/test/bin/manage_brew_rpms.sh @@ -5,9 +5,11 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Note: Avoid sourcing common.sh or common_version.sh in this script to allow # its execution in a containerized environment with limited set of tools. +UNAME_M="${UNAME_M:-$(uname -m)}" + usage() { echo "Usage: $(basename "$0") [access | download [version_type]]" - echo " download: Download the RPM version to the path as specified" + echo " download: Download the latest RPM packages for the given version, Z-1, Y-2 and Y-1 to the path as specified" echo " - version: the X.Y version. Example: 4.19" echo " - path: the output directory. Example: /_output/test-images/brew-rpms" echo " - version_type: Optional. Valid values: rc, ec, zstream and nightly. Default: nightly" @@ -29,33 +31,85 @@ action_access() { return ${rc} } -action_download() { +find_package() { local -r ver=$1 - local -r dir=$2 - local -r ver_type=${3:-nightly} + local -r ver_type=${2:-nightly} + local -r ver_prev_y=${3:-0} + local -r ver_prev_z=${4:-0} - if [ -z "${ver}" ] || [ -z "${dir}" ] ; then - echo "ERROR: At least two parameters (version and path) are required" - exit 1 + # Validate version format + if ! [[ "${ver}" =~ ^4\.[0-9]+(\.[0-9]+)?$ ]]; then + echo "ERROR: Version '${ver}' does not match required format 4.Y or 4.Y.Z (e.g., 4.20 or 4.20.1)" + return 1 fi - if ! action_access ; then - echo "ERROR: Brew Hub site is not accessible" - exit 1 + # Validate optional numeric parameters + if ! [[ "${ver_prev_y}" =~ ^[0-9]$ ]] || ! [[ "${ver_prev_z}" =~ ^[0-9]$ ]]; then + echo "ERROR: ver_prev_y '${ver_prev_y}' and ver_prev_z '${ver_prev_z}' must be a non-negative integer and less than 10" + return 1 fi - "${SCRIPTDIR}/../../scripts/fetch_tools.sh" brew - # Attempt downloading the specified build version - local package + # Extract version components + ver_x=$(echo "${ver}" | cut -d'.' -f1) + ver_y=$(echo "${ver}" | cut -d'.' -f2) + + # Calculate previous X.Y version + ver_y=$((ver_y - ver_prev_y)) + + local package="" + set +x case ${ver_type} in + zstream) + package_list=$(sudo dnf repoquery --quiet --repo "rhocp-${ver_x}.${ver_y}-for-rhel-9-${UNAME_M}-rpms" 2>/dev/null) || true + package_filtered=$(echo "${package_list}" | grep "microshift-0:" | sed 's/0://' | sed "s/.${UNAME_M}$//" | sort -V | uniq ) || true + if [ -z "${package_filtered}" ] ; then + package_list=$(brew list-builds --quiet --package=microshift --state=COMPLETE 2>/dev/null) || true + package_filtered=$(echo "${package_list}" | grep "^microshift-${ver_x}.${ver_y}" | grep -v "~" | sort -V | uniq ) || true + fi + package=$(echo "${package_filtered}" | tail -n$((1 + ver_prev_z)) | head -n1 | awk '{print $1}') || true + ;; nightly) - package=$(brew list-builds --quiet --package=microshift --state=COMPLETE | grep "^microshift-${ver}" | grep "nightly" | uniq | tail -n1) || true + package_list=$(brew list-builds --quiet --package=microshift --state=COMPLETE 2>/dev/null ) || true + package_filtered=$(echo "${package_list}" | grep "^microshift-${ver_x}.${ver_y}" | grep "nightly" | sort -V | uniq ) || true + package=$(echo "${package_filtered}" | tail -n1 | awk '{print $1}') || true + ;; + rc|ec) + package_list=$(brew list-builds --quiet --package=microshift --state=COMPLETE 2>/dev/null ) || true + package_filtered=$(echo "${package_list}" | grep "^microshift-${ver_x}.${ver_y}.0~${ver_type}." | sort -V | uniq ) || true + package=$(echo "${package_filtered}" | tail -n1 | awk '{print $1}') || true ;; + *) + echo "ERROR: Invalid version_type '${ver_type}'. Valid values are: rc, ec, zstream and nightly" + exit 1 + ;; + esac + set -x + echo "${package}" +} + +action_download() { + local -r ver=$1 + local -r main_dir=$2 + local -r ver_type=${3:-nightly} + + local -a package_list=() + + # Find the packages to download + # - package_latest: Latest z-stream of current minor (for current release testing) + # - package_prev: Previous z-stream of current minor (for Z-1 upgrade testing) + # - package_yminus1: Latest z-stream of previous minor (for Y-1 upgrade testing) + # - package_yminus2: Latest z-stream of Y-2 minor (for Y-2 upgrade testing) + case ${ver_type} in zstream) - package=$(brew list-builds --quiet --package=microshift --state=COMPLETE | grep "^microshift-${ver}" | grep -v "~" | uniq | tail -n1) || true + package_latest="$(find_package "${ver}" "${ver_type}" "0" "0")" + package_prev="$(find_package "${ver}" "${ver_type}" "0" "1")" + package_yminus1="$(find_package "${ver}" "${ver_type}" "1" "0")" + package_yminus2="$(find_package "${ver}" "${ver_type}" "2" "0")" + package_list=("${package_latest}" "${package_yminus1}" "${package_yminus2}" "${package_prev}") ;; - rc|ec) - package=$(brew list-builds --quiet --package=microshift --state=COMPLETE | grep "^microshift-${ver}.0~${ver_type}." | tail -n1) || true + nightly|rc|ec) + package_latest="$(find_package "${ver}" "${ver_type}")" + package_list=("${package_latest}") ;; *) echo "ERROR: Invalid version_type '${ver_type}'. Valid values are: rc, ec, zstream and nightly" @@ -63,21 +117,79 @@ action_download() { ;; esac + # Check at least one package is found + local all_empty=true + for package in "${package_list[@]}" ; do + if [ -n "${package}" ] ; then + all_empty=false + break + fi + done + if ${all_empty} ; then + echo "ERROR: No packages found for ${ver} ${ver_type}" + return 1 + fi + + # Download the packages + for package in "${package_list[@]}" ; do + if [ -z "${package}" ] ; then + continue + fi + sub_dir=$(echo "${package}" | cut -d'-' -f2) + if ! brew_cli_download "${package}" "${main_dir}" "${sub_dir}" "${ver_type}" ; then + echo "ERROR: Failed to download package: ${package}" + return 1 + fi + done +} + +brew_cli_download() { + local -r package=$1 + local -r main_dir=$2 + local -r sub_dir=$3 + local -r ver_type=$4 + + # Validate parameters if [ -z "${package}" ] ; then - echo "ERROR: Cannot find MicroShift '${ver}' packages in brew" + echo "ERROR: Package is required" exit 1 fi - package=$(awk '{print $1}' <<< "${package}") + if [ -z "${main_dir}" ] ; then + echo "ERROR: Main directory is required" + exit 1 + fi + + if [ -z "${sub_dir}" ] ; then + echo "ERROR: Sub directory is required" + exit 1 + fi + # Check if brew is accessible + if ! action_access ; then + echo "ERROR: Brew Hub site is not accessible" + exit 1 + fi + "${SCRIPTDIR}/../../scripts/fetch_tools.sh" brew + echo "Downloading '${package}' packages from brew" + # Format sub_dir for EC, RC and nightly + if [ "${ver_type}" = "ec" ] || [ "${ver_type}" = "rc" ] || [ "${ver_type}" = "nightly" ] ; then + final_sub_dir=$(echo "${sub_dir}" | sed -E 's/(.*)(~)(.*)(rc|ec|nightly)(.*)/\1-\4/g') + elif [ "${ver_type}" = "zstream" ] ; then + final_sub_dir="${sub_dir}" + fi + # Download all the supported architectures as the required architecture # cannot be identified easily when running in a CI job for arch in x86_64 aarch64 ; do local adir - adir="${dir}/${ver}-${ver_type}/${arch}" + adir="${main_dir}/${final_sub_dir}/${arch}" - mkdir -p "${adir}" + if ! mkdir -p "${adir}" ; then + echo "ERROR: Failed to create directory '${adir}'" + exit 1 + fi pushd "${adir}" &>/dev/null if ! brew download-build --arch="${arch}" --arch="noarch" "${package}" ; then echo "WARNING: Failed to download '${package}' packages using brew download-build command, using curl as a fallback mechanism" diff --git a/test/bin/pyutils/build_bootc_images.py b/test/bin/pyutils/build_bootc_images.py index 6a1a75e2ea..1d581c3388 100644 --- a/test/bin/pyutils/build_bootc_images.py +++ b/test/bin/pyutils/build_bootc_images.py @@ -109,9 +109,9 @@ def set_rpm_version_info_vars(): global PREVIOUS_RELEASE_VERSION global YMINUS2_RELEASE_REPO global YMINUS2_RELEASE_VERSION - global BREW_Y0_RELEASE_VERSION - global BREW_Y1_RELEASE_VERSION - global BREW_Y2_RELEASE_VERSION + global BREW_LATEST_ZSTREAM_VERSION + global BREW_YMINUS1_VERSION + global BREW_YMINUS2_VERSION global BREW_RC_RELEASE_VERSION global BREW_EC_RELEASE_VERSION global BREW_NIGHTLY_RELEASE_VERSION @@ -121,9 +121,9 @@ def set_rpm_version_info_vars(): PREVIOUS_RELEASE_VERSION = common.get_env_var('PREVIOUS_RELEASE_VERSION') YMINUS2_RELEASE_REPO = common.get_env_var('YMINUS2_RELEASE_REPO') YMINUS2_RELEASE_VERSION = common.get_env_var('YMINUS2_RELEASE_VERSION') - BREW_Y0_RELEASE_VERSION = common.get_env_var('BREW_Y0_RELEASE_VERSION') - BREW_Y1_RELEASE_VERSION = common.get_env_var('BREW_Y1_RELEASE_VERSION') - BREW_Y2_RELEASE_VERSION = common.get_env_var('BREW_Y2_RELEASE_VERSION') + BREW_LATEST_ZSTREAM_VERSION = common.get_env_var('BREW_LATEST_ZSTREAM_VERSION') + BREW_YMINUS1_VERSION = common.get_env_var('BREW_YMINUS1_VERSION') + BREW_YMINUS2_VERSION = common.get_env_var('BREW_YMINUS2_VERSION') BREW_RC_RELEASE_VERSION = common.get_env_var('BREW_RC_RELEASE_VERSION') BREW_EC_RELEASE_VERSION = common.get_env_var('BREW_EC_RELEASE_VERSION') BREW_NIGHTLY_RELEASE_VERSION = common.get_env_var('BREW_NIGHTLY_RELEASE_VERSION') @@ -623,12 +623,12 @@ def main(): extract_container_images(PREVIOUS_RELEASE_VERSION, PREVIOUS_RELEASE_REPO, CONTAINER_LIST, args.dry_run) extract_container_images(YMINUS2_RELEASE_VERSION, YMINUS2_RELEASE_REPO, CONTAINER_LIST, args.dry_run) # The following images are specific to the brew release versions - if BREW_Y0_RELEASE_VERSION: - extract_container_images(BREW_Y0_RELEASE_VERSION, BREW_REPO, CONTAINER_LIST, args.dry_run) - if BREW_Y1_RELEASE_VERSION: - extract_container_images(BREW_Y1_RELEASE_VERSION, BREW_REPO, CONTAINER_LIST, args.dry_run) - if BREW_Y2_RELEASE_VERSION: - extract_container_images(BREW_Y2_RELEASE_VERSION, BREW_REPO, CONTAINER_LIST, args.dry_run) + if BREW_LATEST_ZSTREAM_VERSION: + extract_container_images(BREW_LATEST_ZSTREAM_VERSION, BREW_REPO, CONTAINER_LIST, args.dry_run) + if BREW_YMINUS1_VERSION: + extract_container_images(BREW_YMINUS1_VERSION, BREW_REPO, CONTAINER_LIST, args.dry_run) + if BREW_YMINUS2_VERSION: + extract_container_images(BREW_YMINUS2_VERSION, BREW_REPO, CONTAINER_LIST, args.dry_run) if BREW_RC_RELEASE_VERSION: extract_container_images(BREW_RC_RELEASE_VERSION, BREW_REPO, CONTAINER_LIST, args.dry_run) if BREW_EC_RELEASE_VERSION: diff --git a/test/image-blueprints-bootc/layer5-release/group1/rhel96-bootc-brew-prev-zstream-with-optional.containerfile b/test/image-blueprints-bootc/layer5-release/group1/rhel96-bootc-brew-prev-zstream-with-optional.containerfile new file mode 100644 index 0000000000..d31fe62b67 --- /dev/null +++ b/test/image-blueprints-bootc/layer5-release/group1/rhel96-bootc-brew-prev-zstream-with-optional.containerfile @@ -0,0 +1,48 @@ +# {{- if env.Getenv "BREW_PREV_ZSTREAM_VERSION" "" -}} +# Note: This comment makes templating add a new line before the code +FROM localhost/rhel96-test-agent:latest + +# Build arguments +ARG USHIFT_RPM_REPO_NAME=microshift-brew +ARG USHIFT_RPM_REPO_PATH=/tmp/$USHIFT_RPM_REPO_NAME + +# Copy the MicroShift repository contents +COPY ./rpm-repos/$USHIFT_RPM_REPO_NAME $USHIFT_RPM_REPO_PATH + +# Copy repository configuration +COPY ./bootc-images/$USHIFT_RPM_REPO_NAME.repo ./bootc-images/microshift-fast-datapath-rhel9.repo ./bootc-images/microshift-rhocp-y1.repo \ + /etc/yum.repos.d/ + +# Print repository configuration contents. +# Install MicroShift, test agent and cleanup. +RUN dnf repoinfo --enabled && \ + dnf install -y firewalld systemd-resolved \ + {{ range (env.Getenv "MICROSHIFT_MANDATORY_RPMS" | strings.Split " ") -}} + "{{ . }}-{{ env.Getenv "BREW_PREV_ZSTREAM_VERSION" }}" \ + {{ end -}} + {{ range (env.Getenv "MICROSHIFT_PREV_ZSTREAM_OPTIONAL_RPMS" | strings.Split " ") -}} + "{{ . }}-{{ env.Getenv "BREW_PREV_ZSTREAM_VERSION" }}" \ + {{ end -}} + {{ if and (env.Getenv "UNAME_M" "") (eq "x86_64" .Env.UNAME_M) -}} + {{ range (env.Getenv "MICROSHIFT_PREV_ZSTREAM_X86_64_RPMS" | strings.Split " ") -}} + "{{ . }}-{{ env.Getenv "BREW_PREV_ZSTREAM_VERSION" }}" \ + {{ end -}} + {{ end -}} + && \ + systemctl enable microshift microshift-test-agent && \ + rm -vf /etc/yum.repos.d/microshift-*.repo && \ + rm -rvf $USHIFT_RPM_REPO_PATH && \ + dnf clean all + +# Configure firewall +RUN firewall-offline-cmd --zone=public --add-port=22/tcp && \ + firewall-offline-cmd --zone=trusted --add-source=10.42.0.0/16 && \ + firewall-offline-cmd --zone=trusted --add-source=169.254.169.1 && \ + firewall-offline-cmd --zone=trusted --add-source=fd01::/48 && \ + firewall-offline-cmd --zone=public --add-port=80/tcp && \ + firewall-offline-cmd --zone=public --add-port=443/tcp && \ + firewall-offline-cmd --zone=public --add-port=5353/udp && \ + firewall-offline-cmd --zone=public --add-port=6443/tcp && \ + firewall-offline-cmd --zone=public --add-port=30000-32767/tcp && \ + firewall-offline-cmd --zone=public --add-port=30000-32767/udp +# {{- end -}} diff --git a/test/image-blueprints-bootc/layer5-release/group1/rhel96-bootc-brew-y1-with-optional.containerfile b/test/image-blueprints-bootc/layer5-release/group1/rhel96-bootc-brew-y1-with-optional.containerfile index edb1e43b9a..faea0217c9 100644 --- a/test/image-blueprints-bootc/layer5-release/group1/rhel96-bootc-brew-y1-with-optional.containerfile +++ b/test/image-blueprints-bootc/layer5-release/group1/rhel96-bootc-brew-y1-with-optional.containerfile @@ -1,4 +1,4 @@ -# {{- if env.Getenv "BREW_Y1_RELEASE_VERSION" "" -}} +# {{- if env.Getenv "BREW_YMINUS1_VERSION" "" -}} # Note: This comment makes templating add a new line before the code FROM localhost/rhel96-test-agent:latest @@ -18,14 +18,14 @@ COPY ./bootc-images/$USHIFT_RPM_REPO_NAME.repo ./bootc-images/microshift-fast-da RUN dnf repoinfo --enabled && \ dnf install -y firewalld systemd-resolved \ {{ range (env.Getenv "MICROSHIFT_MANDATORY_RPMS" | strings.Split " ") -}} - "{{ . }}-{{ env.Getenv "BREW_Y1_RELEASE_VERSION" }}" \ + "{{ . }}-{{ env.Getenv "BREW_YMINUS1_VERSION" }}" \ {{ end -}} {{ range (env.Getenv "MICROSHIFT_Y1_OPTIONAL_RPMS" | strings.Split " ") -}} - "{{ . }}-{{ env.Getenv "BREW_Y1_RELEASE_VERSION" }}" \ + "{{ . }}-{{ env.Getenv "BREW_YMINUS1_VERSION" }}" \ {{ end -}} {{ if and (env.Getenv "UNAME_M" "") (eq "x86_64" .Env.UNAME_M) -}} {{ range (env.Getenv "MICROSHIFT_Y1_X86_64_RPMS" | strings.Split " ") -}} - "{{ . }}-{{ env.Getenv "BREW_Y1_RELEASE_VERSION" }}" \ + "{{ . }}-{{ env.Getenv "BREW_YMINUS1_VERSION" }}" \ {{ end -}} {{ end -}} && \ diff --git a/test/image-blueprints-bootc/layer5-release/group1/rhel96-bootc-brew-y2-with-optional.containerfile b/test/image-blueprints-bootc/layer5-release/group1/rhel96-bootc-brew-y2-with-optional.containerfile index ee09a39351..4781bcf00f 100644 --- a/test/image-blueprints-bootc/layer5-release/group1/rhel96-bootc-brew-y2-with-optional.containerfile +++ b/test/image-blueprints-bootc/layer5-release/group1/rhel96-bootc-brew-y2-with-optional.containerfile @@ -1,4 +1,4 @@ -# {{- if env.Getenv "BREW_Y2_RELEASE_VERSION" "" -}} +# {{- if env.Getenv "BREW_YMINUS2_VERSION" "" -}} # Note: This comment makes templating add a new line before the code FROM localhost/rhel96-test-agent:latest @@ -18,14 +18,14 @@ COPY ./bootc-images/$USHIFT_RPM_REPO_NAME.repo ./bootc-images/microshift-fast-da RUN dnf repoinfo --enabled && \ dnf install -y firewalld systemd-resolved \ {{ range (env.Getenv "MICROSHIFT_MANDATORY_RPMS" | strings.Split " ") -}} - "{{ . }}-{{ env.Getenv "BREW_Y2_RELEASE_VERSION" }}" \ + "{{ . }}-{{ env.Getenv "BREW_YMINUS2_VERSION" }}" \ {{ end -}} {{ range (env.Getenv "MICROSHIFT_Y2_OPTIONAL_RPMS" | strings.Split " ") -}} - "{{ . }}-{{ env.Getenv "BREW_Y2_RELEASE_VERSION" }}" \ + "{{ . }}-{{ env.Getenv "BREW_YMINUS2_VERSION" }}" \ {{ end -}} {{ if and (env.Getenv "UNAME_M" "") (eq "x86_64" .Env.UNAME_M) -}} {{ range (env.Getenv "MICROSHIFT_Y2_X86_64_RPMS" | strings.Split " ") -}} - "{{ . }}-{{ env.Getenv "BREW_Y2_RELEASE_VERSION" }}" \ + "{{ . }}-{{ env.Getenv "BREW_YMINUS2_VERSION" }}" \ {{ end -}} {{ end -}} && \ diff --git a/test/image-blueprints/layer4-release/group1/rhel96-brew-y2-with-optionals.toml b/test/image-blueprints/layer4-release/group1/rhel96-brew-y2-with-optionals.toml index 2863642b8d..73e60deee4 100644 --- a/test/image-blueprints/layer4-release/group1/rhel96-brew-y2-with-optionals.toml +++ b/test/image-blueprints/layer4-release/group1/rhel96-brew-y2-with-optionals.toml @@ -1,4 +1,4 @@ -{{- if env.Getenv "BREW_Y2_RELEASE_VERSION" "" -}} +{{- if env.Getenv "BREW_YMINUS2_VERSION" "" -}} {{- /* We wrap this template in a test so that the body of the output is @@ -9,7 +9,7 @@ */ -}} name = "rhel-9.6-microshift-brew-optionals-4.{{ .Env.YMINUS2_MINOR_VERSION }}-zstream" -description = "A RHEL 9.6 image with already built and released RPMs like EC, RC, or Z-stream release: {{ .Env.BREW_Y2_RELEASE_VERSION }}" +description = "A RHEL 9.6 image with already built and released RPMs like EC, RC, or Z-stream release: {{ .Env.BREW_YMINUS2_VERSION }}" version = "0.0.1" modules = [] groups = [] @@ -18,20 +18,20 @@ distro = "rhel-96" {{ range (env.Getenv "MICROSHIFT_MANDATORY_RPMS" | strings.Split " ") }} [[packages]] name = "{{ . }}" -version = "{{ env.Getenv "BREW_Y2_RELEASE_VERSION" }}" +version = "{{ env.Getenv "BREW_YMINUS2_VERSION" }}" {{ end }} {{ range (env.Getenv "MICROSHIFT_Y2_OPTIONAL_RPMS" | strings.Split " ") }} [[packages]] name = "{{ . }}" -version = "{{ env.Getenv "BREW_Y2_RELEASE_VERSION" }}" +version = "{{ env.Getenv "BREW_YMINUS2_VERSION" }}" {{ end }} {{- if and (env.Getenv "UNAME_M" "") (eq "x86_64" .Env.UNAME_M) }} {{ range (env.Getenv "MICROSHIFT_Y2_X86_64_RPMS" | strings.Split " ") }} [[packages]] name = "{{ . }}" -version = "{{ env.Getenv "BREW_Y2_RELEASE_VERSION" }}" +version = "{{ env.Getenv "BREW_YMINUS2_VERSION" }}" {{ end }} {{- end }} diff --git a/test/image-blueprints/layer4-release/group2/rhel96-brew-y1-with-optionals.toml b/test/image-blueprints/layer4-release/group2/rhel96-brew-y1-with-optionals.toml index 227a40d927..7f1c99027f 100644 --- a/test/image-blueprints/layer4-release/group2/rhel96-brew-y1-with-optionals.toml +++ b/test/image-blueprints/layer4-release/group2/rhel96-brew-y1-with-optionals.toml @@ -1,4 +1,4 @@ -{{- if env.Getenv "BREW_Y1_RELEASE_VERSION" "" -}} +{{- if env.Getenv "BREW_YMINUS1_VERSION" "" -}} {{- /* We wrap this template in a test so that the body of the output is @@ -9,7 +9,7 @@ */ -}} name = "rhel-9.6-microshift-brew-optionals-4.{{ .Env.PREVIOUS_MINOR_VERSION }}-zstream" -description = "A RHEL 9.6 image with already built and released RPMs like EC, RC, or Z-stream release: {{ .Env.BREW_Y1_RELEASE_VERSION }}" +description = "A RHEL 9.6 image with already built and released RPMs like EC, RC, or Z-stream release: {{ .Env.BREW_YMINUS1_VERSION }}" version = "0.0.1" modules = [] groups = [] @@ -22,20 +22,20 @@ distro = "rhel-96" {{ range (env.Getenv "MICROSHIFT_MANDATORY_RPMS" | strings.Split " ") }} [[packages]] name = "{{ . }}" -version = "{{ env.Getenv "BREW_Y1_RELEASE_VERSION" }}" +version = "{{ env.Getenv "BREW_YMINUS1_VERSION" }}" {{ end }} {{ range (env.Getenv "MICROSHIFT_Y1_OPTIONAL_RPMS" | strings.Split " ") }} [[packages]] name = "{{ . }}" -version = "{{ env.Getenv "BREW_Y1_RELEASE_VERSION" }}" +version = "{{ env.Getenv "BREW_YMINUS1_VERSION" }}" {{ end }} {{- if and (env.Getenv "UNAME_M" "") (eq "x86_64" .Env.UNAME_M) }} {{ range (env.Getenv "MICROSHIFT_Y1_X86_64_RPMS" | strings.Split " ") }} [[packages]] name = "{{ . }}" -version = "{{ env.Getenv "BREW_Y1_RELEASE_VERSION" }}" +version = "{{ env.Getenv "BREW_YMINUS1_VERSION" }}" {{ end }} {{- end }} diff --git a/test/image-blueprints/layer4-release/group3/rhel96-brew-lrel-optional.toml b/test/image-blueprints/layer4-release/group3/rhel96-brew-lrel-optional.toml index 43a85c08f9..97888adae1 100644 --- a/test/image-blueprints/layer4-release/group3/rhel96-brew-lrel-optional.toml +++ b/test/image-blueprints/layer4-release/group3/rhel96-brew-lrel-optional.toml @@ -1,4 +1,4 @@ -{{- if and (env.Getenv "BREW_LREL_RELEASE_VERSION" "") (env.Getenv "BREW_Y1_RELEASE_VERSION" "") -}} +{{- if and (env.Getenv "BREW_LREL_RELEASE_VERSION" "") (env.Getenv "BREW_YMINUS1_VERSION" "") -}} {{- /* We wrap this template in a test so that the body of the output is diff --git a/test/image-blueprints/layer4-release/group3/rhel96-brew-lrel-tuned.toml b/test/image-blueprints/layer4-release/group3/rhel96-brew-lrel-tuned.toml index dafd080f7c..636f7cccad 100644 --- a/test/image-blueprints/layer4-release/group3/rhel96-brew-lrel-tuned.toml +++ b/test/image-blueprints/layer4-release/group3/rhel96-brew-lrel-tuned.toml @@ -1,4 +1,4 @@ -{{- if and (env.Getenv "BREW_LREL_RELEASE_VERSION" "") (env.Getenv "BREW_Y1_RELEASE_VERSION" "") -}} +{{- if and (env.Getenv "BREW_LREL_RELEASE_VERSION" "") (env.Getenv "BREW_YMINUS1_VERSION" "") -}} {{- /* We wrap this template in a test so that the body of the output is diff --git a/test/image-blueprints/layer4-release/group3/rhel96-brew-nightly-with-optionals.toml b/test/image-blueprints/layer4-release/group3/rhel96-brew-nightly-with-optionals.toml index 9fab7201f0..e61a102d80 100644 --- a/test/image-blueprints/layer4-release/group3/rhel96-brew-nightly-with-optionals.toml +++ b/test/image-blueprints/layer4-release/group3/rhel96-brew-nightly-with-optionals.toml @@ -1,4 +1,4 @@ -{{- if and (env.Getenv "BREW_NIGHTLY_RELEASE_VERSION" "") (env.Getenv "BREW_Y1_RELEASE_VERSION" "") -}} +{{- if and (env.Getenv "BREW_NIGHTLY_RELEASE_VERSION" "") (env.Getenv "BREW_YMINUS1_VERSION" "") -}} {{- /* We wrap this template in a test so that the body of the output is diff --git a/test/image-blueprints/layer4-release/group4/rhel96-brew-lrel-optional.image-installer b/test/image-blueprints/layer4-release/group4/rhel96-brew-lrel-optional.image-installer index 186271166c..a9e0694a55 100644 --- a/test/image-blueprints/layer4-release/group4/rhel96-brew-lrel-optional.image-installer +++ b/test/image-blueprints/layer4-release/group4/rhel96-brew-lrel-optional.image-installer @@ -1,3 +1,3 @@ -{{- if and (env.Getenv "BREW_LREL_RELEASE_VERSION" "") (env.Getenv "BREW_Y1_RELEASE_VERSION" "") -}} +{{- if and (env.Getenv "BREW_LREL_RELEASE_VERSION" "") (env.Getenv "BREW_YMINUS1_VERSION" "") -}} rhel96-brew-lrel-optional {{- end -}} diff --git a/test/scenarios-bootc/releases/el96-prev-zstream@el96-lrel@standard1.sh b/test/scenarios-bootc/releases/el96-prev-zstream@el96-lrel@standard1.sh new file mode 100644 index 0000000000..7c2b6e265d --- /dev/null +++ b/test/scenarios-bootc/releases/el96-prev-zstream@el96-lrel@standard1.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# Sourced from scenario.sh and uses functions defined there. + +# NOTE: Unlike most suites, these tests rely on being run IN ORDER to +# ensure MicroShift is upgraded before running standard suite tests +export TEST_RANDOMIZATION=none + +start_image="rhel96-bootc-brew-prev-zstream-with-optional" +dest_image="rhel96-bootc-brew-lrel-optional" + +scenario_create_vms() { + exit_if_image_not_found "${start_image}" + exit_if_image_not_found "${dest_image}" + + prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" + launch_vm --boot_blueprint rhel96-bootc --vm_vcpus 4 +} + +scenario_remove_vms() { + exit_if_image_not_found "${start_image}" + exit_if_image_not_found "${dest_image}" + + remove_vm host1 +} + +scenario_run_tests() { + exit_if_image_not_found "${start_image}" + exit_if_image_not_found "${dest_image}" + + run_tests host1 \ + --variable "TARGET_REF:${dest_image}" \ + --variable "BOOTC_REGISTRY:${MIRROR_REGISTRY_URL}" \ + --variable "EXPECTED_OS_VERSION:9.6" \ + suites/upgrade/upgrade-successful.robot \ + suites/standard1/ suites/selinux/validate-selinux-policy.robot +} diff --git a/test/scenarios-bootc/releases/el96-prev-zstream@el96-lrel@standard2.sh b/test/scenarios-bootc/releases/el96-prev-zstream@el96-lrel@standard2.sh new file mode 100644 index 0000000000..e1b9a46c43 --- /dev/null +++ b/test/scenarios-bootc/releases/el96-prev-zstream@el96-lrel@standard2.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# Sourced from scenario.sh and uses functions defined there. + +# NOTE: Unlike most suites, these tests rely on being run IN ORDER to +# ensure MicroShift is upgraded before running standard suite tests +export TEST_RANDOMIZATION=none + +start_image="rhel96-bootc-brew-prev-zstream-with-optional" +dest_image="rhel96-bootc-brew-lrel-optional" + +scenario_create_vms() { + exit_if_image_not_found "${start_image}" + exit_if_image_not_found "${dest_image}" + + prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" + launch_vm --boot_blueprint rhel96-bootc --vm_vcpus 4 +} + +scenario_remove_vms() { + exit_if_image_not_found "${start_image}" + exit_if_image_not_found "${dest_image}" + + remove_vm host1 +} + +scenario_run_tests() { + exit_if_image_not_found "${start_image}" + exit_if_image_not_found "${dest_image}" + + run_tests host1 \ + --variable "TARGET_REF:${dest_image}" \ + --variable "BOOTC_REGISTRY:${MIRROR_REGISTRY_URL}" \ + suites/upgrade/upgrade-successful.robot \ + suites/standard2 +} From f8f499282c02de3c321e0875ec39c4608fb7a785 Mon Sep 17 00:00:00 2001 From: Alejandro Gullon Date: Fri, 30 Jan 2026 15:19:30 +0100 Subject: [PATCH 2/2] temp bucket for testing rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED --- test/bin/manage_build_cache.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test/bin/manage_build_cache.sh b/test/bin/manage_build_cache.sh index edfa245310..dbc2dc5c51 100755 --- a/test/bin/manage_build_cache.sh +++ b/test/bin/manage_build_cache.sh @@ -8,6 +8,7 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "${SCRIPTDIR}/common.sh" AWS_BUCKET_NAME="${AWS_BUCKET_NAME:-microshift-build-cache}" +AWS_BUCKET_NAME="microshift-build-ushift-6073-cache-us-west-2" BCH_SUBDIR= TAG_SUBDIR= ARCH_SUBDIR="${UNAME_M}"