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.sh b/scripts/post_all_factory.sh new file mode 100644 index 00000000..4094398a --- /dev/null +++ b/scripts/post_all_factory.sh @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +set -x + +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 + +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 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_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_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_cloud_factory.sh b/scripts/post_cloud_factory.sh new file mode 100644 index 00000000..43454f16 --- /dev/null +++ b/scripts/post_cloud_factory.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +set -x + +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}\.latest\." | \ + 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 "${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_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}" \ + ARCH="${arch}" \ + DISTRI=rocky \ + DESKTOP=false \ + FLAVOR="${flavor}-qcow2-qcow2" \ + VERSION="${version}" \ + CURRREL="${version_major}" \ + USER_LOGIN=rocky \ + USER_PASSWORD=weakpassword \ + BUILD="${build_msg}" "$@" + done + done +done diff --git a/scripts/post_minimal_factory.sh b/scripts/post_minimal_factory.sh new file mode 100644 index 00000000..dbe29acb --- /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 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