Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: verify bootupctl status output is not empty #3130

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading