Skip to content

Commit

Permalink
tests: verify bootupctl status output is not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
HuijingHei authored and travier committed Sep 3, 2024
1 parent 39c9575 commit e726f1f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
17 changes: 16 additions & 1 deletion tests/kola/boot/bootupd
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,22 @@ case "$(arch)" in
aarch64|x86_64)
# on these arches, we always expect state files to exist
check_state_file=1
# aarch64 (and x86_64) uses uefi firmware, should check grub2-efi
evr=$(rpm -q grub2-common --qf '%{EVR}')
if ! bootupctl status | grep "grub2-efi-.*-${evr}"; 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
# ppc64le (and x86_64) uses bios firmware, should check grub2-tools
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
Expand All @@ -41,5 +51,10 @@ if [ -n "${check_state_file}" ] && [ ! -f "${state_file}" ]; then
fatal "${state_file} not present"
fi

bootupctl status
# Verify `bootupctl status` output contains related content.
# 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
6 changes: 5 additions & 1 deletion tests/kola/upgrade/extended/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ 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
# and check the status output
[ -f /usr/bin/bootupctl ] && /usr/bin/bootupctl status | tee bootupctl.txt
if ! grep "CoreOS aleph version" bootupctl.txt; then
fatal "check bootupctl status output"
fi
exit 0
fi

Expand Down

0 comments on commit e726f1f

Please sign in to comment.