From: Jim Meyering Date: Sat, 6 Jul 2002 09:53:14 +0000 (+0000) Subject: improve the test X-Git-Tag: FILEUTILS-4_1_10~107 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=66f8c36584f21340f8993f30be9b8b334731ab7a;p=thirdparty%2Fcoreutils.git improve the test --- diff --git a/tests/rm/dangling-symlink b/tests/rm/dangling-symlink index 4fb403749f..dd5b7490bc 100755 --- a/tests/rm/dangling-symlink +++ b/tests/rm/dangling-symlink @@ -24,6 +24,19 @@ fi fail=0 -rm dangle < /dev/null > /dev/null 2>&1 || fail=1 +# Skip this test if there is no /dev/stdin file. +ls /dev/stdin >/dev/null 2>&1 \ + || { (exit 77); exit; } + +rm dangle < /dev/stdin & +pid=$! + +# The buggy rm (fileutils-4.1.9) would hang here, waiting for input. +sleep 1 + +# The file must no longer exist. +ls -l dangle > /dev/null 2>&1 && fail=1 + +kill $pid > /dev/null 2>&1 (exit $fail); exit