From fe8d7d25d5f64084a1afeb2a14244db72053ad2f Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Thu, 22 Feb 2024 13:00:48 +0000 Subject: [PATCH] TEST-74-AUX-UTILS: Support systems with pre-existing modules config --- test/units/testsuite-74.modules-load.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/units/testsuite-74.modules-load.sh b/test/units/testsuite-74.modules-load.sh index 3d00e07f07c..aea2f3cbdea 100755 --- a/test/units/testsuite-74.modules-load.sh +++ b/test/units/testsuite-74.modules-load.sh @@ -17,6 +17,8 @@ if systemd-detect-virt -cq; then exit 0 fi +ORIG_MODULES_LOAD_CONFIG="$(systemd-analyze cat-config modules-load.d)" + # Check if we have required kernel modules modprobe --all --resolve-alias loop dummy @@ -75,7 +77,7 @@ modprobe -v --all --remove loop dummy # Make sure we have no config files left over that might interfere with # following tests rm -fv "$CONFIG_FILE" -[[ -z "$(systemd-analyze cat-config modules-load.d)" ]] +[[ "$ORIG_MODULES_LOAD_CONFIG" == "$(systemd-analyze cat-config modules-load.d)" ]] CMDLINE="ro root= modules_load= modules_load=, / = modules_load=foo-bar-baz,dummy modules_load=loop,loop,loop" SYSTEMD_PROC_CMDLINE="$CMDLINE" "$MODULES_LOAD_BIN" |& tee /tmp/out.log grep -E "^Inserted module .*loop" /tmp/out.log -- 2.47.3