sort: drop "note" from a --debug message
[coreutils.git] / tests / timeout / timeout-large-parameters.sh
blob5669810e8ab319cc56e6da63a54c9b3743c883f9
1 #!/bin/sh
2 # Validate large timeout parameters
3 # Separated from standard parameter testing due to kernel overflow bugs.
5 # Copyright (C) 2008-2025 Free Software Foundation, Inc.
7 # This program 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 3 of the License, or
10 # (at your option) any later version.
12 # This program 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 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <https://www.gnu.org/licenses/>.
20 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
21 print_ver_ timeout
22 getlimits_
24 # It was seen on 32 bit Linux/HPPA and OpenIndiana 11
25 # that a kernel time_t overflowing cause the timer to fire immediately.
26 # This is still racy, but unlikely to cause an issue unless
27 # timeout can't process the timer firing within 3 seconds.
28 timeout $TIME_T_OFLOW sleep 3
29 if test $? = 124; then
30 skip_ 'timeout $TIME_T_OFLOW ..., timed out immediately!'
33 # timeout overflow
34 timeout $UINT_OFLOW sleep 0 || fail=1
36 # timeout overflow
37 timeout ${TIME_T_OFLOW}d sleep 0 || fail=1
39 # floating point notation
40 timeout 2.34e+5d sleep 0 || fail=1
42 # floating point overflow
43 timeout $LDBL_MAX sleep 0 || fail=1
44 returns_ 125 timeout -- -$LDBL_MAX sleep 0 || fail=1
46 Exit $fail