From: Masatake YAMATO Date: Fri, 10 Oct 2025 21:51:51 +0000 (+0900) Subject: ts/kill/decode: compare decoded output in an architecture-independent way X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c7e8c217d416a2b3826e178293380eea76fc910;p=thirdparty%2Futil-linux.git ts/kill/decode: compare decoded output in an architecture-independent way Reported-by: John Paul Adrian Glaubitz Fixed: https://github.com/util-linux/util-linux/issues/3774 Signed-off-by: Masatake YAMATO --- diff --git a/tests/expected/kill/decode b/tests/expected/kill/decode index 421037772..16f4a3661 100644 --- a/tests/expected/kill/decode +++ b/tests/expected/kill/decode @@ -13,8 +13,25 @@ PIPE ALRM encode-decode round-trip "USR1": USR1 -Pending (thread): INT ILL -Pending (process): USR1 -Blocked: INT ILL ABRT FPE USR1 SEGV TERM -Ignored: HUP QUIT TRAP PIPE ALRM -Caught: ILL USR1 +Pending (thread): +ILL +INT +Pending (process): +USR1 +Blocked: +ABRT +FPE +ILL +INT +SEGV +TERM +USR1 +Ignored: +ALRM +HUP +PIPE +QUIT +TRAP +Caught: +ILL +USR1 diff --git a/tests/ts/kill/decode b/tests/ts/kill/decode index 3b0d4506d..ace98ecfd 100755 --- a/tests/ts/kill/decode +++ b/tests/ts/kill/decode @@ -29,6 +29,8 @@ ts_check_test_command "$TS_CMD_KILL" ts_check_test_command "$TS_HELPER_SIGSTATE" ts_check_prog "sed" +ts_check_prog "sort" +ts_check_prog "tr" . "$TS_SELF/kill_functions.sh" @@ -72,6 +74,17 @@ encode() printf "0x%0.16x\n" "$bits" } +sort_signals_by_name() +{ + local field + local siglist + + while IFS=: read field siglist; do + echo "${field}:" + echo $siglist | tr ' ' '\n' | sort + done +} + PID= ACK= { @@ -107,7 +120,7 @@ ACK= else cat fi - } + } | sort_signals_by_name fi echo DONE >&"${SIGSTATE[1]}" fi