]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-07-PID1: Don't fail in vm without ESP or XBOOTLDR mount
authorDaan De Meyer <daan@amutable.com>
Thu, 26 Mar 2026 07:41:17 +0000 (08:41 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 22 May 2026 12:27:50 +0000 (13:27 +0100)
(cherry picked from commit e7d1030d771d46d8004d44f33585261b0e48fc43)

test/units/TEST-07-PID1.exec-context.sh

index 877095609123fe91af85e43064e72a8e5050c64b..14cc49f29237f4633cee843f5ad233f3e1ea0227 100755 (executable)
@@ -33,12 +33,14 @@ proc_supports_option() {
 # in that case instead of complicating the test setup even more */
 if [[ -z "${COVERAGE_BUILD_DIR:-}" ]]; then
     if ! systemd-detect-virt -cq && command -v bootctl >/dev/null; then
-        boot_path="$(bootctl --print-boot-path)"
-        esp_path="$(bootctl --print-esp-path)"
+        boot_path="$(bootctl --print-boot-path)" || :
+        esp_path="$(bootctl --print-esp-path)" || :
 
         # If the mount points are handled by automount units, make sure we trigger
         # them before proceeding further
-        ls -l "$boot_path" "$esp_path"
+        if [[ -n "${boot_path:-}" && -n "${esp_path:-}" ]]; then
+            ls -l "$boot_path" "$esp_path"
+        fi
     fi
 
     systemd-run --wait --pipe -p ProtectSystem=yes \