]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: skip SIGRTMAX check on s390x/QEMU
authorChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Sat, 4 Apr 2026 18:29:55 +0000 (14:29 -0400)
committerChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Wed, 8 Apr 2026 05:26:53 +0000 (01:26 -0400)
The CI fails the kill/name_to_number test when SIGRTMAX-0 (64)
is checked for s390x packaging. Although SIGRTMAX is a valid
signal number, kill(2) still returns EINVAL. This seems to be
related to the fact that QEMU reserves a signal number from
the high real-time signal range for internal usage, which
limits the maximum real-time signal number range.

We already check for the QEMU_USER environment variable, let us
also check if the QEMU emulator is mapped in memory for PID 1
to get more reliable information. In addition to that lets skip
RTMAX checks on s390x and QEMU emulated environments.

Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
tests/functions.sh
tests/ts/kill/name_to_number

index 4a00463a80475d942731ee83a2ae03b16ca702bd..2569a5877f55ecf30e505f2e2e9a8ef89194ce57 100644 (file)
@@ -176,11 +176,20 @@ function ts_skip_capability {
 }
 
 function ts_skip_qemu_user {
-       if [ "$QEMU_USER" == "1" ]; then
+       if [ "$QEMU_USER" == "1" ] || grep -q 'qemu-' /proc/1/smaps &>/dev/null; then
                ts_skip "running under qemu-user emulation"
        fi
 }
 
+function ts_runs_on_qemu {
+       if [ "$QEMU_USER" == "1" ] || grep -q 'qemu-' /proc/1/smaps &>/dev/null; then
+               echo 1
+               return
+       fi
+       echo 0
+       return
+}
+
 function ts_failed_subtest {
        local msg="FAILED"
        local ret=1
index 955d861ecb402afafd74b809eb54b77a78f1e3b7..7a8ad587f6d222d832439f92104fa27b6696714b 100755 (executable)
@@ -27,7 +27,8 @@ ts_check_test_command "$TS_CMD_KILL"
 ts_check_test_command "$TS_HELPER_SIGRECEIVE"
 
 # SIGRTMAX-0 and SIGRTMAX-1 are not usable under QEMU
-ts_skip_qemu_user
+is_qemu=$(ts_runs_on_qemu)
+ARCH="$(uname -m)"
 
 . "$TS_SELF/kill_functions.sh"
 
@@ -51,6 +52,9 @@ for SIG in $($TS_CMD_KILL -L); do
                SIG="$SIG+0"
        fi
        if [ "x$SIG" = "xRTMAX" ]; then
+               if [ "$ARCH" == "s390x" ] || [ "$is_qemu" == "1" ]; then
+                       continue
+               fi 
                SIG="$SIG-0"
        fi