-
Notifications
You must be signed in to change notification settings - Fork 159
/
Copy pathbootupd
executable file
·60 lines (53 loc) · 2.04 KB
/
bootupd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
## kola:
## exclusive: false
## description: Verify that bootupd works.
# We generally implement project-owned tests run in the pipeline
# and be able to run the existing bootupd tests.
# See https://github.com/coreos/fedora-coreos-config/pull/677
set -xeuo pipefail
# shellcheck disable=SC1091
. "$KOLA_EXT_DATA/commonlib.sh"
# Not all streams on which this test runs has bootupd on all arches yet. On
# x86_64 and aarch64, we always expect bootupd to be installed. On ppc64le and
# s390x, let's just conditionally check that *if* bootupd is installed, then
# it's functioning as expected. We can harden it more once we've hard cut over
# to 9.4.
check_state_file=
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
exit 0
fi
;;
esac
state_file=/boot/bootupd-state.json
if [ -n "${check_state_file}" ] && [ ! -f "${state_file}" ]; then
fatal "${state_file} not present"
fi
# 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