]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - tests/ts/kill/name_to_number
cde55c9ed83538912d8a7ad2f6a5cc6e5b27ab4c
3 # This file is part of util-linux.
5 # This file is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This file is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 TS_TOPDIR
="${0%/*}/../.."
16 TS_DESC
="name_to_number"
18 .
"$TS_TOPDIR/functions.sh"
21 ts_check_test_command
"$TS_CMD_KILL"
22 ts_check_test_command
"$TS_HELPER_SIGRECEIVE"
24 .
"$TS_SELF/kill_functions.sh"
28 HELPER_SYMLINK
="$(mktemp "${TS_OUTDIR}/naXXXXXXXXXXXXX
")"
29 ln -sf "$TS_HELPER_SIGRECEIVE" "$HELPER_SYMLINK"
31 for SIG
in $
($TS_CMD_KILL -L); do
32 if [ "x${SIG//[0-9]/}" = "x" ]; then
36 if [ -f "$ASAN_SYMBOLIZER_PATH" ] && [ "x$SIG" = "xSEGV" ]; then
39 if [ "x$SIG" = "xSTOP" ] ||
[ "x$SIG" = "xKILL" ]; then
42 if [ "x$SIG" = "xRTMIN" ]; then
45 if [ "x$SIG" = "xRTMAX" ]; then
49 "$HELPER_SYMLINK" >> "$TS_OUTPUT" 2>&1 &
51 check_test_sigreceive
$TEST_PID
52 [ $?
-eq 1 ] ||
echo "${HELPER_SYMLINK##*/} helper did not start" >> "$TS_OUTPUT"
54 "$TS_CMD_KILL" -$SIG ${HELPER_SYMLINK##*/} >> "$TS_OUTPUT" 2>&1
56 if [ $?
-ne $EXPECTED ]; then
57 echo "$SIG returned $? while $EXPECTED was expected" >> "$TS_OUTPUT"
63 echo 'all ok' >> "$TS_OUTPUT"
65 rm -f "$HELPER_SYMLINK"