diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2024-02-22 14:00:00 +0100 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-05-06 11:57:00 +0200 |
commit | 8c9d241c55555cfd840a67746d767b71ce58e6d9 (patch) | |
tree | 6f0149afbc98a5649267114a35ec859ddb7f1edb /test/units | |
parent | TEST-74-AUX-UTILS: Support systems with pre-existing modules config (diff) | |
download | systemd-8c9d241c55555cfd840a67746d767b71ce58e6d9.tar.xz systemd-8c9d241c55555cfd840a67746d767b71ce58e6d9.zip |
TEST-74-AUX-UTILS: Support running on UEFI systems
Diffstat (limited to 'test/units')
-rwxr-xr-x | test/units/testsuite-74.bootctl.sh | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/test/units/testsuite-74.bootctl.sh b/test/units/testsuite-74.bootctl.sh index 133006e40a..78c0e6e5d9 100755 --- a/test/units/testsuite-74.bootctl.sh +++ b/test/units/testsuite-74.bootctl.sh @@ -59,8 +59,8 @@ basic_tests() { } testcase_bootctl_basic() { - assert_eq "$(bootctl --print-esp-path)" "/efi" - assert_eq "$(bootctl --print-boot-path)" "/boot" + assert_in "$(bootctl --print-esp-path)" "^(/boot/|/efi)$" + assert_in "$(bootctl --print-boot-path)" "^(/boot/|/efi)$" bootctl --print-root-device basic_tests @@ -266,10 +266,14 @@ EOF testcase_bootctl_varlink() { varlinkctl call --collect /run/systemd/io.systemd.BootControl io.systemd.BootControl.ListBootEntries '{}' - # We have no UEFI in the test environment, hence just check that this fails cleanly - ( SYSTEMD_LOG_TARGET=console varlinkctl call --json=short /run/systemd/io.systemd.BootControl io.systemd.BootControl.GetRebootToFirmware '{}' 2>&1 || true ) | grep -q io.systemd.BootControl.RebootToFirmwareNotSupported - ( SYSTEMD_LOG_TARGET=console varlinkctl call --json=short /run/systemd/io.systemd.BootControl io.systemd.BootControl.SetRebootToFirmware '{"state":true}' 2>&1 || true ) | grep -q io.systemd.BootControl.RebootToFirmwareNotSupported - ( SYSTEMD_LOG_TARGET=console varlinkctl call --json=short /run/systemd/io.systemd.BootControl io.systemd.BootControl.SetRebootToFirmware '{"state":false}' 2>&1 || true ) | grep -q io.systemd.BootControl.RebootToFirmwareNotSupported + # We may have UEFI in the test environment. + # If we don't have UEFI then we can test whether bootctl's varlink API fails cleanly. + # If we do have UEFI then the rest of the clean fail tests should be skipped. + if ! (SYSTEMD_LOG_TARGET=console varlinkctl call --json=short /run/systemd/io.systemd.BootControl io.systemd.BootControl.GetRebootToFirmware '{}' || true) |& grep -q io.systemd.BootControl.RebootToFirmwareNotSupported; then + return 0 + fi + (SYSTEMD_LOG_TARGET=console varlinkctl call --json=short /run/systemd/io.systemd.BootControl io.systemd.BootControl.SetRebootToFirmware '{"state":true}' || true) |& grep -q io.systemd.BootControl.RebootToFirmwareNotSupported + (SYSTEMD_LOG_TARGET=console varlinkctl call --json=short /run/systemd/io.systemd.BootControl io.systemd.BootControl.SetRebootToFirmware '{"state":false}' || true) |& grep -q io.systemd.BootControl.RebootToFirmwareNotSupported } run_testcases |