]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Unify error messages for transient settings, fix handling of Ex variants (#38083)
authorLennart Poettering <lennart@poettering.net>
Mon, 7 Jul 2025 07:39:40 +0000 (09:39 +0200)
committerGitHub <noreply@github.com>
Mon, 7 Jul 2025 07:39:40 +0000 (09:39 +0200)
1  2 
test/units/TEST-65-ANALYZE.sh

index e5a9aba4e72a712d7abab2228607e119a90535f1,61e4a97175cd8ed6f839a5b1e778d20ab17df24a..7fd4543e76aba2f552ccaf59a1b670db33554bb4
@@@ -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" <<EOF
 +[Unit]
 +Description=Test unit for systemd-analyze unit-shell
 +[Service]
 +Type=notify
 +NotifyAccess=all
 +ExecStart=/bin/sh -c "echo 'Hello from test unit' >/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