From 974c3af7f96ee31179e8e4f60a2921ef8ec7dfcd Mon Sep 17 00:00:00 2001 From: Trevor Cooper Date: Thu, 1 Jun 2023 08:43:37 -0700 Subject: [PATCH 1/5] add POST scripts used in openqa prod instance --- scripts/post_all_factory.sh | 106 ++++++++++++++++++++++++++++++++++ scripts/post_cloud_factory.sh | 48 +++++++++++++++ 2 files changed, 154 insertions(+) create mode 100644 scripts/post_all_factory.sh create mode 100644 scripts/post_cloud_factory.sh diff --git a/scripts/post_all_factory.sh b/scripts/post_all_factory.sh new file mode 100644 index 00000000..31a7aa26 --- /dev/null +++ b/scripts/post_all_factory.sh @@ -0,0 +1,106 @@ +#!/bin/bash + +set -x + +ARCHES=(x86_64) +ISO_URL_BASE="https://download.rockylinux.org/pub/rocky" +FACTORY_ISO_FIXED_DIR=/var/tmp/openqa/share/factory/iso/fixed + +get_latest_iso() { + curl -s "${ISO_URL_BASE}/${1}/isos/${2}/" | \ + sed 's/"/ /g' | \ + grep "${3}.iso" | \ + grep -Ev "CHECKSUM|manifest|torrent" | \ + awk '{printf("%s %s-%s\n",$3,$5,$6)}' | \ + grep "${1}-${2}-${3}" | \ + sort -k1,1V -k2,2dr | \ + head -n 1 | \ + grep -E "^Rocky-${1}" | \ + awk '{print $1}' +} + +for arch in "${ARCHES[@]}"; +do + for version in "9.2" "8.8"; + do + # Using the same BUILD message for all test suites will group all jobs into a single item + build_msg="$(date +%Y%m%d)-Rocky-${version}-${arch}.0" + + for media in boot minimal; + do + latest_iso=$(get_latest_iso "${version}" "${arch}" "${media}") + test -f "${FACTORY_ISO_FIXED_DIR}/${latest_iso}" || \ + (cd "${FACTORY_ISO_FIXED_DIR}" || exit; curl -LOR "${ISO_URL_BASE}/${version:0:1}/isos/${arch}/${latest_iso}") + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${media}-iso" \ + VERSION="${version}" \ + CURRREL="${version:0:1}" \ + BUILD="${build_msg}" + done + + case ${version:0:1} in + 8) + media=dvd1 + ;; + *) + media=dvd + ;; + esac + + # Flavor dvd-iso, univeral and package-set are with DVD ISO media + for flavor in "dvd-iso" universal "package-set"; + do + latest_iso=$(get_latest_iso "${version}" "${arch}" "${media}") + test -f "${FACTORY_ISO_FIXED_DIR}/${latest_iso}" || \ + (cd "${FACTORY_ISO_FIXED_DIR}" || exit; curl -LOR "${ISO_URL_BASE}/${version:0:1}/isos/${arch}/${latest_iso}") + case ${flavor} in + universal) + # universal will boot with DVD ISO but perform a network install from LOCATION + # NOTE: In Rocky 8 there may be network available on boot issue + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}" \ + LOCATION="${ISO_URL_BASE}/${version}/BaseOS" \ + NICTYPE_USER_OPTIONS="net=172.16.2.0/24" \ + QEMU_HOST_IP="172.16.2.2" \ + VERSION="${version}" \ + CURRREL="${version:0:1}" \ + BUILD="${build_msg}" + ;; + dvd-iso) + # dvd-iso FLAVOR needs NIC_TYPE_USER_OPTIONS and QEMU_HOST_IP for multi-worker tests + # and LOCATION for various repository variations and support_server + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}" \ + LOCATION="${ISO_URL_BASE}/${version}/BaseOS" \ + NICTYPE_USER_OPTIONS="net=172.16.2.0/24" \ + QEMU_HOST_IP="172.16.2.2" \ + VERSION="${version}" \ + CURRREL="${version:0:1}" \ + BUILD="${build_msg}" + ;; + package-set) + # package-set FLAVOR is media only + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}" \ + VERSION="${version}" \ + CURRREL="${version:0:1}" \ + BUILD="${build_msg}" + ;; + *) + ;; + esac + done + done +done diff --git a/scripts/post_cloud_factory.sh b/scripts/post_cloud_factory.sh new file mode 100644 index 00000000..1df3acdf --- /dev/null +++ b/scripts/post_cloud_factory.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash + +set -x + +ARCHES=(x86_64) +IMAGE_URL_BASE="https://dl.rockylinux.org/pub/rocky" +FACTORY_HDD_FIXED_DIR=/var/tmp/openqa/share/factory/hdd/fixed + +get_latest_image() { + curl -s "${IMAGE_URL_BASE}/${1}/images/${2}/" | \ + sed 's/"/ /g' | \ + grep -E "Rocky-${1}-*${3}\." | \ + grep -v CHECKSUM | \ + awk '{printf("%s\n",$3)}' | \ + sort -k1,1Vr | \ + head -n 1 | \ + grep -E "^Rocky-${1}-" | \ + awk '{print $1}' +} + +for arch in "${ARCHES[@]}"; +do + for version in "9.2" "8.8"; + do + # Using the same BUILD message for all test suites will group all jobs into a single item + build_msg="$(date +%Y%m%d)-Rocky-${version}-GenericCloud-${arch}.0" + + # GenericCloud and GenericCloud-Base are identical + for image_class in "GenericCloud-Base" "GenericCloud-LVM"; + do + latest_image=$(get_latest_image "${version:0:1}" "${arch}" "${image_class}") + test -f "${FACTORY_HDD_FIXED_DIR}/${latest_image}" || \ + (cd "${FACTORY_HDD_FIXED_DIR}" || exit; curl -LOR "${IMAGE_URL_BASE}/${version:0:1}/images/${arch}/${latest_image}") + flavor=$(printf "%s\n" "${image_class}" | tr '-' '_') + openqa-cli api -X POST isos \ + HDD_2="${latest_image}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + DESKTOP=false \ + FLAVOR="${flavor}-qcow2-qcow2" \ + VERSION="${version}" \ + CURRREL="${version:0:1}" \ + USER_LOGIN=rocky \ + USER_PASSWORD=weakpassword \ + BUILD="${build_msg}" + done + done +done From c11ce21a119221a73b18e4c856b7d91c648509f3 Mon Sep 17 00:00:00 2001 From: Trevor Cooper Date: Sun, 1 Sep 2024 16:53:38 -0700 Subject: [PATCH 2/5] update for 8.10 and 9.4 --- scripts/post_all_factory.sh | 142 ++++++++++++++++++++++++---------- scripts/post_cloud_factory.sh | 16 ++-- 2 files changed, 108 insertions(+), 50 deletions(-) diff --git a/scripts/post_all_factory.sh b/scripts/post_all_factory.sh index 31a7aa26..108751a5 100644 --- a/scripts/post_all_factory.sh +++ b/scripts/post_all_factory.sh @@ -2,7 +2,8 @@ set -x -ARCHES=(x86_64) +ARCHES=("x86_64") +VERSIONS=("8.10" "9.4") ISO_URL_BASE="https://download.rockylinux.org/pub/rocky" FACTORY_ISO_FIXED_DIR=/var/tmp/openqa/share/factory/iso/fixed @@ -21,27 +22,40 @@ get_latest_iso() { for arch in "${ARCHES[@]}"; do - for version in "9.2" "8.8"; + for version in "${VERSIONS[@]}"; do # Using the same BUILD message for all test suites will group all jobs into a single item build_msg="$(date +%Y%m%d)-Rocky-${version}-${arch}.0" + version_major=$(printf "%s\n" "${version}" | cut -d\. -f1) for media in boot minimal; do latest_iso=$(get_latest_iso "${version}" "${arch}" "${media}") test -f "${FACTORY_ISO_FIXED_DIR}/${latest_iso}" || \ - (cd "${FACTORY_ISO_FIXED_DIR}" || exit; curl -LOR "${ISO_URL_BASE}/${version:0:1}/isos/${arch}/${latest_iso}") - openqa-cli api -X POST isos \ - ISO="${latest_iso}" \ - ARCH="${arch}" \ - DISTRI=rocky \ - FLAVOR="${media}-iso" \ - VERSION="${version}" \ - CURRREL="${version:0:1}" \ - BUILD="${build_msg}" + (cd "${FACTORY_ISO_FIXED_DIR}" || exit; curl -LOR "${ISO_URL_BASE}/${version_major}/isos/${arch}/${latest_iso}") + if [ "${version_major}" == "8" ]; then + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${media}-iso" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + GRUB="ip=dhcp" \ + BUILD="${build_msg}" "$@" + else + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${media}-iso" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + BUILD="${build_msg}" "$@" + fi done - case ${version:0:1} in + case ${version_major} in 8) media=dvd1 ;; @@ -55,48 +69,90 @@ do do latest_iso=$(get_latest_iso "${version}" "${arch}" "${media}") test -f "${FACTORY_ISO_FIXED_DIR}/${latest_iso}" || \ - (cd "${FACTORY_ISO_FIXED_DIR}" || exit; curl -LOR "${ISO_URL_BASE}/${version:0:1}/isos/${arch}/${latest_iso}") + (cd "${FACTORY_ISO_FIXED_DIR}" || exit; curl -LOR "${ISO_URL_BASE}/${version_major}/isos/${arch}/${latest_iso}") case ${flavor} in universal) # universal will boot with DVD ISO but perform a network install from LOCATION # NOTE: In Rocky 8 there may be network available on boot issue - openqa-cli api -X POST isos \ - ISO="${latest_iso}" \ - ARCH="${arch}" \ - DISTRI=rocky \ - FLAVOR="${flavor}" \ - LOCATION="${ISO_URL_BASE}/${version}/BaseOS" \ - NICTYPE_USER_OPTIONS="net=172.16.2.0/24" \ - QEMU_HOST_IP="172.16.2.2" \ - VERSION="${version}" \ - CURRREL="${version:0:1}" \ - BUILD="${build_msg}" + if [ "${version_major}" == "8" ]; then + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}" \ + LOCATION="${ISO_URL_BASE}/${version}" \ + NICTYPE_USER_OPTIONS="net=172.16.2.0/24" \ + QEMU_HOST_IP="172.16.2.2" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + GRUB="ip=dhcp" \ + BUILD="${build_msg}" "$@" + else + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}" \ + LOCATION="${ISO_URL_BASE}/${version}" \ + NICTYPE_USER_OPTIONS="net=172.16.2.0/24" \ + QEMU_HOST_IP="172.16.2.2" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + BUILD="${build_msg}" "$@" + fi ;; dvd-iso) # dvd-iso FLAVOR needs NIC_TYPE_USER_OPTIONS and QEMU_HOST_IP for multi-worker tests # and LOCATION for various repository variations and support_server - openqa-cli api -X POST isos \ - ISO="${latest_iso}" \ - ARCH="${arch}" \ - DISTRI=rocky \ - FLAVOR="${flavor}" \ - LOCATION="${ISO_URL_BASE}/${version}/BaseOS" \ - NICTYPE_USER_OPTIONS="net=172.16.2.0/24" \ - QEMU_HOST_IP="172.16.2.2" \ - VERSION="${version}" \ - CURRREL="${version:0:1}" \ - BUILD="${build_msg}" + if [ "${version_major}" == "8" ]; then + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}" \ + LOCATION="${ISO_URL_BASE}/${version}" \ + NICTYPE_USER_OPTIONS="net=172.16.2.0/24" \ + QEMU_HOST_IP="172.16.2.2" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + GRUB="ip=dhcp" \ + BUILD="${build_msg}" "$@" + else + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}" \ + LOCATION="${ISO_URL_BASE}/${version}" \ + NICTYPE_USER_OPTIONS="net=172.16.2.0/24" \ + QEMU_HOST_IP="172.16.2.2" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + BUILD="${build_msg}" "$@" + fi ;; package-set) # package-set FLAVOR is media only - openqa-cli api -X POST isos \ - ISO="${latest_iso}" \ - ARCH="${arch}" \ - DISTRI=rocky \ - FLAVOR="${flavor}" \ - VERSION="${version}" \ - CURRREL="${version:0:1}" \ - BUILD="${build_msg}" + if [ "${version_major}" == "8" ]; then + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + GRUB="ip=dhcp" \ + BUILD="${build_msg}" "$@" + else + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + BUILD="${build_msg}" "$@" + fi ;; *) ;; diff --git a/scripts/post_cloud_factory.sh b/scripts/post_cloud_factory.sh index 1df3acdf..6fd97b7f 100644 --- a/scripts/post_cloud_factory.sh +++ b/scripts/post_cloud_factory.sh @@ -2,14 +2,15 @@ set -x -ARCHES=(x86_64) +ARCHES=("x86_64") +VERSIONS=("8.10" "9.4") IMAGE_URL_BASE="https://dl.rockylinux.org/pub/rocky" FACTORY_HDD_FIXED_DIR=/var/tmp/openqa/share/factory/hdd/fixed get_latest_image() { curl -s "${IMAGE_URL_BASE}/${1}/images/${2}/" | \ sed 's/"/ /g' | \ - grep -E "Rocky-${1}-*${3}\." | \ + grep -E "Rocky-${1}-*${3}\.latest\." | \ grep -v CHECKSUM | \ awk '{printf("%s\n",$3)}' | \ sort -k1,1Vr | \ @@ -20,17 +21,18 @@ get_latest_image() { for arch in "${ARCHES[@]}"; do - for version in "9.2" "8.8"; + for version in "${VERSIONS[@]}"; do # Using the same BUILD message for all test suites will group all jobs into a single item build_msg="$(date +%Y%m%d)-Rocky-${version}-GenericCloud-${arch}.0" + version_major=$(printf "%s\n" "${version}" | cut -d\. -f1) # GenericCloud and GenericCloud-Base are identical for image_class in "GenericCloud-Base" "GenericCloud-LVM"; do - latest_image=$(get_latest_image "${version:0:1}" "${arch}" "${image_class}") + latest_image=$(get_latest_image "${version_major}" "${arch}" "${image_class}") test -f "${FACTORY_HDD_FIXED_DIR}/${latest_image}" || \ - (cd "${FACTORY_HDD_FIXED_DIR}" || exit; curl -LOR "${IMAGE_URL_BASE}/${version:0:1}/images/${arch}/${latest_image}") + (cd "${FACTORY_HDD_FIXED_DIR}" || exit; curl -LOR "${IMAGE_URL_BASE}/${version_major}/images/${arch}/${latest_image}") flavor=$(printf "%s\n" "${image_class}" | tr '-' '_') openqa-cli api -X POST isos \ HDD_2="${latest_image}" \ @@ -39,10 +41,10 @@ do DESKTOP=false \ FLAVOR="${flavor}-qcow2-qcow2" \ VERSION="${version}" \ - CURRREL="${version:0:1}" \ + CURRREL="${version_major}" \ USER_LOGIN=rocky \ USER_PASSWORD=weakpassword \ - BUILD="${build_msg}" + BUILD="${build_msg}" "$@" done done done From fc00704876bfe2a66828087935c2c2c00b817044 Mon Sep 17 00:00:00 2001 From: Trevor Cooper Date: Sun, 1 Sep 2024 17:33:35 -0700 Subject: [PATCH 3/5] additional POST scripts --- scripts/post_after_upgrade_tests.sh | 115 +++++++++++++++++++ scripts/post_all_factory_aarch64.sh | 164 ++++++++++++++++++++++++++++ scripts/post_minimal_factory.sh | 59 ++++++++++ 3 files changed, 338 insertions(+) create mode 100644 scripts/post_after_upgrade_tests.sh create mode 100644 scripts/post_all_factory_aarch64.sh create mode 100644 scripts/post_minimal_factory.sh diff --git a/scripts/post_after_upgrade_tests.sh b/scripts/post_after_upgrade_tests.sh new file mode 100644 index 00000000..9713efed --- /dev/null +++ b/scripts/post_after_upgrade_tests.sh @@ -0,0 +1,115 @@ +#!/usr/bin/env bash + +set -x + +ARCHES=("x86_64" "aarch64") +VERSIONS=("8.10" "9.4") +ISO_URL_BASE="https://download.rockylinux.org/pub/rocky" +FACTORY_ISO_FIXED_DIR=/var/tmp/openqa/share/factory/iso/fixed + +get_latest_iso() { + curl -s "${ISO_URL_BASE}/${1}/isos/${2}/" | \ + sed 's/"/ /g' | \ + grep "${3}.iso" | \ + grep -Ev "CHECKSUM|manifest|torrent" | \ + awk '{printf("%s %s-%s\n",$3,$5,$6)}' | \ + grep "${1}-${2}-${3}" | \ + sort -k1,1V -k2,2dr | \ + head -n 1 | \ + grep -E "^Rocky-${1}" | \ + awk '{print $1}' +} + +for arch in "${ARCHES[@]}"; +do + for version in "${VERSIONS[@]}"; + do + # Using the same BUILD message for all test suites will group all jobs into a single item + build_msg="$(date +%Y%m%d)-Rocky-${version}-${arch}.0" + version_major=$(printf "%s\n" "${version}" | cut -d\. -f1) + + for media in boot minimal; + do + latest_iso=$(get_latest_iso "${version}" "${arch}" "${media}") + test -f "${FACTORY_ISO_FIXED_DIR}/${latest_iso}" || \ + (cd "${FACTORY_ISO_FIXED_DIR}" || exit; curl -LOR "${ISO_URL_BASE}/${version_major}/isos/${arch}/${latest_iso}") + + if [ "${version_major}" == "8" ]; then + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${media}-iso" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + GRUB="ip=dhcp" \ + BUILD="${build_msg}" \ + TESTS="install_default" "$@" + else + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${media}-iso" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + BUILD="${build_msg}" \ + TESTS="install_default" "$@" + fi + done + + case ${version_major} in + 8) + media=dvd1 + ;; + *) + media=dvd + ;; + esac + + # Flavor dvd-iso is with DVD ISO media + for flavor in "dvd-iso"; + do + latest_iso=$(get_latest_iso "${version}" "${arch}" "${media}") + test -f "${FACTORY_ISO_FIXED_DIR}/${latest_iso}" || \ + (cd "${FACTORY_ISO_FIXED_DIR}" || exit; curl -LOR "${ISO_URL_BASE}/${version_major}/isos/${arch}/${latest_iso}") + + case ${flavor} in + dvd-iso) + # dvd-iso FLAVOR needs NIC_TYPE_USER_OPTIONS and QEMU_HOST_IP for multi-worker tests + # and LOCATION for various repository variations and support_server + if [ "${version_major}" == "8" ]; then + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}" \ + LOCATION="${ISO_URL_BASE}/${version}" \ + NICTYPE_USER_OPTIONS="net=172.16.2.0/24" \ + QEMU_HOST_IP="172.16.2.2" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + GRUB="ip=dhcp" \ + BUILD="${build_msg}" \ + TESTS="install_default_upload" "$@" + else + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}" \ + LOCATION="${ISO_URL_BASE}/${version}" \ + NICTYPE_USER_OPTIONS="net=172.16.2.0/24" \ + QEMU_HOST_IP="172.16.2.2" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + BUILD="${build_msg}" \ + TESTS="install_default_upload" "$@" + fi + ;; + *) + ;; + esac + done + done +done diff --git a/scripts/post_all_factory_aarch64.sh b/scripts/post_all_factory_aarch64.sh new file mode 100644 index 00000000..51b97f8b --- /dev/null +++ b/scripts/post_all_factory_aarch64.sh @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +set -x + +ARCHES=("aarch64") +VERSIONS=("8.10" "9.4") +ISO_URL_BASE="https://download.rockylinux.org/pub/rocky" +FACTORY_ISO_FIXED_DIR=/var/tmp/openqa/share/factory/iso/fixed + +get_latest_iso() { + curl -s "${ISO_URL_BASE}/${1}/isos/${2}/" | \ + sed 's/"/ /g' | \ + grep "${3}.iso" | \ + grep -Ev "CHECKSUM|manifest|torrent" | \ + awk '{printf("%s %s-%s\n",$3,$5,$6)}' | \ + grep "${1}-${2}-${3}" | \ + sort -k1,1V -k2,2dr | \ + head -n 1 | \ + grep -E "^Rocky-${1}" | \ + awk '{print $1}' +} + +for arch in "${ARCHES[@]}"; +do + for version in "${VERSIONS[@]}"; + do + # Using the same BUILD message for all test suites will group all jobs into a single item + build_msg="$(date +%Y%m%d)-Rocky-${version}-${arch}.0" + version_major=$(printf "%s\n" "${version}" | cut -d\. -f1) + + for media in boot minimal; + do + latest_iso=$(get_latest_iso "${version}" "${arch}" "${media}") + test -f "${FACTORY_ISO_FIXED_DIR}/${latest_iso}" || \ + (cd "${FACTORY_ISO_FIXED_DIR}" || exit; curl -LOR "${ISO_URL_BASE}/${version_major}/isos/${arch}/${latest_iso}") + + if [ "${version_major}" == "8" ]; then + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${media}-iso" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + GRUB="ip=dhcp" \ + BUILD="${build_msg}" "$@" + else + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${media}-iso" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + BUILD="${build_msg}" "$@" + fi + done + + case ${version_major} in + 8) + media=dvd1 + ;; + *) + media=dvd + ;; + esac + + # Flavor dvd-iso, univeral are with DVD ISO media + for flavor in "dvd-iso" universal; + do + latest_iso=$(get_latest_iso "${version}" "${arch}" "${media}") + test -f "${FACTORY_ISO_FIXED_DIR}/${latest_iso}" || \ + (cd "${FACTORY_ISO_FIXED_DIR}" || exit; curl -LOR "${ISO_URL_BASE}/${version_major}/isos/${arch}/${latest_iso}") + + case ${flavor} in + universal) + # universal will boot with DVD ISO but perform a network install from LOCATION + # NOTE: In Rocky 8 there may be network available on boot issue + if [ "${version_major}" == "8" ]; then + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}" \ + LOCATION="${ISO_URL_BASE}/${version}" \ + NICTYPE_USER_OPTIONS="net=172.16.2.0/24" \ + QEMU_HOST_IP="172.16.2.2" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + GRUB="ip=dhcp" \ + BUILD="${build_msg}" "$@" + else + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}" \ + LOCATION="${ISO_URL_BASE}/${version}" \ + NICTYPE_USER_OPTIONS="net=172.16.2.0/24" \ + QEMU_HOST_IP="172.16.2.2" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + BUILD="${build_msg}" "$@" + fi + ;; + dvd-iso) + # dvd-iso FLAVOR needs NIC_TYPE_USER_OPTIONS and QEMU_HOST_IP for multi-worker tests + # and LOCATION for various repository variations and support_server + if [ "${version_major}" == "8" ]; then + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}" \ + LOCATION="${ISO_URL_BASE}/${version}" \ + NICTYPE_USER_OPTIONS="net=172.16.2.0/24" \ + QEMU_HOST_IP="172.16.2.2" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + GRUB="ip=dhcp" \ + BUILD="${build_msg}" "$@" + else + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}" \ + LOCATION="${ISO_URL_BASE}/${version}" \ + NICTYPE_USER_OPTIONS="net=172.16.2.0/24" \ + QEMU_HOST_IP="172.16.2.2" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + BUILD="${build_msg}" "$@" + fi + ;; + package-set) + # package-set FLAVOR is media only + if [ "${version_major}" == "8" ]; then + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + GRUB="ip=dhcp" \ + BUILD="${build_msg}" "$@" + else + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + BUILD="${build_msg}" "$@" + fi + ;; + *) + ;; + esac + done + done +done diff --git a/scripts/post_minimal_factory.sh b/scripts/post_minimal_factory.sh new file mode 100644 index 00000000..2e9dc15d --- /dev/null +++ b/scripts/post_minimal_factory.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +set -x + +ARCHES=("x86_64" "aarch64") +VERSIONS=("8.10" "9.4") +ISO_URL_BASE="https://download.rockylinux.org/pub/rocky" +FACTORY_ISO_FIXED_DIR=/var/tmp/openqa/share/factory/iso/fixed + +get_latest_iso() { + curl -s "${ISO_URL_BASE}/${1}/isos/${2}/" | \ + sed 's/"/ /g' | \ + grep "${3}.iso" | \ + grep -Ev "CHECKSUM|manifest|torrent" | \ + awk '{printf("%s %s-%s\n",$3,$5,$6)}' | \ + grep "${1}-${2}-${3}" | \ + sort -k1,1V -k2,2dr | \ + head -n 1 | \ + grep -E "^Rocky-${1}" | \ + awk '{print $1}' +} + +for arch in "${ARCHES[@]}"; +do + for version in "${VERSIONS[@]}"; + do + # Using the same BUILD message for all test suites will group all jobs into a single item + build_msg="$(date +%Y%m%d)-Rocky-${version}-${arch}.0" + version_major=$(printf "%s\n" "${version}" | cut -d\. -f1) + + flavor="minimal" + latest_iso=$(get_latest_iso "${version}" "${arch}" "${flavor}") + test -f "${FACTORY_ISO_FIXED_DIR}/${latest_iso}" || \ + (cd "${FACTORY_ISO_FIXED_DIR}" || exit; curl -LOR "${ISO_URL_BASE}/${version_major}/isos/${arch}/${latest_iso}") + + if [ "${version_major}" == "8" ]; then + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}-iso" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + GRUB="ip=dhcp" \ + BUILD="${build_msg}" \ + TESTS=install_default "$@" + else + openqa-cli api -X POST isos \ + ISO="${latest_iso}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + FLAVOR="${flavor}-iso" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + BUILD="${build_msg}" \ + TESTS=install_default "$@" + fi + done +done From 04106b0e9086d0aaacae341f09db58e51f7a23e2 Mon Sep 17 00:00:00 2001 From: Trevor Cooper Date: Sun, 1 Sep 2024 17:34:00 -0700 Subject: [PATCH 4/5] canonicalize POST scripts --- scripts/post_all_factory.sh | 4 +++- scripts/post_cloud_factory.sh | 1 + scripts/post_minimal_factory.sh | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/post_all_factory.sh b/scripts/post_all_factory.sh index 108751a5..4094398a 100644 --- a/scripts/post_all_factory.sh +++ b/scripts/post_all_factory.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -x @@ -33,6 +33,7 @@ do latest_iso=$(get_latest_iso "${version}" "${arch}" "${media}") test -f "${FACTORY_ISO_FIXED_DIR}/${latest_iso}" || \ (cd "${FACTORY_ISO_FIXED_DIR}" || exit; curl -LOR "${ISO_URL_BASE}/${version_major}/isos/${arch}/${latest_iso}") + if [ "${version_major}" == "8" ]; then openqa-cli api -X POST isos \ ISO="${latest_iso}" \ @@ -70,6 +71,7 @@ do latest_iso=$(get_latest_iso "${version}" "${arch}" "${media}") test -f "${FACTORY_ISO_FIXED_DIR}/${latest_iso}" || \ (cd "${FACTORY_ISO_FIXED_DIR}" || exit; curl -LOR "${ISO_URL_BASE}/${version_major}/isos/${arch}/${latest_iso}") + case ${flavor} in universal) # universal will boot with DVD ISO but perform a network install from LOCATION diff --git a/scripts/post_cloud_factory.sh b/scripts/post_cloud_factory.sh index 6fd97b7f..43454f16 100644 --- a/scripts/post_cloud_factory.sh +++ b/scripts/post_cloud_factory.sh @@ -33,6 +33,7 @@ do latest_image=$(get_latest_image "${version_major}" "${arch}" "${image_class}") test -f "${FACTORY_HDD_FIXED_DIR}/${latest_image}" || \ (cd "${FACTORY_HDD_FIXED_DIR}" || exit; curl -LOR "${IMAGE_URL_BASE}/${version_major}/images/${arch}/${latest_image}") + flavor=$(printf "%s\n" "${image_class}" | tr '-' '_') openqa-cli api -X POST isos \ HDD_2="${latest_image}" \ diff --git a/scripts/post_minimal_factory.sh b/scripts/post_minimal_factory.sh index 2e9dc15d..dbe29acb 100644 --- a/scripts/post_minimal_factory.sh +++ b/scripts/post_minimal_factory.sh @@ -32,7 +32,7 @@ do latest_iso=$(get_latest_iso "${version}" "${arch}" "${flavor}") test -f "${FACTORY_ISO_FIXED_DIR}/${latest_iso}" || \ (cd "${FACTORY_ISO_FIXED_DIR}" || exit; curl -LOR "${ISO_URL_BASE}/${version_major}/isos/${arch}/${latest_iso}") - + if [ "${version_major}" == "8" ]; then openqa-cli api -X POST isos \ ISO="${latest_iso}" \ From 864c896327153a5a5c2b4914437bedf6272f08fb Mon Sep 17 00:00:00 2001 From: Trevor Cooper Date: Sun, 1 Sep 2024 17:45:50 -0700 Subject: [PATCH 5/5] add os-autoinst-distri-rocky repo sync script --- scripts/sync_os-autoinst-distri-rocky.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 scripts/sync_os-autoinst-distri-rocky.sh diff --git a/scripts/sync_os-autoinst-distri-rocky.sh b/scripts/sync_os-autoinst-distri-rocky.sh new file mode 100644 index 00000000..5f06e0b5 --- /dev/null +++ b/scripts/sync_os-autoinst-distri-rocky.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +LOG=/tmp/sync_os-autoinst-distri-rocky.sh.log +date -Isec > "${LOG}" + +(cd /var/lib/openqa/tests/rocky && git checkout main && git fetch -p && git pull) >> "${LOG}" 2>&1 +(cd /var/lib/openqa/tests/rocky && ./fifloader.py -u -l templates.fif.json templates-updates.fif.json) >> "${LOG}" 2>&1