diff options
author | Eric Blake <ebb9@byu.net> | 2009-10-23 08:54:53 -0600 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-10-23 16:31:23 -0600 |
commit | bd933c125073bf5b071d8ea0631de8aac3a8c3e9 (patch) | |
tree | cc2d38714175100fc90fd9ef1f289239003d4669 /tests/misc/timeout-parameters | |
parent | 1ce9e1e5ca1e7491bccedeeced15470d856c9a22 (diff) | |
download | coreutils-bd933c125073bf5b071d8ea0631de8aac3a8c3e9.tar.xz |
tests: enhance stdbuf and timeout tests
* tests/misc/timeout-parameters: Validate exact exit status.
* tests/misc/stdbuf: Likewise.
* tests/misc/timeout: Likewise. Use require_built_.
* tests/misc/arch: Likewise.
Diffstat (limited to 'tests/misc/timeout-parameters')
-rwxr-xr-x | tests/misc/timeout-parameters | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/tests/misc/timeout-parameters b/tests/misc/timeout-parameters index cf344b962..52d4c8aee 100755 --- a/tests/misc/timeout-parameters +++ b/tests/misc/timeout-parameters @@ -26,28 +26,38 @@ getlimits_ fail=0 +# internal errors are 125, distinct from execution failure + # --help and --version must be specified alone -timeout --help --version && fail=1 +timeout --help --version +test $? = 125 || fail=1 # invalid timeout -timeout invalid sleep 0 && fail=1 +timeout invalid sleep 0 +test $? = 125 || fail=1 # invalid timeout suffix -timeout 42D sleep 0 && fail=1 +timeout 42D sleep 0 +test $? = 125 || fail=1 # timeout overflow -timeout $UINT_OFLOW sleep 0 && fail=1 +timeout $UINT_OFLOW sleep 0 +test $? = 125 || fail=1 # timeout overflow -timeout $(expr $UINT_MAX / 86400 + 1)d sleep 0 && fail=1 +timeout $(expr $UINT_MAX / 86400 + 1)d sleep 0 +test $? = 125 || fail=1 # invalid signal spec -timeout --signal=invalid 1 sleep 0 && fail=1 +timeout --signal=invalid 1 sleep 0 +test $? = 125 || fail=1 # invalid command -timeout 1 . && fail=1 +timeout 1 . +test $? = 126 || fail=1 -# non existant command -timeout 1 ... && fail=1 +# no such command +timeout 1 ... +test $? = 127 || fail=1 Exit $fail |