diff options
author | Pádraig Brady <P@draigBrady.com> | 2010-09-07 14:02:56 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2010-09-07 14:02:56 +0100 |
commit | c52d220c300c63a93ffd39dd29e89201e6fd929c (patch) | |
tree | bd123fa2798df94a07fbb64f75741ca99c42b324 /tests/ls/readdir-mountpoint-inode | |
parent | 437671accc0af8fa43a3f9bda6c150cb63fc42cb (diff) | |
download | coreutils-c52d220c300c63a93ffd39dd29e89201e6fd929c.tar.xz |
tests: make various timeouts more robust
* tests/init.cfg (retry_delay_): Describe
the backoff method used.
* tests/ls/readdir-mountpoint-inode: Add a timeout
to the stat call to eliminate the chance of hangups.
* tests/mv/i-3: Change the timeout required to pass
from 1 second to a range of .1s - 3.1s.
* tests/rm/dangling-symlink: Likewise.
Diffstat (limited to 'tests/ls/readdir-mountpoint-inode')
-rwxr-xr-x | tests/ls/readdir-mountpoint-inode | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/ls/readdir-mountpoint-inode b/tests/ls/readdir-mountpoint-inode index 63378b64c..d03ba06f9 100755 --- a/tests/ls/readdir-mountpoint-inode +++ b/tests/ls/readdir-mountpoint-inode @@ -23,7 +23,8 @@ fi . $srcdir/test-lib.sh - +# We use --local here so as to not activate +# potentially very many remote mounts. mount_points=$(df --local -P 2>&1 | sed -n 's,.*[0-9]% \(/.\),\1,p') test -z "$mount_points" && skip_test_ "this test requires a non-root mount point" @@ -60,12 +61,10 @@ inode_via_readdir() eval "ls -i $opts $parent_dir" | sed 's/ .*//' } -# FIXME: use a timeout, in case stat'ing mount points takes too long. - for dir in $mount_points; do readdir_inode=$(inode_via_readdir $dir) test $? = 77 && continue - stat_inode=$(env stat --format=%i $dir) + stat_inode=$(timeout 1 stat --format=%i $dir) # If stat fails or says the inode is 0, skip $dir. case $stat_inode in 0|'') continue;; esac test "$readdir_inode" = "$stat_inode" || fail=1 |