File tree Expand file tree Collapse file tree
tmt/tests/booted/readonly Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ use std assert
2+ use tap .nu
3+
4+ tap begin " Test EFI/UKI key"
5+
6+ let st = bootc status -- json | from json
7+
8+ if not (tap is_composefs ) {
9+ exit 0
10+ }
11+
12+ let bootloader = $st.status.booted.composefs.bootloader
13+
14+ # Only for UKIs
15+ if ($st.status.booted.composefs.bootType | str downcase ) != " uki" {
16+ exit 0
17+ }
18+
19+ let systemd_version = systemctl -- version | lines | first | awk ' {print $2}' | into int
20+
21+ echo $" ($systemd_version )"
22+
23+ echo " BLS entry"
24+ echo (cat /boot/loader/entries/* )
25+
26+ # Both bootloaders support BLI so EFI should be mounted at /boot
27+ let efi_line = (
28+ open /boot/loader/entries/*
29+ | lines
30+ | where $it =~ ' ^efi'
31+ )
32+
33+ let uki_line = (
34+ open /boot/loader/entries/*
35+ | lines
36+ | where $it =~ ' ^uki'
37+ )
38+
39+ if $bootloader == " grub-cc" {
40+ assert equal ($efi_line | length ) 1
41+ assert equal ($uki_line | length ) 0
42+ } else {
43+
44+ if $systemd_version >= 258 {
45+ assert equal ($efi_line | length ) 0
46+ assert equal ($uki_line | length ) 1
47+ } else {
48+ assert equal ($efi_line | length ) 1
49+ assert equal ($uki_line | length ) 0
50+ }
51+ }
52+
53+ tap ok
You can’t perform that action at this time.
0 commit comments