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 committed Aug 29, 2024
1 parent f5ea8ce commit aa791ba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion tests/kola/boot/bootupd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion tests/kola/upgrade/extended/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit aa791ba

Please sign in to comment.