]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - tests/ts/kill/options
2c82bbccc5da4babae728628fb8a2acb3610616e
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}/opXXXXXXXXXXXXX
")"
29 ln -sf "$TS_HELPER_SIGRECEIVE" "$HELPER_SYMLINK"
33 "$HELPER_SYMLINK" >> "$TS_OUTPUT" 2>&1 &
35 check_test_sigreceive
$TEST_PID
36 [ $?
-eq 1 ] ||
echo "${HELPER_SYMLINK##*/} helper did not start" >> "$TS_OUTPUT"
38 "$TS_CMD_KILL" "$@" $TEST_PID >> "$TS_OUTPUT" 2>&1
40 echo "kill $@ did not work" >> "$TS_OUTPUT"
45 echo "wait $TEST_PID for $@ did not work" >> "$TS_OUTPUT"
52 try_option
--signal HUP
53 try_option
--signal SIGHUP
59 echo 'all ok' >> "$TS_OUTPUT"
61 rm -f "$HELPER_SYMLINK"