From aa791ba5fcac99ce422ec7f6f48c64d987bcbf13 Mon Sep 17 00:00:00 2001 From: HuijingHei Date: Thu, 29 Aug 2024 17:37:36 +0800 Subject: [PATCH] tests: verify `bootupctl status` output is not empty See https://github.com/coreos/bootupd/issues/694 --- tests/kola/boot/bootupd | 15 ++++++++++++++- tests/kola/upgrade/extended/test.sh | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/kola/boot/bootupd b/tests/kola/boot/bootupd index c909d6e919..a0c8c105cc 100755 --- a/tests/kola/boot/bootupd +++ b/tests/kola/boot/bootupd @@ -22,12 +22,20 @@ case "$(arch)" in aarch64|x86_64) # on these arches, we always expect state files to exist check_state_file=1 + if ! bootupctl status | grep "grub2-efi"; then + fatal "bootupctl status output should include grub2-efi package version" + fi ;; ppc64le) # ppc64le has it if built by osbuild, otherwise not if [ -e /sysroot/.aleph-version.json ]; then check_state_file=1 fi + # check grub2 + grub_version=$(rpm -q grub2-tools --qf '%{NEVRA}') + if ! bootupctl status | grep "${grub_version}"; then + fatal "bootupctl status output should include grub2-tools package version" + fi ;& # fallthrough *) if ! rpm -q bootupd; then @@ -41,5 +49,10 @@ if [ -n "${check_state_file}" ] && [ ! -f "${state_file}" ]; then fatal "${state_file} not present" fi -bootupctl status +# Verify the output is not empty. +# https://github.com/coreos/bootupd/issues/694 +if ! bootupctl status | grep "CoreOS aleph version"; then + fatal "bootupctl status output should include 'CoreOS aleph version'" +fi + ok bootupctl diff --git a/tests/kola/upgrade/extended/test.sh b/tests/kola/upgrade/extended/test.sh index 5eebc130a8..c915439258 100755 --- a/tests/kola/upgrade/extended/test.sh +++ b/tests/kola/upgrade/extended/test.sh @@ -145,7 +145,7 @@ ok "Reached version: $version" if vereq $version $target_version; then ok "Fully upgraded to $target_version" # log bootupctl information for inspection where available - [ -f /usr/bin/bootupctl ] && /usr/bin/bootupctl status + [ -f /usr/bin/bootupctl ] && (/usr/bin/bootupctl status | grep "CoreOS aleph version") exit 0 fi