From: Luca Boccassi Date: Wed, 30 Jul 2025 17:53:09 +0000 (+0100) Subject: test: send trailing newlines in notify messages in TEST-50-DISSECT X-Git-Tag: v258-rc2~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=827ef318ec27a2c3c753614e89218b2a7d205937;p=thirdparty%2Fsystemd.git test: send trailing newlines in notify messages in TEST-50-DISSECT It seems the failing test in https://github.com/systemd/systemd/issues/37626 is due to MONOTONIC_USEC= being somehow lost. Add a trailing newline when sending messages with socat, hopefully ensuring it is delivered and read. --- diff --git a/test/units/TEST-50-DISSECT.dissect.sh b/test/units/TEST-50-DISSECT.dissect.sh index f63f4fcd2af..ff8a5dd4c74 100755 --- a/test/units/TEST-50-DISSECT.dissect.sh +++ b/test/units/TEST-50-DISSECT.dissect.sh @@ -653,12 +653,12 @@ NotifyAccess=all ExecStart=bash -x -c ' \ trap '"'"' \ now=\$\$(grep "^now" /proc/timer_list | cut -d" " -f3 | rev | cut -c 4- | rev); \ - printf "RELOADING=1\\nMONOTONIC_USEC=\$\${now}" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ + printf "RELOADING=1\\nMONOTONIC_USEC=\$\${now}\\n" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ (ls /etc | grep marker) >/tmp/markers/50i; \ (cat /usr/lib/os-release) >>/tmp/markers/50i; \ - echo -n "READY=1" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ + echo "READY=1" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ '"'"' SIGHUP; \ - echo -n "READY=1" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ + echo "READY=1" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ while true; do sleep 1; done; \ ' EOF @@ -688,12 +688,12 @@ NotifyAccess=all ExecStart=bash -x -c ' \ trap '"'"' \ now=\$\$(grep "^now" /proc/timer_list | cut -d" " -f3 | rev | cut -c 4- | rev); \ - printf "RELOADING=1\\nMONOTONIC_USEC=\$\${now}" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ + printf "RELOADING=1\\nMONOTONIC_USEC=\$\${now}\\n" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ (ls /etc | grep marker) >/tmp/markers/50j; \ (cat /usr/lib/os-release) >>/tmp/markers/50j; \ - echo -n "READY=1" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ + echo "READY=1" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ '"'"' SIGHUP; \ - echo -n "READY=1" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ + echo "READY=1" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ while true; do sleep 1; done; \ ' EOF @@ -718,12 +718,12 @@ NotifyAccess=all ExecStart=bash -x -c ' \ trap '"'"' \ now=\$\$(grep "^now" /proc/timer_list | cut -d" " -f3 | rev | cut -c 4- | rev); \ - printf "RELOADING=1\\nMONOTONIC_USEC=\$\${now}" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ + printf "RELOADING=1\\nMONOTONIC_USEC=\$\${now}\\n" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ (ls /etc | grep marker) >/tmp/markers/50k; \ (cat /usr/lib/os-release) >>/tmp/markers/50k; \ - echo -n "READY=1" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ + echo "READY=1" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ '"'"' SIGHUP; \ - echo -n "READY=1" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ + echo "READY=1" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ while true; do sleep 1; done; \ ' EOF