From 65f62301c21dcd06ca571991230a33daf927127d Mon Sep 17 00:00:00 2001 From: Daniel28972897 Date: Sat, 25 Jul 2026 22:36:01 -0600 Subject: [PATCH] test: add coverage for systemctl preset in test-systemctl-enable.sh Repeats the enable/disable specifier-expansion check with 'systemctl preset' instead. preset-all is intentionally not exercised here, since $root accumulates unit files from earlier sections that are deliberately invalid, and preset-all would trip on those unrelated units. --- test/test-systemctl-enable.sh | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/test/test-systemctl-enable.sh b/test/test-systemctl-enable.sh index 3fc59f6f9e..d099b6f41e 100644 --- a/test/test-systemctl-enable.sh +++ b/test/test-systemctl-enable.sh @@ -713,7 +713,37 @@ test ! -h "$root/etc/systemd/system/another-target@.target.wants/some-some-link7 test ! -h "$root/etc/systemd/system/target2@some-some-link7.target.requires/some-some-link7.socket" test ! -h "$root/etc/systemd/system/another-target2@.target.requires/some-some-link7.socket" -# TODO: repeat the tests above for presets +: '-------specifiers in presets------------------------------------' +# Repeat the check above, but via 'systemctl preset' instead +# of calling enable/disable directly. We reuse the same unit file, which is +# currently disabled (no symlinks) from the block above. + +mkdir -p "$root/etc/systemd/system-preset" +cat >"$root/etc/systemd/system-preset/99-test.preset" <"$root/etc/systemd/system-preset/99-test.preset" <