diff --git a/scripts/fetch_tools.sh b/scripts/fetch_tools.sh index 308da1927e..f451762fb3 100755 --- a/scripts/fetch_tools.sh +++ b/scripts/fetch_tools.sh @@ -260,11 +260,12 @@ gettool_ginkgo() { source "${SCRIPT_DIR}/../test/bin/common_versions.sh" local -r repo_url="https://${GITHUB_TOKEN}@github.com/openshift/openshift-tests-private.git" + local -r repo_branch="${OPENSHIFT_TESTS_PRIVATE_REPO_BRANCH}" + local -r repo_commit="${OPENSHIFT_TESTS_PRIVATE_REPO_COMMIT}" + local clone_dir="${WORK_DIR}/openshift-tests-private" + local -r binary_path="${GINKGO_TEST_BINARY}" - local -r release_branch="release-4.${MINOR_VERSION}" - - # Skip if binary already exists - [[ -f "${binary_path}" ]] && return 0 + local -r handleresult_script="${HANDLERESULT_SCRIPT}" # Check if Go is available if ! command -v go &> /dev/null; then @@ -272,38 +273,49 @@ gettool_ginkgo() { return 1 fi - # Ensure binary directory exists + # Check if binary and handleresult.py already exist + [[ -f "${binary_path}" ]] && [[ -f "${handleresult_script}" ]] && return 0 mkdir -p "$(dirname "${binary_path}")" - # Use global WORK_DIR for cloning - local clone_dir="${WORK_DIR}/openshift-tests-private" - # Clone repository with release branch preference - if ! git clone --depth 1 --branch "${release_branch}" "${repo_url}" "${clone_dir}" 2>/dev/null; then - echo "Branch ${release_branch} not found, cloning default branch..." - if ! git clone --depth 1 "${repo_url}" "${clone_dir}"; then - echo "Error: Failed to clone repository" - return 1 - fi + if ! git clone --depth 1000 --branch "${repo_branch}" "${repo_url}" "${clone_dir}" 2>/dev/null; then + echo "Error: Failed to clone repository" + return 1 fi - # Build the binary pushd "${clone_dir}" &>/dev/null - local test_binary="./bin/extended-platform-tests" - go build -o "${test_binary}" ./cmd/extended-platform-tests + # Checkout a valid commit to be sure ginkgo tests are working + if ! (git checkout --quiet "${repo_commit}"); then + echo "Error: Failed to checkout specific commit" + return 1 + fi + + # Build the binary + make all # Copy binary to centralized location + local test_binary="./bin/extended-platform-tests" if [[ -f "${test_binary}" ]]; then cp "${test_binary}" "${binary_path}" chmod +x "${binary_path}" echo "Binary installed to ${binary_path}" - popd &>/dev/null else echo "Error: Test binary not found after build" - popd &>/dev/null return 1 fi + + # Copy handleresult.py to the tools directory + local handleresult_script_local="./pipeline/handleresult.py" + if [[ -f "${handleresult_script_local}" ]] && [[ ! -f "${handleresult_script}" ]]; then + cp "${handleresult_script_local}" "${handleresult_script}" + chmod +x "${handleresult_script}" + echo "handleresult.py installed to ${handleresult_script}" + else + echo "Error: pipeline/handleresult.py not found in repository" + return 1 + fi + popd &>/dev/null } tool_getters=$(declare -F | awk '$3 ~ /^gettool_/ {print $3}' | sed 's/^gettool_//g') diff --git a/test/bin/common.sh b/test/bin/common.sh index 2f064cbe47..1886a86010 100644 --- a/test/bin/common.sh +++ b/test/bin/common.sh @@ -27,6 +27,7 @@ export IMAGEDIR="${OUTPUTDIR}/test-images" # Ginkgo test binary path export GINKGO_TEST_BINARY="${OUTPUTDIR}/bin/extended-platform-tests" +export HANDLERESULT_SCRIPT="${OUTPUTDIR}/bin/handleresult.py" # The storage pool base name for VMs. # The actual pool names will be '${VM_POOL_BASENAME}-${SCENARIO}'. diff --git a/test/bin/common_versions.sh b/test/bin/common_versions.sh index 0876cc74a7..a16fccd1c9 100644 --- a/test/bin/common_versions.sh +++ b/test/bin/common_versions.sh @@ -138,3 +138,12 @@ export BREW_EC_RELEASE_VERSION # Set the release type to ec, rc or zstream LATEST_RELEASE_TYPE="rc" export LATEST_RELEASE_TYPE + +BREW_LREL_RELEASE_VERSION="${BREW_EC_RELEASE_VERSION}" +export BREW_LREL_RELEASE_VERSION + +# Branch and commit for the openshift-tests-private repository +OPENSHIFT_TESTS_PRIVATE_REPO_BRANCH="release-4.${MINOR_VERSION}" +OPENSHIFT_TESTS_PRIVATE_REPO_COMMIT="b6418066dc1c0fc55f8d0213792041770a0baf80" +export OPENSHIFT_TESTS_PRIVATE_REPO_BRANCH +export OPENSHIFT_TESTS_PRIVATE_REPO_COMMIT \ No newline at end of file diff --git a/test/bin/scenario.sh b/test/bin/scenario.sh index 46ac1ff4b8..42ce152f9c 100755 --- a/test/bin/scenario.sh +++ b/test/bin/scenario.sh @@ -31,6 +31,7 @@ SKIP_GREENBOOT=${SKIP_GREENBOOT:-false} # may be overridden in scenario file IMAGE_SIGSTORE_ENABLED=false # may be overridden in scenario file VNC_CONSOLE=${VNC_CONSOLE:-false} # may be overridden in global settings file TEST_RANDOMIZATION="all" # may be overridden in scenario file +TEST_EXCLUDES="none" # may be overridden in scenario file TEST_EXECUTION_TIMEOUT="30m" # may be overriden in scenario file SUBSCRIPTION_MANAGER_PLUGIN="${SUBSCRIPTION_MANAGER_PLUGIN:-${SCRIPTDIR}/subscription_manager_register.sh}" # may be overridden in global settings file RUN_HOST_OVERRIDE="" # target any given VM for running scenarios @@ -1064,6 +1065,7 @@ EOF if ! ${timeout_robot} \ --name "${SCENARIO}" \ --randomize "${TEST_RANDOMIZATION}" \ + --exclude "${TEST_EXCLUDES}" \ --loglevel TRACE \ --listener "${TESTDIR}/resources/sos-on-failure-listener.py" \ --pythonpath "${TESTDIR}/resources" \ @@ -1137,7 +1139,7 @@ run_gingko_tests() { local -r filter_pattern="$1" echo "Applying filter: ${filter_pattern}" if [[ "${filter_pattern}" == ~* ]]; then - sed -i "/${filter_pattern#~}/d" "${case_selected}" + sed -i "/${filter_pattern#\~}/d" "${case_selected}" else sed -i -n "/${filter_pattern}/p" "${case_selected}" fi @@ -1150,20 +1152,74 @@ run_gingko_tests() { cat "${case_selected}" echo "-----------------------------------------------------" - # Run the tests and capture output - if ! "${GINKGO_TEST_BINARY}" run --timeout 60m --junit-dir="${test_results_dir}" -f "${case_selected}" 2>&1 | tee "${test_results_dir}/test-output.log"; then - record_junit "${vmname}" "run_gingko_tests" "FAILED" - return 1 + # Make sure the test execution times out after a predefined period. + # The 'timeout' command sends the HUP signal and, if the test does not + # exit after 5m, it sends the KILL signal to terminate the process. + local timeout_ginkgo="timeout -v --kill-after=5m ${TEST_EXECUTION_TIMEOUT} ${GINKGO_TEST_BINARY}" + if [ -t 0 ]; then + # Disable timeout for interactive mode when stdin is a terminal. + # This is necessary for proper handling of test interruption by user. + # shellcheck disable=SC2034 + timeout_ginkgo="${GINKGO_TEST_BINARY}" fi - record_junit "${vmname}" "run_gingko_tests" "OK" + # Run the tests and capture output with 10m timeout for every test case + echo "Gingko test execution started..." + ginkgo_result_success=true + if ! eval '${timeout_ginkgo} run --timeout 10m --junit-dir=${test_results_dir} -f ${case_selected}' 2>&1 | tee "${test_results_dir}/test-output.log"; then + if [ $? -ge 124 ] ; then + record_junit "${vmname}" "run_test_timed_out_${TEST_EXECUTION_TIMEOUT}" "FAILED" + fi + ginkgo_result_success=false + fi + echo "Gingko test execution completed" popd &>/dev/null + # Clean the JUnit XML files + echo "Cleaning JUnit XML files to remove 'Monitor cluster while tests execute' test case" + cleanup_success=true + if [[ ! -f "${HANDLERESULT_SCRIPT}" ]]; then + echo "Warning: ${HANDLERESULT_SCRIPT} not found. Skipping XML cleanup." + else + for junit_file in "${test_results_dir}"/junit_e2e_*.xml; do + if [[ -f "${junit_file}" ]]; then + filename=$(basename "${junit_file}") + echo "Processing: ${filename}" + + # Create backup + cp "${junit_file}" "${junit_file}.backup" + + # Clean the XML + temp_file="${junit_file}.tmp" + if python3 "${HANDLERESULT_SCRIPT}" -a replace -i "${junit_file}" -o "${temp_file}" 2>/dev/null; then + mv "${temp_file}" "${junit_file}" + echo "✓ Cleaned: ${filename}" + rm "${junit_file}.backup" # Remove backup on success + else + echo "✗ Failed to clean: ${filename} (restored from backup)" + mv "${junit_file}.backup" "${junit_file}" # Restore from backup + cleanup_success=false + fi + fi + done + fi + # Display results summary - echo "Gingko test execution completed" echo "Results are available in: ${test_results_dir}" - if [[ -f "${test_results_dir}/test-output.log" ]]; then - echo "Test output log: ${test_results_dir}/test-output.log" + if [[ "${cleanup_success}" == "true" ]]; then + echo "Unit XML files have been cleaned ('Monitor cluster while tests execute' test case removed)" + record_junit "${vmname}" "clean_junit_xml_files" "OK" + else + echo "Some XML files could not be cleaned (originals preserved)" + record_junit "${vmname}" "clean_junit_xml_files" "FAILED" + fi + + # Record the junit result of the ginkgo tests + if [[ "${ginkgo_result_success}" == "true" ]]; then + record_junit "${vmname}" "run_gingko_tests" "OK" + else + record_junit "${vmname}" "run_gingko_tests" "FAILED" + exit 1 fi } diff --git a/test/image-blueprints-bootc/layer1-base/group2/rhel94-bootc-brew-y2-with-optional.containerfile b/test/image-blueprints-bootc/layer1-base/group2/rhel94-bootc-brew-y2-with-optional.containerfile index d11e489630..74f2bf006e 100644 --- a/test/image-blueprints-bootc/layer1-base/group2/rhel94-bootc-brew-y2-with-optional.containerfile +++ b/test/image-blueprints-bootc/layer1-base/group2/rhel94-bootc-brew-y2-with-optional.containerfile @@ -38,6 +38,7 @@ RUN firewall-offline-cmd --zone=public --add-port=22/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=8889/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/layer1-base/group2/rhel96-bootc-brew-ec-with-optional.containerfile b/test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-brew-ec-with-optional.containerfile index 3057117fd9..0fb9c6fe3d 100644 --- a/test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-brew-ec-with-optional.containerfile +++ b/test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-brew-ec-with-optional.containerfile @@ -43,10 +43,24 @@ RUN firewall-offline-cmd --zone=public --add-port=22/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=8889/tcp && \ firewall-offline-cmd --zone=public --add-port=30000-32767/tcp && \ firewall-offline-cmd --zone=public --add-port=30000-32767/udp -# Prepare system for testing Generic Device Plugin -COPY --chmod=755 ./bootc-images/build-serialsim.sh /tmp/build-serialsim.sh -RUN /tmp/build-serialsim.sh && rm -f /tmp/build-serialsim.sh +# Prepare system for testing Generic Device Plugin. +# Upgrade the kernel to keep the same procedure with RHEL and CentOS. +# CentOS requires upgrade because of a different package retention policy +# which means that the kernel in the base bootc image might no longer +# be available in the repositories. +# hadolint ignore=DL3003 +RUN dnf upgrade kernel -y && \ + KERNEL_VER=$(rpm -q --qf "%{VERSION}-%{RELEASE}" kernel); \ + KERNEL_VER_ARCH="${KERNEL_VER}.$(uname -m)"; \ + dnf install -y git make "kernel-devel-${KERNEL_VER}" python3-pyserial && \ + dnf clean all && \ + git clone https://github.com/pmtk/serialsim.git /tmp/serialsim && \ + cd /tmp/serialsim && \ + make KERNEL="${KERNEL_VER_ARCH}" all install && \ + rm -rf /tmp/serialsim + # {{- end -}} diff --git a/test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-brew-rc-with-optional.containerfile b/test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-brew-rc-with-optional.containerfile index 8a88fd591a..6e52ba83d4 100644 --- a/test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-brew-rc-with-optional.containerfile +++ b/test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-brew-rc-with-optional.containerfile @@ -43,10 +43,23 @@ RUN firewall-offline-cmd --zone=public --add-port=22/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=8889/tcp && \ firewall-offline-cmd --zone=public --add-port=30000-32767/tcp && \ firewall-offline-cmd --zone=public --add-port=30000-32767/udp -# Prepare system for testing Generic Device Plugin -COPY --chmod=755 ./bootc-images/build-serialsim.sh /tmp/build-serialsim.sh -RUN /tmp/build-serialsim.sh && rm -f /tmp/build-serialsim.sh +# Prepare system for testing Generic Device Plugin. +# Upgrade the kernel to keep the same procedure with RHEL and CentOS. +# CentOS requires upgrade because of a different package retention policy +# which means that the kernel in the base bootc image might no longer +# be available in the repositories. +# hadolint ignore=DL3003 +RUN dnf upgrade kernel -y && \ + KERNEL_VER=$(rpm -q --qf "%{VERSION}-%{RELEASE}" kernel); \ + KERNEL_VER_ARCH="${KERNEL_VER}.$(uname -m)"; \ + dnf install -y git make "kernel-devel-${KERNEL_VER}" python3-pyserial && \ + dnf clean all && \ + git clone https://github.com/pmtk/serialsim.git /tmp/serialsim && \ + cd /tmp/serialsim && \ + make KERNEL="${KERNEL_VER_ARCH}" all install && \ + rm -rf /tmp/serialsim # {{- end -}} diff --git a/test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-brew-y1-with-optional.containerfile b/test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-brew-y1-with-optional.containerfile index edb1e43b9a..6461a928e8 100644 --- a/test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-brew-y1-with-optional.containerfile +++ b/test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-brew-y1-with-optional.containerfile @@ -43,6 +43,7 @@ RUN firewall-offline-cmd --zone=public --add-port=22/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=8889/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/layer1-base/group2/rhel96-bootc-brew-zstream-with-optional.containerfile b/test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-brew-zstream-with-optional.containerfile index e47e20637c..d551cb9f21 100644 --- a/test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-brew-zstream-with-optional.containerfile +++ b/test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-brew-zstream-with-optional.containerfile @@ -43,10 +43,24 @@ RUN firewall-offline-cmd --zone=public --add-port=22/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=8889/tcp && \ firewall-offline-cmd --zone=public --add-port=30000-32767/tcp && \ firewall-offline-cmd --zone=public --add-port=30000-32767/udp -# Prepare system for testing Generic Device Plugin -COPY --chmod=755 ./bootc-images/build-serialsim.sh /tmp/build-serialsim.sh -RUN /tmp/build-serialsim.sh && rm -f /tmp/build-serialsim.sh +# Prepare system for testing Generic Device Plugin. +# Upgrade the kernel to keep the same procedure with RHEL and CentOS. +# CentOS requires upgrade because of a different package retention policy +# which means that the kernel in the base bootc image might no longer +# be available in the repositories. +# hadolint ignore=DL3003 +RUN dnf upgrade kernel -y && \ +KERNEL_VER=$(rpm -q --qf "%{VERSION}-%{RELEASE}" kernel); \ +KERNEL_VER_ARCH="${KERNEL_VER}.$(uname -m)"; \ +dnf install -y git make "kernel-devel-${KERNEL_VER}" python3-pyserial && \ +dnf clean all && \ +git clone https://github.com/pmtk/serialsim.git /tmp/serialsim && \ +cd /tmp/serialsim && \ +make KERNEL="${KERNEL_VER_ARCH}" all install && \ +rm -rf /tmp/serialsim + # {{- end -}} diff --git a/test/image-blueprints/layer1-base/group2/rhel94-brew-y2-with-optionals.toml b/test/image-blueprints/layer1-base/group2/rhel94-brew-y2-with-optionals.toml index 072472bb6d..e041e88c14 100644 --- a/test/image-blueprints/layer1-base/group2/rhel94-brew-y2-with-optionals.toml +++ b/test/image-blueprints/layer1-base/group2/rhel94-brew-y2-with-optionals.toml @@ -42,6 +42,7 @@ ports = [ "443:tcp", "5353:udp", "6443:tcp", + "8889:tcp", "30000-32767:tcp", "30000-32767:udp", ] diff --git a/test/image-blueprints/layer1-base/group3/rhel96-brew-y1-with-optionals.toml b/test/image-blueprints/layer1-base/group3/rhel96-brew-y1-with-optionals.toml index 25a2851c29..1da4ec8752 100644 --- a/test/image-blueprints/layer1-base/group3/rhel96-brew-y1-with-optionals.toml +++ b/test/image-blueprints/layer1-base/group3/rhel96-brew-y1-with-optionals.toml @@ -53,6 +53,7 @@ ports = [ "443:tcp", "5353:udp", "6443:tcp", + "8889:tcp", "30000-32767:tcp", "30000-32767:udp", ] diff --git a/test/image-blueprints/layer1-base/group4/rhel96-brew-ec-with-optionals.toml b/test/image-blueprints/layer1-base/group4/rhel96-brew-ec-with-optionals.toml index 5f08416eb8..64f742feed 100644 --- a/test/image-blueprints/layer1-base/group4/rhel96-brew-ec-with-optionals.toml +++ b/test/image-blueprints/layer1-base/group4/rhel96-brew-ec-with-optionals.toml @@ -43,6 +43,10 @@ version = "{{ env.Getenv "BREW_EC_RELEASE_VERSION" }}" name = "microshift-test-agent" version = "*" +[[packages]] +name = "systemd-resolved" +version = "*" + [customizations.services] enabled = ["microshift", "microshift-test-agent"] @@ -53,6 +57,7 @@ ports = [ "443:tcp", "5353:udp", "6443:tcp", + "8889:tcp", "30000-32767:tcp", "30000-32767:udp", ] diff --git a/test/image-blueprints/layer1-base/group4/rhel96-brew-rc-with-optionals.toml b/test/image-blueprints/layer1-base/group4/rhel96-brew-rc-with-optionals.toml index 2160a33f50..932b3c5a1c 100644 --- a/test/image-blueprints/layer1-base/group4/rhel96-brew-rc-with-optionals.toml +++ b/test/image-blueprints/layer1-base/group4/rhel96-brew-rc-with-optionals.toml @@ -43,6 +43,10 @@ version = "{{ env.Getenv "BREW_RC_RELEASE_VERSION" }}" name = "microshift-test-agent" version = "*" +[[packages]] +name = "systemd-resolved" +version = "*" + [customizations.services] enabled = ["microshift", "microshift-test-agent"] @@ -53,6 +57,7 @@ ports = [ "443:tcp", "5353:udp", "6443:tcp", + "8889:tcp", "30000-32767:tcp", "30000-32767:udp", ] diff --git a/test/image-blueprints/layer1-base/group4/rhel96-brew-zstream-with-optionals.toml b/test/image-blueprints/layer1-base/group4/rhel96-brew-zstream-with-optionals.toml index 5b60a6eb22..603f538a72 100644 --- a/test/image-blueprints/layer1-base/group4/rhel96-brew-zstream-with-optionals.toml +++ b/test/image-blueprints/layer1-base/group4/rhel96-brew-zstream-with-optionals.toml @@ -43,6 +43,10 @@ version = "{{ env.Getenv "BREW_Y0_RELEASE_VERSION" }}" name = "microshift-test-agent" version = "*" +[[packages]] +name = "systemd-resolved" +version = "*" + [customizations.services] enabled = ["microshift", "microshift-test-agent"] @@ -53,6 +57,7 @@ ports = [ "443:tcp", "5353:udp", "6443:tcp", + "8889:tcp", "30000-32767:tcp", "30000-32767:udp", ] diff --git a/test/image-blueprints/layer2-presubmit/group1/rhel96-lrel-optionals-tuned.toml b/test/image-blueprints/layer2-presubmit/group1/rhel96-lrel-optionals-tuned.toml new file mode 100644 index 0000000000..1ed32e9db6 --- /dev/null +++ b/test/image-blueprints/layer2-presubmit/group1/rhel96-lrel-optionals-tuned.toml @@ -0,0 +1,125 @@ +{{- if and (env.Getenv "BREW_LREL_RELEASE_VERSION" "") (env.Getenv "BREW_Y1_RELEASE_VERSION" "") -}} +{{- /* + + We wrap this template in a test so that the body of the output is + empty when there is no "current" version release. The output file + must end up completely empty, so we need to remove whitespace from + around the first and last template instructions. + +*/ -}} + +name = "rhel-9.6-microshift-brew-tuned-4.{{ .Env.MINOR_VERSION}}-{{ .Env.LATEST_RELEASE_TYPE}}" +description = "A RHEL 9.6 image with already built and released RPMs like EC, RC, or Z-stream release: {{ .Env.BREW_LREL_RELEASE_VERSION }}" +version = "0.0.1" +modules = [] +groups = [] +distro = "rhel-96" + +# Parent specification directive recognized by test/bin/build_images.sh to be +# used with the '--parent' argument of 'osbuild-composer' +# parent = "rhel-9.6-microshift-brew-optionals-4.{{ .Env.PREVIOUS_MINOR_VERSION }}-zstream" + +{{ range (env.Getenv "MICROSHIFT_MANDATORY_RPMS" | strings.Split " ") }} +[[packages]] +name = "{{ . }}" +version = "{{ env.Getenv "BREW_LREL_RELEASE_VERSION" }}" +{{ end }} + +{{ range (env.Getenv "MICROSHIFT_OPTIONAL_RPMS" | strings.Split " ") }} +[[packages]] +name = "{{ . }}" +version = "{{ env.Getenv "BREW_LREL_RELEASE_VERSION" }}" +{{ end }} + +{{- if and (env.Getenv "UNAME_M" "") (eq "x86_64" .Env.UNAME_M) }} +{{ range (env.Getenv "MICROSHIFT_X86_64_RPMS" | strings.Split " ") }} +[[packages]] +name = "{{ . }}" +version = "{{ env.Getenv "BREW_LREL_RELEASE_VERSION" }}" +{{ end }} +{{- end }} + +[[packages]] +name = "microshift-test-agent" +version = "*" + +[[packages]] +name = "systemd-resolved" +version = "*" + +{{- if and (env.Getenv "UNAME_M" "") (eq "x86_64" .Env.UNAME_M) }} +# Kernel RT is only available for x86_64 +[customizations.kernel] +name = "kernel-rt" +{{- end }} + +[customizations.services] +enabled = ["microshift-test-agent", "microshift", "microshift-tuned"] + +[customizations.firewall] +ports = [ + "22:tcp", + "80:tcp", + "443:tcp", + "5353:udp", + "6443:tcp", + "8889:tcp", + "30000-32767:tcp", + "30000-32767:udp", +] + +[customizations.firewall.services] +enabled = ["mdns", "ssh", "http", "https"] + +[[customizations.firewall.zones]] +name = "trusted" +sources = ["10.42.0.0/16", "169.254.169.1", "fd01::/48"] + +[[customizations.files]] +path = "/etc/microshift/config.yaml" +data = """ +kubelet: + cpuManagerPolicy: static + cpuManagerPolicyOptions: + full-pcpus-only: "true" + cpuManagerReconcilePeriod: 5s + memoryManagerPolicy: Static + topologyManagerPolicy: single-numa-node + reservedSystemCPUs: 0-1 + reservedMemory: + - limits: + memory: 1100Mi + numaNode: 0 + kubeReserved: + memory: 500Mi + systemReserved: + memory: 500Mi + evictionHard: + imagefs.available: 15% + memory.available: 100Mi + nodefs.available: 10% + nodefs.inodesFree: 5% + evictionPressureTransitionPeriod: 0s +""" + +[[customizations.files]] +path = "/etc/tuned/microshift-baseline-variables.conf" +data = """ +# Isolated cores should be complementary to kubelet's reserved CPUs. +# Isolated and reserved CPUs should contain all online CPUs. +# Core #3 is for testing offlining hence skipped. +isolated_cores=2,4-5 +hugepages_size=2M +hugepages=10 +additional_args=test1=on test2=true dummy +offline_cpu_set=3 +""" + +[[customizations.files]] +path = "/etc/microshift/tuned.yaml" +data = """ +profile: microshift-baseline +reboot_after_apply: True +""" + +{{- end -}} diff --git a/test/scenarios-bootc/releases/el96-lrel@ai-model-serving-online.sh b/test/scenarios-bootc/releases/el96-lrel@ai-model-serving-online.sh index 3aea260575..2306fa9079 100644 --- a/test/scenarios-bootc/releases/el96-lrel@ai-model-serving-online.sh +++ b/test/scenarios-bootc/releases/el96-lrel@ai-model-serving-online.sh @@ -2,6 +2,8 @@ # Sourced from scenario.sh and uses functions defined there. +start_image="rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + # Currently, RHOAI is only available for x86_64 check_platform() { local -r record_junit=${1:-false} @@ -15,20 +17,35 @@ check_platform() { } scenario_create_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + check_platform true # Increased disk size because of the additional embedded images (especially OVMS which is ~3.5GiB) - LVM_SYSROOT_SIZE=20480 prepare_kickstart host1 kickstart-bootc.ks.template "rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + LVM_SYSROOT_SIZE=20480 prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" launch_vm --boot_blueprint rhel96-bootc --vm_disksize 30 } scenario_remove_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + check_platform remove_vm host1 } scenario_run_tests() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + check_platform run_tests host1 \ diff --git a/test/scenarios-bootc/releases/el96-lrel@dual-stack.sh b/test/scenarios-bootc/releases/el96-lrel@dual-stack.sh index e8d98152bf..62db73086f 100644 --- a/test/scenarios-bootc/releases/el96-lrel@dual-stack.sh +++ b/test/scenarios-bootc/releases/el96-lrel@dual-stack.sh @@ -2,16 +2,33 @@ # Sourced from scenario.sh and uses functions defined there. +start_image="rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + scenario_create_vms() { - prepare_kickstart host1 kickstart-bootc.ks.template "rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" launch_vm --boot_blueprint rhel96-bootc --network "${VM_DUAL_STACK_NETWORK}" } scenario_remove_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + local -r vmname=$(full_vm_name host1) # Valid IP addresses are the first two entries returned by manage-vm script. local -r vm_ip1=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | head -1) diff --git a/test/scenarios-bootc/releases/el96-lrel@ginkgo-tests.sh b/test/scenarios-bootc/releases/el96-lrel@ginkgo-tests.sh index 06486c35dd..1e9948e27f 100644 --- a/test/scenarios-bootc/releases/el96-lrel@ginkgo-tests.sh +++ b/test/scenarios-bootc/releases/el96-lrel@ginkgo-tests.sh @@ -2,15 +2,32 @@ # Sourced from scenario.sh and uses functions defined there. +start_image="rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + scenario_create_vms() { - prepare_kickstart host1 kickstart-bootc.ks.template "rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" launch_vm --boot_blueprint rhel96-bootc --vm_disksize 30 } scenario_remove_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { - run_gingko_tests host1 + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + run_gingko_tests host1 "~Disruptive" } diff --git a/test/scenarios-bootc/releases/el96-lrel@ipv6.sh b/test/scenarios-bootc/releases/el96-lrel@ipv6.sh index 5e15dafba8..2369c50f85 100644 --- a/test/scenarios-bootc/releases/el96-lrel@ipv6.sh +++ b/test/scenarios-bootc/releases/el96-lrel@ipv6.sh @@ -14,16 +14,33 @@ WEB_SERVER_URL="http://[${VM_BRIDGE_IP}]:${WEB_SERVER_PORT}" # shellcheck disable=SC2034 # used elsewhere MIRROR_REGISTRY_URL="$(hostname):${MIRROR_REGISTRY_PORT}/microshift" +start_image="rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + scenario_create_vms() { # Enable IPv6 single stack in kickstart - prepare_kickstart host1 kickstart-bootc.ks.template "rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" false true + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" false true launch_vm --boot_blueprint rhel96-bootc --network "${VM_IPV6_NETWORK}" } scenario_remove_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + run_tests host1 suites/ipv6/singlestack.robot } diff --git a/test/scenarios-bootc/releases/el96-lrel@multi-nic.sh b/test/scenarios-bootc/releases/el96-lrel@multi-nic.sh index a263a0e824..1f1b7dee52 100644 --- a/test/scenarios-bootc/releases/el96-lrel@multi-nic.sh +++ b/test/scenarios-bootc/releases/el96-lrel@multi-nic.sh @@ -2,17 +2,34 @@ # Sourced from scenario.sh and uses functions defined there. +start_image="rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + scenario_create_vms() { - prepare_kickstart host1 kickstart-bootc.ks.template "rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" # Using multus as secondary network to have 2 nics in different networks. launch_vm --boot_blueprint rhel96-bootc --network default,"${VM_MULTUS_NETWORK}" } scenario_remove_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + local -r vmname=$(full_vm_name host1) local -r vm_ip1=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | head -1) local -r vm_ip2=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | tail -1) diff --git a/test/scenarios-bootc/releases/el96-lrel@optional.sh b/test/scenarios-bootc/releases/el96-lrel@optional.sh new file mode 100644 index 0000000000..fd9c89b5a2 --- /dev/null +++ b/test/scenarios-bootc/releases/el96-lrel@optional.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# Sourced from scenario.sh and uses functions defined there. + +# Redefine network-related settings to use the dedicated network bridge +VM_BRIDGE_IP="$(get_vm_bridge_ip "${VM_MULTUS_NETWORK}")" +# shellcheck disable=SC2034 # used elsewhere +WEB_SERVER_URL="http://${VM_BRIDGE_IP}:${WEB_SERVER_PORT}" + +start_image="rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + +scenario_create_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" + # Two nics - one for macvlan, another for ipvlan (they cannot enslave the same interface) + launch_vm --boot_blueprint rhel96-bootc --network "${VM_MULTUS_NETWORK},${VM_MULTUS_NETWORK}" +} + +scenario_remove_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + remove_vm host1 +} + +scenario_run_tests() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + run_tests host1 \ + --variable "PROMETHEUS_HOST:$(hostname)" \ + --variable "PROMETHEUS_PORT:9092" \ + --variable "LOKI_HOST:$(hostname)" \ + --variable "LOKI_PORT:3200" \ + --variable "PROM_EXPORTER_PORT:8889" \ + suites/optional/ +} diff --git a/test/scenarios-bootc/releases/el96-lrel@osconfig.sh b/test/scenarios-bootc/releases/el96-lrel@osconfig.sh new file mode 100644 index 0000000000..e12f896c52 --- /dev/null +++ b/test/scenarios-bootc/releases/el96-lrel@osconfig.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Sourced from scenario.sh and uses functions defined there. + +start_image="rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + +scenario_create_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" + launch_vm --boot_blueprint rhel96-bootc +} + +scenario_remove_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + remove_vm host1 +} + +scenario_run_tests() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + run_tests host1 \ + suites/osconfig/clusterid.robot \ + suites/osconfig/systemd-resolved.robot +} diff --git a/test/scenarios-bootc/releases/el96-lrel@router.sh b/test/scenarios-bootc/releases/el96-lrel@router.sh index 2199b53167..e98e710d92 100644 --- a/test/scenarios-bootc/releases/el96-lrel@router.sh +++ b/test/scenarios-bootc/releases/el96-lrel@router.sh @@ -2,16 +2,33 @@ # Sourced from scenario.sh and uses functions defined there. +start_image="rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + scenario_create_vms() { - prepare_kickstart host1 kickstart-bootc.ks.template "rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" launch_vm --boot_blueprint rhel96-bootc } scenario_remove_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + run_tests host1 \ suites/router } diff --git a/test/scenarios-bootc/releases/el96-lrel@standard1.sh b/test/scenarios-bootc/releases/el96-lrel@standard1.sh index 052faac7e1..ec0b303b3d 100644 --- a/test/scenarios-bootc/releases/el96-lrel@standard1.sh +++ b/test/scenarios-bootc/releases/el96-lrel@standard1.sh @@ -2,16 +2,33 @@ # Sourced from scenario.sh and uses functions defined there. +start_image="rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + scenario_create_vms() { - prepare_kickstart host1 kickstart-bootc.ks.template "rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" launch_vm --boot_blueprint rhel96-bootc } scenario_remove_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + run_tests host1 \ --variable "EXPECTED_OS_VERSION:9.6" \ suites/standard1/ suites/selinux/validate-selinux-policy.robot diff --git a/test/scenarios-bootc/releases/el96-lrel@standard2.sh b/test/scenarios-bootc/releases/el96-lrel@standard2.sh index 048165ad4d..9d441214de 100644 --- a/test/scenarios-bootc/releases/el96-lrel@standard2.sh +++ b/test/scenarios-bootc/releases/el96-lrel@standard2.sh @@ -2,15 +2,32 @@ # Sourced from scenario.sh and uses functions defined there. +start_image="rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + scenario_create_vms() { - prepare_kickstart host1 kickstart-bootc.ks.template "rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" launch_vm --boot_blueprint rhel96-bootc } scenario_remove_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + run_tests host1 suites/standard2 } diff --git a/test/scenarios-bootc/releases/el96-lrel@storage.sh b/test/scenarios-bootc/releases/el96-lrel@storage.sh index ff07d22704..aa21366d0a 100644 --- a/test/scenarios-bootc/releases/el96-lrel@storage.sh +++ b/test/scenarios-bootc/releases/el96-lrel@storage.sh @@ -2,15 +2,32 @@ # Sourced from scenario.sh and uses functions defined there. +start_image="rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + scenario_create_vms() { - prepare_kickstart host1 kickstart-bootc.ks.template "rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" launch_vm --boot_blueprint rhel96-bootc } scenario_remove_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + run_tests host1 suites/storage/ } diff --git a/test/scenarios-bootc/releases/el96-lrel@telemetry.sh b/test/scenarios-bootc/releases/el96-lrel@telemetry.sh index 68e8e71a33..9ed75dc229 100644 --- a/test/scenarios-bootc/releases/el96-lrel@telemetry.sh +++ b/test/scenarios-bootc/releases/el96-lrel@telemetry.sh @@ -2,16 +2,33 @@ # Sourced from scenario.sh and uses functions defined there. +start_image="rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + scenario_create_vms() { - prepare_kickstart host1 kickstart-bootc.ks.template "rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" launch_vm --boot_blueprint rhel96-bootc } scenario_remove_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + run_tests host1 \ --variable "PROXY_HOST:${VM_BRIDGE_IP}" \ --variable "PROXY_PORT:9001" \ diff --git a/test/scenarios-bootc/releases/el96-y1@el96-lrel@standard1.sh b/test/scenarios-bootc/releases/el96-y1@el96-lrel@standard1.sh index ce888d08d0..84de2f6dc7 100644 --- a/test/scenarios-bootc/releases/el96-y1@el96-lrel@standard1.sh +++ b/test/scenarios-bootc/releases/el96-y1@el96-lrel@standard1.sh @@ -6,18 +6,27 @@ # ensure MicroShift is upgraded before running standard suite tests export TEST_RANDOMIZATION=none +start_image="rhel96-bootc-brew-y1-with-optional" dest_image="rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" scenario_create_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi if ! does_image_exist "${dest_image}"; then echo "Image '${dest_image}' not found - skipping test" return 0 fi - prepare_kickstart host1 kickstart-bootc.ks.template rhel96-bootc-brew-y1-with-optional + prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" launch_vm --boot_blueprint rhel96-bootc } scenario_remove_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi if ! does_image_exist "${dest_image}"; then echo "Image '${dest_image}' not found - skipping test" return 0 @@ -26,6 +35,10 @@ scenario_remove_vms() { } scenario_run_tests() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi if ! does_image_exist "${dest_image}"; then echo "Image '${dest_image}' not found - skipping test" return 0 diff --git a/test/scenarios-bootc/releases/el96-y1@el96-lrel@standard2.sh b/test/scenarios-bootc/releases/el96-y1@el96-lrel@standard2.sh index 02982b866b..5852724f07 100644 --- a/test/scenarios-bootc/releases/el96-y1@el96-lrel@standard2.sh +++ b/test/scenarios-bootc/releases/el96-y1@el96-lrel@standard2.sh @@ -6,18 +6,27 @@ # ensure MicroShift is upgraded before running standard suite tests export TEST_RANDOMIZATION=none +start_image="rhel96-bootc-brew-y1-with-optional" dest_image="rhel96-bootc-brew-${LATEST_RELEASE_TYPE}-with-optional" scenario_create_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi if ! does_image_exist "${dest_image}"; then echo "Image '${dest_image}' not found - skipping test" return 0 fi - prepare_kickstart host1 kickstart-bootc.ks.template rhel96-bootc-brew-y1-with-optional + prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}" launch_vm --boot_blueprint rhel96-bootc } scenario_remove_vms() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi if ! does_image_exist "${dest_image}"; then echo "Image '${dest_image}' not found - skipping test" return 0 @@ -26,6 +35,10 @@ scenario_remove_vms() { } scenario_run_tests() { + if ! does_image_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi if ! does_image_exist "${dest_image}"; then echo "Image '${dest_image}' not found - skipping test" return 0 diff --git a/test/scenarios/presubmits/el96-src@low-latency.sh b/test/scenarios/presubmits/el96-src@low-latency.sh index 7b1a1a202a..0e23cf79ab 100644 --- a/test/scenarios/presubmits/el96-src@low-latency.sh +++ b/test/scenarios/presubmits/el96-src@low-latency.sh @@ -15,7 +15,7 @@ scenario_remove_vms() { } scenario_run_tests() { - # Should not be ran immediately after creating VM because of + # Should not be run immediately after creating VM because of # microshift-tuned rebooting the node to activate the profile. local -r start_time=$(date +%s) while true; do diff --git a/test/scenarios/releases/el96-lrel@backups.sh b/test/scenarios/releases/el96-lrel@backups.sh index 7d38edabf2..469a8ecab2 100644 --- a/test/scenarios/releases/el96-lrel@backups.sh +++ b/test/scenarios/releases/el96-lrel@backups.sh @@ -2,15 +2,32 @@ # Sourced from scenario.sh and uses functions defined there. +start_image="rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" + scenario_create_vms() { - prepare_kickstart host1 kickstart.ks.template "rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" - launch_vm + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart.ks.template "${start_image}" + launch_vm } scenario_remove_vms() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + run_tests host1 suites/backup/backups.robot } diff --git a/test/scenarios/releases/el96-lrel@dual-stack.sh b/test/scenarios/releases/el96-lrel@dual-stack.sh index 0d1fba7326..d211869c03 100644 --- a/test/scenarios/releases/el96-lrel@dual-stack.sh +++ b/test/scenarios/releases/el96-lrel@dual-stack.sh @@ -2,16 +2,33 @@ # Sourced from scenario.sh and uses functions defined there. +start_image="rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" + scenario_create_vms() { - prepare_kickstart host1 kickstart.ks.template "rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart.ks.template "${start_image}" launch_vm --network "${VM_DUAL_STACK_NETWORK}" } scenario_remove_vms() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + local -r vmname=$(full_vm_name host1) local -r vm_ip1=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | head -1) local -r vm_ip2=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | tail -1) diff --git a/test/scenarios/releases/el96-lrel@ginkgo-tests.sh b/test/scenarios/releases/el96-lrel@ginkgo-tests.sh index cd4b205d23..cb81117ea0 100644 --- a/test/scenarios/releases/el96-lrel@ginkgo-tests.sh +++ b/test/scenarios/releases/el96-lrel@ginkgo-tests.sh @@ -2,15 +2,32 @@ # Sourced from scenario.sh and uses functions defined there. +start_image="rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" + scenario_create_vms() { - prepare_kickstart host1 kickstart.ks.template "rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart.ks.template "${start_image}" launch_vm --vm_disksize 30 } scenario_remove_vms() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { - run_gingko_tests host1 + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + run_gingko_tests host1 "~Disruptive" } diff --git a/test/scenarios/releases/el96-lrel@ipv6.sh b/test/scenarios/releases/el96-lrel@ipv6.sh index 120b408ed5..ba2a5abdac 100644 --- a/test/scenarios/releases/el96-lrel@ipv6.sh +++ b/test/scenarios/releases/el96-lrel@ipv6.sh @@ -10,16 +10,33 @@ WEB_SERVER_URL="http://[${VM_BRIDGE_IP}]:${WEB_SERVER_PORT}" # shellcheck disable=SC2034 # used elsewhere MIRROR_REGISTRY_URL="${VM_BRIDGE_IP}:${MIRROR_REGISTRY_PORT}" +start_image="rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" + scenario_create_vms() { # Enable IPv6 single stack in kickstart - prepare_kickstart host1 kickstart.ks.template "rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" false true + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart.ks.template "${start_image}" false true launch_vm --network "${VM_IPV6_NETWORK}" } scenario_remove_vms() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + run_tests host1 suites/ipv6/singlestack.robot } diff --git a/test/scenarios/releases/el96-lrel@low-latency.sh b/test/scenarios/releases/el96-lrel@low-latency.sh new file mode 100644 index 0000000000..e44c2319cc --- /dev/null +++ b/test/scenarios/releases/el96-lrel@low-latency.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +export SKIP_GREENBOOT=true +export TEST_RANDOMIZATION=none + +# Sourced from scenario.sh and uses functions defined there. + +start_image="rhel-9.6-microshift-brew-tuned-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" + +scenario_create_vms() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart.ks.template "${start_image}" + launch_vm --vm_vcpus 6 +} + +scenario_remove_vms() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + remove_vm host1 +} + +scenario_run_tests() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + # Should not be run immediately after creating VM because of + # microshift-tuned rebooting the node to activate the profile. + local -r start_time=$(date +%s) + while true; do + boot_num=$(run_command_on_vm host1 "sudo journalctl --list-boots --quiet | wc -l" || true) + boot_num="${boot_num%$'\r'*}" + if [[ "${boot_num}" -ge 2 ]]; then + break + fi + if [ $(( $(date +%s) - start_time )) -gt 60 ]; then + echo "Timed out waiting for VM having 2 boots" + exit 1 + fi + sleep 5 + done + + # --exitonfailure because tests within suites are meant to be ordered, + # so don't advance to next test if current failed. + + run_tests host1 \ + --exitonfailure \ + suites/tuned/profile.robot \ + suites/tuned/microshift-tuned.robot \ + suites/tuned/workload-partitioning.robot +} diff --git a/test/scenarios/releases/el96-lrel@multi-nic.sh b/test/scenarios/releases/el96-lrel@multi-nic.sh index 21f65d659c..eab6f04326 100644 --- a/test/scenarios/releases/el96-lrel@multi-nic.sh +++ b/test/scenarios/releases/el96-lrel@multi-nic.sh @@ -2,17 +2,34 @@ # Sourced from scenario.sh and uses functions defined there. +start_image="rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" + scenario_create_vms() { - prepare_kickstart host1 kickstart.ks.template "rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart.ks.template "${start_image}" # Using multus as secondary network to have 2 nics in different networks. launch_vm --network default,"${VM_MULTUS_NETWORK}" } scenario_remove_vms() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + local -r vmname=$(full_vm_name host1) local -r vm_ip1=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | head -1) local -r vm_ip2=$("${ROOTDIR}/scripts/devenv-builder/manage-vm.sh" ip -n "${vmname}" | tail -1) diff --git a/test/scenarios/releases/el96-lrel@optional.sh b/test/scenarios/releases/el96-lrel@optional.sh new file mode 100644 index 0000000000..8445f674b3 --- /dev/null +++ b/test/scenarios/releases/el96-lrel@optional.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# Sourced from scenario.sh and uses functions defined there. + +# Redefine network-related settings to use the dedicated network bridge +VM_BRIDGE_IP="$(get_vm_bridge_ip "${VM_MULTUS_NETWORK}")" +# shellcheck disable=SC2034 # used elsewhere +WEB_SERVER_URL="http://${VM_BRIDGE_IP}:${WEB_SERVER_PORT}" + +start_image="rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" + +scenario_create_vms() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart.ks.template "${start_image}" + # Two nics - one for macvlan, another for ipvlan (they cannot enslave the same interface) + launch_vm --network "${VM_MULTUS_NETWORK},${VM_MULTUS_NETWORK}" +} + +scenario_remove_vms() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + remove_vm host1 +} + +scenario_run_tests() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + # Generic Device Plugin suite is excluded because getting serialsim for ostree would require: + # - getting the version of the kernel of ostree image, + # - installing kernel-devel of that version on the hypervisor, + # - building serialsim + # - packaging serialsim as an RPM + # - including the RPM in the ostree blueprint + # GDP suite is tested with bootc images instead. + run_tests host1 \ + --variable "PROMETHEUS_HOST:$(hostname)" \ + --variable "PROMETHEUS_PORT:9092" \ + --variable "LOKI_HOST:$(hostname)" \ + --variable "LOKI_PORT:3200" \ + --variable "PROM_EXPORTER_PORT:8889" \ + --exclude generic-device-plugin \ + suites/optional/ +} diff --git a/test/scenarios/releases/el96-lrel@osconfig.sh b/test/scenarios/releases/el96-lrel@osconfig.sh new file mode 100644 index 0000000000..0bffbac7a5 --- /dev/null +++ b/test/scenarios/releases/el96-lrel@osconfig.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Sourced from scenario.sh and uses functions defined there. + +start_image="rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" + +scenario_create_vms() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart.ks.template "${start_image}" + launch_vm +} + +scenario_remove_vms() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + remove_vm host1 +} + +scenario_run_tests() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + run_tests host1 \ + suites/osconfig/clusterid.robot \ + suites/osconfig/systemd-resolved.robot +} diff --git a/test/scenarios/releases/el96-lrel@router.sh b/test/scenarios/releases/el96-lrel@router.sh index 1ff7298a39..c0804584b7 100644 --- a/test/scenarios/releases/el96-lrel@router.sh +++ b/test/scenarios/releases/el96-lrel@router.sh @@ -2,16 +2,33 @@ # Sourced from scenario.sh and uses functions defined there. +start_image="rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" + scenario_create_vms() { - prepare_kickstart host1 kickstart.ks.template "rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart.ks.template "${start_image}" launch_vm } scenario_remove_vms() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + run_tests host1 \ suites/router } diff --git a/test/scenarios/releases/el96-lrel@standard1.sh b/test/scenarios/releases/el96-lrel@standard1.sh index cfd6cf0b3d..03ddb91ce7 100644 --- a/test/scenarios/releases/el96-lrel@standard1.sh +++ b/test/scenarios/releases/el96-lrel@standard1.sh @@ -2,16 +2,33 @@ # Sourced from scenario.sh and uses functions defined there. +start_image="rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" + scenario_create_vms() { - prepare_kickstart host1 kickstart.ks.template "rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart.ks.template "${start_image}" launch_vm } scenario_remove_vms() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + run_tests host1 \ --variable "EXPECTED_OS_VERSION:9.6" \ suites/standard1/ suites/selinux/validate-selinux-policy.robot diff --git a/test/scenarios/releases/el96-lrel@standard2.sh b/test/scenarios/releases/el96-lrel@standard2.sh index 84e892dca8..154cdffe5c 100644 --- a/test/scenarios/releases/el96-lrel@standard2.sh +++ b/test/scenarios/releases/el96-lrel@standard2.sh @@ -2,15 +2,32 @@ # Sourced from scenario.sh and uses functions defined there. +start_image="rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" + scenario_create_vms() { - prepare_kickstart host1 kickstart.ks.template "rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart.ks.template "${start_image}" launch_vm } scenario_remove_vms() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + run_tests host1 suites/standard2/ } diff --git a/test/scenarios/releases/el96-lrel@storage.sh b/test/scenarios/releases/el96-lrel@storage.sh index dfd4895424..4ec333499d 100644 --- a/test/scenarios/releases/el96-lrel@storage.sh +++ b/test/scenarios/releases/el96-lrel@storage.sh @@ -2,15 +2,32 @@ # Sourced from scenario.sh and uses functions defined there. +start_image="rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" + scenario_create_vms() { - prepare_kickstart host1 kickstart.ks.template "rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" - launch_vm + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart.ks.template "${start_image}" + launch_vm } scenario_remove_vms() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + run_tests host1 suites/storage/ } diff --git a/test/scenarios/releases/el96-yminus1@el96-lrel@standard1.sh b/test/scenarios/releases/el96-yminus1@el96-lrel@standard1.sh index fecd3c129c..6228054991 100644 --- a/test/scenarios/releases/el96-yminus1@el96-lrel@standard1.sh +++ b/test/scenarios/releases/el96-yminus1@el96-lrel@standard1.sh @@ -6,16 +6,33 @@ # ensure MicroShift is upgraded before running standard suite tests export TEST_RANDOMIZATION=none +start_image="rhel-9.6-microshift-brew-optionals-4.${PREVIOUS_MINOR_VERSION}-zstream" + scenario_create_vms() { - prepare_kickstart host1 kickstart.ks.template "rhel-9.6-microshift-brew-optionals-4.${PREVIOUS_MINOR_VERSION}-zstream" - launch_vm + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart.ks.template "${start_image}" + launch_vm } scenario_remove_vms() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + run_tests host1 \ --variable "TARGET_REF:rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" \ --variable "EXPECTED_OS_VERSION:9.6" \ diff --git a/test/scenarios/releases/el96-yminus1@el96-lrel@standard2.sh b/test/scenarios/releases/el96-yminus1@el96-lrel@standard2.sh index 0de1778b65..d259cd43fc 100644 --- a/test/scenarios/releases/el96-yminus1@el96-lrel@standard2.sh +++ b/test/scenarios/releases/el96-yminus1@el96-lrel@standard2.sh @@ -6,17 +6,34 @@ # ensure MicroShift is upgraded before running standard suite tests export TEST_RANDOMIZATION=none +start_image="rhel-9.6-microshift-brew-optionals-4.${PREVIOUS_MINOR_VERSION}-zstream" + scenario_create_vms() { - prepare_kickstart host1 kickstart.ks.template "rhel-9.6-microshift-brew-optionals-4.${PREVIOUS_MINOR_VERSION}-zstream" - launch_vm + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + prepare_kickstart host1 kickstart.ks.template "${start_image}" + launch_vm } scenario_remove_vms() { + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + remove_vm host1 } scenario_run_tests() { - run_tests host1 \ + if ! does_commit_exist "${start_image}"; then + echo "Image '${start_image}' not found - skipping test" + return 0 + fi + + run_tests host1 \ --variable "TARGET_REF:rhel-9.6-microshift-brew-optionals-4.${MINOR_VERSION}-${LATEST_RELEASE_TYPE}" \ suites/upgrade/upgrade-successful.robot \ suites/standard2/