From: Lennart Poettering Date: Mon, 7 Jul 2025 07:39:40 +0000 (+0200) Subject: Unify error messages for transient settings, fix handling of Ex variants (#38083) X-Git-Tag: v258-rc1~150 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64a78cb082dd09a4c2f83c5cd09c08ae9777ed30;p=thirdparty%2Fsystemd.git Unify error messages for transient settings, fix handling of Ex variants (#38083) --- 64a78cb082dd09a4c2f83c5cd09c08ae9777ed30 diff --cc test/units/TEST-65-ANALYZE.sh index e5a9aba4e72,61e4a97175c..7fd4543e76a --- a/test/units/TEST-65-ANALYZE.sh +++ b/test/units/TEST-65-ANALYZE.sh @@@ -1115,30 -1115,8 +1115,31 @@@ systemd-analyze transient-settings moun (! systemd-analyze transient-settings service | grep CPUAccounting ) (! systemd-analyze transient-settings service | grep ConditionKernelVersion ) (! systemd-analyze transient-settings service | grep AssertKernelVersion ) + (! systemd-analyze transient-settings service socket timer path slice scope mount automount | grep -E 'Ex$' ) +# check systemd-analyze unit-shell with a namespaced unit +UNIT_NAME="test-unit-shell.service" +UNIT_FILE="/run/systemd/system/$UNIT_NAME" +cat >"$UNIT_FILE" </tmp/testfile; systemd-notify --ready; sleep infinity" +PrivateTmp=disconnected +EOF +# Start the service +systemctl start "$UNIT_NAME" +# Wait for the service to be active +systemctl is-active --quiet "$UNIT_NAME" +# Verify the service is active and has a MainPID +MAIN_PID=$(systemctl show -p MainPID --value "$UNIT_NAME") +[ "$MAIN_PID" -gt 0 ] +# Test systemd-analyze unit-shell with a command (cat /tmp/testfile) +OUTPUT=$(systemd-analyze unit-shell "$UNIT_NAME" cat /tmp/testfile) +assert_in "Hello from test unit" "$OUTPUT" + systemd-analyze log-level info touch /testok