From 4e0507bac1958ea7c9bbdaeec652fe2e78f3808b Mon Sep 17 00:00:00 2001 From: Al Bowles Date: Fri, 14 Oct 2022 19:28:29 -0500 Subject: [PATCH 1/3] Updates for 9.0 support and usability - Add automatic ISO filename switching based on major version - Update usage information to include package-set - Automatically reload FIF templates prior to test run - Update build name to display chronologically on openQA landing page --- run-openqa-tests.sh | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/run-openqa-tests.sh b/run-openqa-tests.sh index 1b2d0cbc..f6b02722 100755 --- a/run-openqa-tests.sh +++ b/run-openqa-tests.sh @@ -1,36 +1,48 @@ #!/bin/bash - set -e +MAJOR_VERSION=8 +MINOR_VERSION=6 + ROCKY_FLAVOR="${ROCKY_FLAVOR:-boot-iso}" -ROCKY_VERSION="${ROCKY_VERSION:-8.6}" +ROCKY_VERSION="$MAJOR_VERSION.$MINOR_VERSION" ROCKY_ARCH="${ROCKY_ARCH:=x86_64}" -ROCKY_PACKAGE_SET="${ROCKY_PACKAGE_SET:=minimal}" ROCKY_EXTRA_ARGS="${ROCKY_EXTRA_ARGS:-}" -BUILD_PREFIX="${ROCKY_VERSION}_${ROCKY_FLAVOR}" -BUILD_NAME="${BUILD_PREFIX}_$(date +%Y%m%d.%H%M%S).0" +BUILD_PREFIX="-$(date +%Y%m%d.%H%M%S).0-$(git branch --show-current)" +BUILD_NAME="$BUILD_PREFIX-$ROCKY_FLAVOR-$ROCKY_VERSION" + +ISO_PREFIX="Rocky-$ROCKY_VERSION-$ROCKY_ARCH" if [[ "$ROCKY_FLAVOR" == "dvd-iso" || "$ROCKY_FLAVOR" == "universal" ]]; then - ISO_TYPE=dvd1 + if [[ "$MAJOR_VERSION" -gt "8" ]]; then + ISO_TYPE=dvd + else + ISO_TYPE=dvd1 + fi elif [[ "$ROCKY_FLAVOR" == "minimal-iso" ]]; then ISO_TYPE=minimal -elif [[ "$ROCKY_FLAVOR" == "boot-iso" ]]; then +elif [[ "$ROCKY_FLAVOR" == "boot-iso" || "$ROCKY_FLAVOR" == "package-set" ]]; then + # package-set also works with dvd image ISO_TYPE=boot else - echo "Usage: $0 [universal|dvd-iso|minimal-iso|boot-iso]" + echo "Usage: $0 [universal|dvd-iso|minimal-iso|package-set|boot-iso]" exit 1 fi +ROCKY_ISO="$ISO_PREFIX-$ISO_TYPE.iso" + +# Update fif templates +./fifloader.py --clean --load templates.fif.json templates-updates.fif.json + +# Run the tests export PS4='# ' set -o xtrace openqa-cli api \ -X POST isos \ - ISO="Rocky-$ROCKY_VERSION-$ROCKY_ARCH-$ISO_TYPE.iso" \ + ISO="$ROCKY_ISO" \ ARCH="$ROCKY_ARCH" \ DISTRI=rocky \ FLAVOR="$ROCKY_FLAVOR" \ VERSION="$ROCKY_VERSION" \ BUILD="$BUILD_NAME" \ - PACKAGE_SET="$ROCKY_PACKAGE_SET" \ - IDENTIFICATION=false \ - "${ROCKY_EXTRA_ARGS}" + "$ROCKY_EXTRA_ARGS" -- 2.43.5 From 1152daff6173ce9bf11c16158d80e41a61ab4725 Mon Sep 17 00:00:00 2001 From: Al Bowles Date: Fri, 14 Oct 2022 22:50:16 -0500 Subject: [PATCH 2/3] New scripts --- build-report.sh => scripts/build-report.sh | 0 scripts/cancel-build.sh | 10 +++ scripts/run-all-flavors.sh | 72 +++++++++++++++++++ .../run-openqa-tests.sh | 4 +- 4 files changed, 84 insertions(+), 2 deletions(-) rename build-report.sh => scripts/build-report.sh (100%) create mode 100755 scripts/cancel-build.sh create mode 100755 scripts/run-all-flavors.sh rename run-openqa-tests.sh => scripts/run-openqa-tests.sh (97%) diff --git a/build-report.sh b/scripts/build-report.sh similarity index 100% rename from build-report.sh rename to scripts/build-report.sh diff --git a/scripts/cancel-build.sh b/scripts/cancel-build.sh new file mode 100755 index 00000000..38842ba8 --- /dev/null +++ b/scripts/cancel-build.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +BUILD="$1" + +jobs_in_build=$(openqa-cli api jobs build="$BUILD" | jq -r '.jobs[].id' | xargs) + +for id in $jobs_in_build +do + openqa-cli api -X POST "jobs/$id/cancel" +done diff --git a/scripts/run-all-flavors.sh b/scripts/run-all-flavors.sh new file mode 100755 index 00000000..2be6eef5 --- /dev/null +++ b/scripts/run-all-flavors.sh @@ -0,0 +1,72 @@ +#!/bin/bash +set -e + +MAJOR_VERSION=9 +MINOR_VERSION=0 + +ROCKY_VERSION="$MAJOR_VERSION.$MINOR_VERSION" +ROCKY_ARCH="${ROCKY_ARCH:=x86_64}" +ROCKY_EXTRA_ARGS="${ROCKY_EXTRA_ARGS:-}" +BUILD_PREFIX="-$(date +%Y%m%d.%H%M%S).0-$(git branch --show-current)" +ISO_PREFIX="Rocky-$ROCKY_VERSION-$ROCKY_ARCH" +DVD_ISOTYPE=dvd1 + +if [[ "$MAJOR_VERSION" -gt "8" ]]; then + DVD_ISOTYPE=dvd +fi + +# Update fif templates +./fifloader.py --clean --load templates.fif.json templates-updates.fif.json + +# POST all the flavors +export PS4='# ' +set -o xtrace +openqa-cli api \ + -X POST isos \ + ISO="$ISO_PREFIX-$DVD_ISOTYPE.iso" \ + ARCH="$ROCKY_ARCH" \ + DISTRI=rocky \ + FLAVOR=universal \ + VERSION="$ROCKY_VERSION" \ + BUILD="$BUILD_PREFIX-universal-$ROCKY_VERSION" \ + "${ROCKY_EXTRA_ARGS}" + +openqa-cli api \ + -X POST isos \ + ISO="$ISO_PREFIX-$DVD_ISOTYPE.iso" \ + ARCH="$ROCKY_ARCH" \ + DISTRI=rocky \ + FLAVOR="dvd-iso" \ + VERSION="$ROCKY_VERSION" \ + BUILD="$BUILD_PREFIX-dvd-$ROCKY_VERSION" \ + "${ROCKY_EXTRA_ARGS}" + +openqa-cli api \ + -X POST isos \ + ISO="$ISO_PREFIX-$DVD_ISOTYPE.iso" \ + ARCH="$ROCKY_ARCH" \ + DISTRI=rocky \ + FLAVOR=package-set \ + VERSION="$ROCKY_VERSION" \ + BUILD="$BUILD_PREFIX-packageset-$ROCKY_VERSION" \ + "${ROCKY_EXTRA_ARGS}" + +openqa-cli api \ + -X POST isos \ + ISO="$ISO_PREFIX-minimal.iso" \ + ARCH="$ROCKY_ARCH" \ + DISTRI=rocky \ + FLAVOR=minimal-iso \ + VERSION="$ROCKY_VERSION" \ + BUILD="$BUILD_PREFIX-minimal-$ROCKY_VERSION" \ + "${ROCKY_EXTRA_ARGS}" + +openqa-cli api \ + -X POST isos \ + ISO="$ISO_PREFIX-boot.iso" \ + ARCH="$ROCKY_ARCH" \ + DISTRI=rocky \ + FLAVOR=boot-iso \ + VERSION="$ROCKY_VERSION" \ + BUILD="$BUILD_PREFIX-boot-$ROCKY_VERSION" \ + "${ROCKY_EXTRA_ARGS}" diff --git a/run-openqa-tests.sh b/scripts/run-openqa-tests.sh similarity index 97% rename from run-openqa-tests.sh rename to scripts/run-openqa-tests.sh index f6b02722..1f10704d 100755 --- a/run-openqa-tests.sh +++ b/scripts/run-openqa-tests.sh @@ -1,8 +1,8 @@ #!/bin/bash set -e -MAJOR_VERSION=8 -MINOR_VERSION=6 +MAJOR_VERSION=9 +MINOR_VERSION=0 ROCKY_FLAVOR="${ROCKY_FLAVOR:-boot-iso}" ROCKY_VERSION="$MAJOR_VERSION.$MINOR_VERSION" -- 2.43.5 From 5cb52f294466988addf6ff7d766044316317c9f1 Mon Sep 17 00:00:00 2001 From: Al Bowles Date: Fri, 14 Oct 2022 23:09:45 -0500 Subject: [PATCH 3/3] Add usage information --- scripts/cancel-build.sh | 3 +++ scripts/run-all-flavors.sh | 3 +++ scripts/run-openqa-tests.sh | 11 +++++++++++ 3 files changed, 17 insertions(+) diff --git a/scripts/cancel-build.sh b/scripts/cancel-build.sh index 38842ba8..a5b78a08 100755 --- a/scripts/cancel-build.sh +++ b/scripts/cancel-build.sh @@ -2,6 +2,9 @@ BUILD="$1" +## Usage: Cancels all outstanding openQA jobs for the specified build +# scripts/cancel-build.sh 20221014.133700-My-Named-Build + jobs_in_build=$(openqa-cli api jobs build="$BUILD" | jq -r '.jobs[].id' | xargs) for id in $jobs_in_build diff --git a/scripts/run-all-flavors.sh b/scripts/run-all-flavors.sh index 2be6eef5..fc12e8d7 100755 --- a/scripts/run-all-flavors.sh +++ b/scripts/run-all-flavors.sh @@ -4,6 +4,9 @@ set -e MAJOR_VERSION=9 MINOR_VERSION=0 +## Usage: Posts ISOs to openQA for each of the universal, dvd-iso, package-set, minimal-iso, and boot-iso FLAVORs. +# scripts/run-all-flavors.sh + ROCKY_VERSION="$MAJOR_VERSION.$MINOR_VERSION" ROCKY_ARCH="${ROCKY_ARCH:=x86_64}" ROCKY_EXTRA_ARGS="${ROCKY_EXTRA_ARGS:-}" diff --git a/scripts/run-openqa-tests.sh b/scripts/run-openqa-tests.sh index 1f10704d..7f8fa91b 100755 --- a/scripts/run-openqa-tests.sh +++ b/scripts/run-openqa-tests.sh @@ -4,6 +4,17 @@ set -e MAJOR_VERSION=9 MINOR_VERSION=0 +## Usage: Post an ISO for the specified FLAVOR. Defaults to boot-iso. +# +## Run the boot-iso FLAVOR +# scripts/run-openqa-tests.sh +# +## Run the package-set FLAVOR +# ROCKY_FLAVOR=package-set scripts/run-openqa-tests.sh +# +## Run the localization test suites +# ROCKY_FLAVOR ROCKY_EXTRA_ARGS=TEST=install_arabic_language,install_asian_language,install_european_language,install_cyrillic_language scripts/run-openqa-tests.sh + ROCKY_FLAVOR="${ROCKY_FLAVOR:-boot-iso}" ROCKY_VERSION="$MAJOR_VERSION.$MINOR_VERSION" ROCKY_ARCH="${ROCKY_ARCH:=x86_64}" -- 2.43.5