Skip to content

Commit

Permalink
tests/bootupd-validate: skip checking BIOS on older bootupd
Browse files Browse the repository at this point in the history
See failed CI log openshift/os#1644 (comment)
  • Loading branch information
HuijingHei committed Nov 8, 2024
1 parent 5337141 commit 0d559c2
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/kola/boot/bootupd-validate
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ set -xeuo pipefail
. "$KOLA_EXT_DATA/commonlib.sh"

overwrite=
bootupd_version=$(rpm -q --queryformat '%{VERSION}' bootupd)
required_version='0.2.22'
# only x64 and aarch64 have esp device
overwrite_file() {
case "$(arch)" in
Expand All @@ -28,7 +30,8 @@ overwrite_file() {
fatal "can not find ${esp_dev}"
fi
mount -v "${esp_dev}" /boot/efi
local shim_file=$(find /boot/efi -name shim.efi)
# on centos can not find shim.efi, use shimx64.efi instead
local shim_file=$(find /boot/efi \( -name "shim.efi" -o -name "shimx64.efi" \) | head -n1)
if [ -z "${shim_file}" ]; then
fatal "can not find ${shim_file}"
fi
Expand Down Expand Up @@ -61,7 +64,9 @@ validate() {

case "$(arch)" in
x86_64)
bootupctl validate | grep "${msg_bios}"
if vergte "${bootupd_version}" "${required_version}"; then
bootupctl validate | grep "${msg_bios}"
fi
bootupctl validate | grep "${msg_efi}"
;;
aarch64)
Expand All @@ -76,11 +81,20 @@ validate() {
esac
}

# should remove this until https://issues.redhat.com/browse/RHEL-66584 is fixed
set_selinux_permissve() {
source /etc/os-release
if is_scos || ([ "${RHEL_VERSION}" == "9.6" ] && [ "${VARIANT_ID}" == "coreos" ] ); then
semanage permissive -a bootupd_t
fi
}

overwrite_file
if [ -n "${overwrite}" ] && bootupctl validate 2>&1; then
fatal "bootupctl validate did not fail as expected"
fi

set_selinux_permissve
adopt_and_update
validate

Expand Down

0 comments on commit 0d559c2

Please sign in to comment.