From: Daniel28972897 Date: Sun, 26 Jul 2026 04:36:01 +0000 (-0600) Subject: test: add coverage for systemctl preset in test-systemctl-enable.sh X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65f62301c21dcd06ca571991230a33daf927127d;p=thirdparty%2Fsystemd.git 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. --- diff --git a/test/test-systemctl-enable.sh b/test/test-systemctl-enable.sh index 3fc59f6f9ee..d099b6f41eb 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" <