]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - tests/ts/kill/queue
992acf7a625a02ba1523fad5148b318f9406f780
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%/*}/../.."
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}/quXXXXXXXXXXXXX
")"
29 ln -sf "$TS_HELPER_SIGRECEIVE" "$HELPER_SYMLINK"
31 "$HELPER_SYMLINK" >> "$TS_OUTPUT" 2>&1 &
33 check_test_sigreceive
$TEST_PID
34 [ $?
-eq 1 ] ||
echo "${HELPER_SYMLINK##*/} helper did not start" >> "$TS_OUTPUT"
36 "$TS_CMD_KILL" -1 --queue 42 $TEST_PID >> "$TS_OUTPUT" 2>&1
38 echo "kill --queue 42 failed" >> "$TS_OUTPUT"
42 if [ $?
-ne 42 ]; then
43 echo "wait $TEST_PID returned $? instead of 42" >> "$TS_OUTPUT"
48 echo 'all ok' >> "$TS_OUTPUT"
51 rm -f "$HELPER_SYMLINK"