3 # Copyright (C) 2022 Thomas Weißschuh <thomas@t-8ch.de>
5 # This file is part of util-linux.
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.
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.
17 TS_TOPDIR
="${0%/*}/../.."
20 .
"$TS_TOPDIR"/functions.sh
23 ts_check_test_command
"$TS_CMD_WAITPID"
25 ts_init_subtest normal
27 (sleep 0.2; echo 1 >> "$TS_OUTPUT") &
30 (sleep 0.1; echo 2 >> "$TS_OUTPUT") &
33 echo 3 >> "$TS_OUTPUT"
34 "$TS_CMD_WAITPID" "$BG1" "$BG2"
35 ts_skip_exitcode_not_supported
37 echo 4 >> "$TS_OUTPUT"
41 ts_init_subtest timeout
42 "$TS_CMD_WAITPID" -v -t 0.1 1 >> "$TS_OUTPUT" 2>> "$TS_ERRLOG"
43 echo $?
>> "$TS_OUTPUT"
46 ts_init_subtest exited
47 "$TS_CMD_WAITPID" -v -e 2147483647 >> "$TS_OUTPUT" 2>> "$TS_ERRLOG"
48 echo $?
>> "$TS_ERRLOG"
52 (sleep 0.2; echo 1 >> "$TS_OUTPUT") &
55 "$TS_CMD_WAITPID" -c 1 1 "$BG1" >> "$TS_OUTPUT" 2>> "$TS_ERRLOG"
56 echo $?
>> "$TS_ERRLOG"