| 1 |
#!/bin/bash |
| 2 |
# |
| 3 |
# Copyright (C) 2023 Masatake YAMATO <[email protected]> |
| 4 |
# |
| 5 |
# This file is part of util-linux. |
| 6 |
# |
| 7 |
# This file is free software; you can redistribute it and/or modify |
| 8 |
# it under the terms of the GNU General Public License as published by |
| 9 |
# the Free Software Foundation; either version 2 of the License, or |
| 10 |
# (at your option) any later version. |
| 11 |
# |
| 12 |
# This file is distributed in the hope that it will be useful, |
| 13 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
# GNU General Public License for more details. |
| 16 |
# |
| 17 |
TS_TOPDIR="${0%/*}/../.." |
| 18 |
TS_DESC="signalfd" |
| 19 |
|
| 20 |
. "$TS_TOPDIR"/functions.sh |
| 21 |
ts_init "$*" |
| 22 |
# s390x and riscv64 reported the same error: |
| 23 |
# |
| 24 |
# lsfd: signalfd ... |
| 25 |
# diff-{{{ |
| 26 |
# --- /home/runner/work/util-linux/util-linux/tests/expected/lsfd/mkfds-signalfd 2023-06-08 10:20:13.520555037 +0000 |
| 27 |
# +++ /home/runner/work/util-linux/util-linux/tests/output/lsfd/mkfds-signalfd 2023-06-08 11:12:21.150054369 +0000 |
| 28 |
# @@ -1,2 +1,2 @@ |
| 29 |
# - 3 signalfd mask=FPE,USR1,42 FPE,USR1,42 |
| 30 |
# + 3 signalfd mask=FPE,USR1,44 FPE,USR1,44 |
| 31 |
# ASSOC,TYPE,NAME,SIGNALFD.MASK: 0 |
| 32 |
# }}}-diff |
| 33 |
# |
| 34 |
# FAILED (lsfd/mkfds-signalfd) |
| 35 |
# |
| 36 |
# The error is nothing to do with endianness; the endian s390x is |
| 37 |
# big-endian. riscv64 is little-endian. |
| 38 |
# |
| 39 |
# So Qemu's user emulation is suspicious. |
| 40 |
ts_skip_qemu_user |
| 41 |
|
| 42 |
ts_check_test_command "$TS_CMD_LSFD" |
| 43 |
ts_check_test_command "$TS_HELPER_MKFDS" |
| 44 |
|
| 45 |
ts_cd "$TS_OUTDIR" |
| 46 |
|
| 47 |
PID= |
| 48 |
FD=3 |
| 49 |
|
| 50 |
COL=ASSOC,TYPE,NAME,SIGNALFD.MASK |
| 51 |
EXPR='(FD == '"$FD"')' |
| 52 |
|
| 53 |
{ |
| 54 |
coproc MKFDS { "$TS_HELPER_MKFDS" signalfd $FD; } |
| 55 |
if read -u ${MKFDS[0]} PID; then |
| 56 |
${TS_CMD_LSFD} -p "${PID}" -n -o "${COL}" -Q "${EXPR}" |
| 57 |
echo "${COL}": $? |
| 58 |
|
| 59 |
echo DONE >&"${MKFDS[1]}" |
| 60 |
fi |
| 61 |
wait "${MKFDS_PID}" |
| 62 |
} > "$TS_OUTPUT" 2>&1 |
| 63 |
|
| 64 |
ts_finalize |