]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: send monotonic timestamp rather than unix seconds for MONOTONIC_USEC= argument
authorLuca Boccassi <luca.boccassi@gmail.com>
Mon, 2 Jun 2025 18:45:02 +0000 (19:45 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 3 Jun 2025 01:54:03 +0000 (10:54 +0900)
Follow-up for 3998b30a040d1494918e11c78ef3eae72532bbca

test/units/TEST-50-DISSECT.dissect.sh

index 163311e64033969c38631aa6696ca9295aaef4fb..8cfeeb66d4c34061d329f53678248ea3ba7d0e13 100755 (executable)
@@ -652,7 +652,8 @@ ExtensionDirectories=-${VDIR}
 NotifyAccess=all
 ExecStart=bash -c ' \
     trap '"'"' \
-        printf "RELOADING=1\\nMONOTONIC_USEC=\$\${EPOCHREALTIME/[^0-9]/}" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \
+        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; \
         (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; \
@@ -686,7 +687,8 @@ ExtensionDirectories=-${VDIR}
 NotifyAccess=all
 ExecStart=bash -c ' \
     trap '"'"' \
-        printf "RELOADING=1\\nMONOTONIC_USEC=\$\${EPOCHREALTIME/[^0-9]/}" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \
+        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; \
         (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; \
@@ -715,7 +717,8 @@ PrivateUsers=yes
 NotifyAccess=all
 ExecStart=bash -c ' \
     trap '"'"' \
-        printf "RELOADING=1\\nMONOTONIC_USEC=\$\${EPOCHREALTIME/[^0-9]/}" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \
+        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; \
         (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; \