From 32120165abb1806c935b0371cdad9d7f3f653a3f Mon Sep 17 00:00:00 2001 From: Alejandro Gullon Date: Mon, 6 Oct 2025 17:24:57 +0200 Subject: [PATCH 1/2] manual cherrypick from https://github.com/openshift/microshift/pull/5385 PR into release-4.20 branch --- ...96-bootc-brew-ec-with-optional.image-bootc | 3 + ...96-bootc-brew-rc-with-optional.image-bootc | 3 + ...otc-brew-zstream-with-optional.image-bootc | 3 + .../rhel96-bootc.image-bootc | 0 test/resources/microshift-host.resource | 5 + test/resources/microshift-rpm.resource | 8 ++ .../releases/el96-lrel@standard1.sh | 2 +- .../releases/el96-lrel@standard2.sh | 2 +- .../presubmits/el96-src@rpm-install.sh | 4 +- .../releases/el96@rpm-install-upgrade.sh | 117 ++++++++++++++++++ test/scenarios/releases/el96@rpm-standard1.sh | 84 +++++++++++++ test/scenarios/releases/el96@rpm-standard2.sh | 85 +++++++++++++ test/suites/rpm/install.robot | 65 ++++++++++ test/suites/rpm/remove.robot | 46 +++++++ ...cessful.robot => upgrade-successful.robot} | 30 ----- 15 files changed, 424 insertions(+), 33 deletions(-) create mode 100644 test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-ec-with-optional.image-bootc create mode 100644 test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-rc-with-optional.image-bootc create mode 100644 test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-zstream-with-optional.image-bootc rename test/image-blueprints-bootc/layer1-base/{group2 => group3}/rhel96-bootc.image-bootc (100%) create mode 100644 test/scenarios/releases/el96@rpm-install-upgrade.sh create mode 100644 test/scenarios/releases/el96@rpm-standard1.sh create mode 100644 test/scenarios/releases/el96@rpm-standard2.sh create mode 100644 test/suites/rpm/install.robot create mode 100644 test/suites/rpm/remove.robot rename test/suites/rpm/{install-and-upgrade-successful.robot => upgrade-successful.robot} (80%) diff --git a/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-ec-with-optional.image-bootc b/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-ec-with-optional.image-bootc new file mode 100644 index 0000000000..f78544351a --- /dev/null +++ b/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-ec-with-optional.image-bootc @@ -0,0 +1,3 @@ +{{- if env.Getenv "BREW_EC_RELEASE_VERSION" "" -}} +localhost/rhel96-bootc-brew-ec-with-optional:latest +{{- end }} \ No newline at end of file diff --git a/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-rc-with-optional.image-bootc b/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-rc-with-optional.image-bootc new file mode 100644 index 0000000000..b36340553e --- /dev/null +++ b/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-rc-with-optional.image-bootc @@ -0,0 +1,3 @@ +{{- if env.Getenv "BREW_RC_RELEASE_VERSION" "" -}} +localhost/rhel96-bootc-brew-rc-with-optional:latest +{{- end }} \ No newline at end of file diff --git a/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-zstream-with-optional.image-bootc b/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-zstream-with-optional.image-bootc new file mode 100644 index 0000000000..33b6c39acd --- /dev/null +++ b/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-zstream-with-optional.image-bootc @@ -0,0 +1,3 @@ +{{- if env.Getenv "BREW_Y0_RELEASE_VERSION" "" -}} +localhost/rhel96-bootc-brew-zstream-with-optional:latest +{{- end }} \ No newline at end of file diff --git a/test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc.image-bootc b/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc.image-bootc similarity index 100% rename from test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc.image-bootc rename to test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc.image-bootc diff --git a/test/resources/microshift-host.resource b/test/resources/microshift-host.resource index ed3986c405..a61b5fa3e4 100644 --- a/test/resources/microshift-host.resource +++ b/test/resources/microshift-host.resource @@ -99,6 +99,11 @@ Is System OSTree ... sudo=True return_stderr=False return_stdout=False return_rc=True IF ${rc} == 0 RETURN ${TRUE} ELSE RETURN ${FALSE} +System Should Not Be Ostree + [Documentation] Make sure we run on a non-ostree system + ${is_ostree}= Is System OSTree + Should Not Be True ${is_ostree} + System Should Be Rebooted [Documentation] Assert if the system rebooted comparing the current and provided boot identifier [Arguments] ${old_bootid} diff --git a/test/resources/microshift-rpm.resource b/test/resources/microshift-rpm.resource index 7f97d3f1b1..3335a64ca4 100644 --- a/test/resources/microshift-rpm.resource +++ b/test/resources/microshift-rpm.resource @@ -107,3 +107,11 @@ Verify MicroShift RPM Install # Checks only config files from RPM packages excluding modification time check Command Should Work rpm -qa microshift\* | xargs -I {} bash -c 'echo {}; sudo rpm -V --configfiles --nomtime {}' + +Pull Secret Should Be Installed + [Documentation] Check that the kickstart file installed a pull secret for us + ${stdout} ${stderr} ${rc}= SSHLibrary.Execute Command + ... stat /etc/crio/openshift-pull-secret + ... sudo=True return_rc=True return_stderr=True return_stdout=True + Log Many ${stdout} ${stderr} + Should Be Equal As Integers 0 ${rc} diff --git a/test/scenarios-bootc/releases/el96-lrel@standard1.sh b/test/scenarios-bootc/releases/el96-lrel@standard1.sh index ec0b303b3d..d0b8ffd9a0 100644 --- a/test/scenarios-bootc/releases/el96-lrel@standard1.sh +++ b/test/scenarios-bootc/releases/el96-lrel@standard1.sh @@ -11,7 +11,7 @@ scenario_create_vms() { fi prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" - launch_vm --boot_blueprint rhel96-bootc + launch_vm --boot_blueprint "${start_image}" } scenario_remove_vms() { diff --git a/test/scenarios-bootc/releases/el96-lrel@standard2.sh b/test/scenarios-bootc/releases/el96-lrel@standard2.sh index 9d441214de..ceac34c093 100644 --- a/test/scenarios-bootc/releases/el96-lrel@standard2.sh +++ b/test/scenarios-bootc/releases/el96-lrel@standard2.sh @@ -11,7 +11,7 @@ scenario_create_vms() { fi prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" - launch_vm --boot_blueprint rhel96-bootc + launch_vm --boot_blueprint "${start_image}" } scenario_remove_vms() { diff --git a/test/scenarios/presubmits/el96-src@rpm-install.sh b/test/scenarios/presubmits/el96-src@rpm-install.sh index 21576362a6..8cc976a807 100644 --- a/test/scenarios/presubmits/el96-src@rpm-install.sh +++ b/test/scenarios/presubmits/el96-src@rpm-install.sh @@ -112,5 +112,7 @@ scenario_run_tests() { --variable "SOURCE_REPO_URL:${source_repo_url}" \ --variable "TARGET_VERSION:${target_version}" \ --variable "PREVIOUS_MINOR_VERSION:${PREVIOUS_MINOR_VERSION}" \ - suites/rpm/install-and-upgrade-successful.robot + suites/rpm/install.robot \ + suites/rpm/remove.robot \ + suites/rpm/upgrade-successful.robot } diff --git a/test/scenarios/releases/el96@rpm-install-upgrade.sh b/test/scenarios/releases/el96@rpm-install-upgrade.sh new file mode 100644 index 0000000000..738bfade3f --- /dev/null +++ b/test/scenarios/releases/el96@rpm-install-upgrade.sh @@ -0,0 +1,117 @@ +#!/bin/bash + +# Sourced from scenario.sh and uses functions defined there. + +# The RPM-based image used to create the VM for this test does not +# include MicroShift or greenboot, so tell the framework not to wait +# for greenboot to finish when creating the VM. +export SKIP_GREENBOOT=true + +# NOTE: Unlike most suites, these tests rely on being run IN ORDER to +# ensure the host is in a good state at the start of each test. We +# could have separated them and run them as separate scenarios, but +# did not want to spend the resources on a new VM. +export TEST_RANDOMIZATION=none + +configure_microshift_mirror() { + local -r repo=$1 + + # `repo` might be empty if we install microshift from rhocp + if [[ -z "${repo}" ]] ; then + return + fi + + # `repo` might be an enabled repo from a released version instead + # of a mirror. + if [[ ! "${repo}" =~ ^http ]]; then + return + fi + + local -r tmp_file=$(mktemp) + tee "${tmp_file}" >/dev/null </dev/null </dev/null </dev/null < Date: Mon, 6 Oct 2025 17:33:47 +0200 Subject: [PATCH 2/2] adding empty line at the end of files --- .../group3/rhel96-bootc-brew-ec-with-optional.image-bootc | 2 +- .../group3/rhel96-bootc-brew-rc-with-optional.image-bootc | 2 +- .../group3/rhel96-bootc-brew-zstream-with-optional.image-bootc | 2 +- test/scenarios/releases/el96@rpm-install-upgrade.sh | 2 +- test/scenarios/releases/el96@rpm-standard1.sh | 2 +- test/scenarios/releases/el96@rpm-standard2.sh | 2 +- test/suites/rpm/install.robot | 2 +- test/suites/rpm/remove.robot | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-ec-with-optional.image-bootc b/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-ec-with-optional.image-bootc index f78544351a..b40ceb3b68 100644 --- a/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-ec-with-optional.image-bootc +++ b/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-ec-with-optional.image-bootc @@ -1,3 +1,3 @@ {{- if env.Getenv "BREW_EC_RELEASE_VERSION" "" -}} localhost/rhel96-bootc-brew-ec-with-optional:latest -{{- end }} \ No newline at end of file +{{- end }} diff --git a/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-rc-with-optional.image-bootc b/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-rc-with-optional.image-bootc index b36340553e..76cde0cba0 100644 --- a/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-rc-with-optional.image-bootc +++ b/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-rc-with-optional.image-bootc @@ -1,3 +1,3 @@ {{- if env.Getenv "BREW_RC_RELEASE_VERSION" "" -}} localhost/rhel96-bootc-brew-rc-with-optional:latest -{{- end }} \ No newline at end of file +{{- end }} diff --git a/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-zstream-with-optional.image-bootc b/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-zstream-with-optional.image-bootc index 33b6c39acd..af993ec682 100644 --- a/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-zstream-with-optional.image-bootc +++ b/test/image-blueprints-bootc/layer1-base/group3/rhel96-bootc-brew-zstream-with-optional.image-bootc @@ -1,3 +1,3 @@ {{- if env.Getenv "BREW_Y0_RELEASE_VERSION" "" -}} localhost/rhel96-bootc-brew-zstream-with-optional:latest -{{- end }} \ No newline at end of file +{{- end }} diff --git a/test/scenarios/releases/el96@rpm-install-upgrade.sh b/test/scenarios/releases/el96@rpm-install-upgrade.sh index 738bfade3f..d9b8506c86 100644 --- a/test/scenarios/releases/el96@rpm-install-upgrade.sh +++ b/test/scenarios/releases/el96@rpm-install-upgrade.sh @@ -114,4 +114,4 @@ scenario_run_tests() { suites/rpm/install.robot \ suites/rpm/remove.robot \ suites/rpm/upgrade-successful.robot -} \ No newline at end of file +} diff --git a/test/scenarios/releases/el96@rpm-standard1.sh b/test/scenarios/releases/el96@rpm-standard1.sh index 069ff89aeb..eb7e86fdee 100644 --- a/test/scenarios/releases/el96@rpm-standard1.sh +++ b/test/scenarios/releases/el96@rpm-standard1.sh @@ -81,4 +81,4 @@ scenario_run_tests() { --variable "EXPECTED_OS_VERSION:9.6" \ suites/rpm/install.robot \ suites/standard1/ suites/selinux/validate-selinux-policy.robot -} \ No newline at end of file +} diff --git a/test/scenarios/releases/el96@rpm-standard2.sh b/test/scenarios/releases/el96@rpm-standard2.sh index 7f0f8125c2..7f4a3af16b 100644 --- a/test/scenarios/releases/el96@rpm-standard2.sh +++ b/test/scenarios/releases/el96@rpm-standard2.sh @@ -82,4 +82,4 @@ scenario_run_tests() { --variable "EXPECTED_OS_VERSION:9.6" \ suites/rpm/install.robot \ suites/standard2/ -} \ No newline at end of file +} diff --git a/test/suites/rpm/install.robot b/test/suites/rpm/install.robot index 2a9fe803a0..8eb93793be 100644 --- a/test/suites/rpm/install.robot +++ b/test/suites/rpm/install.robot @@ -62,4 +62,4 @@ Teardown Install Third Party Packages With Warnings [Documentation] Install these separately to avoid having warnings ... show up in the warning check when installing MicroShift. - Command Should Work dnf install -y NetworkManager-ovs containers-common \ No newline at end of file + Command Should Work dnf install -y NetworkManager-ovs containers-common diff --git a/test/suites/rpm/remove.robot b/test/suites/rpm/remove.robot index 305c7e278d..a3d681f8fa 100644 --- a/test/suites/rpm/remove.robot +++ b/test/suites/rpm/remove.robot @@ -43,4 +43,4 @@ Setup Teardown [Documentation] Test suite teardown - Logout MicroShift Host \ No newline at end of file + Logout MicroShift Host