diff options
author | Jim Meyering <jim@meyering.net> | 2007-09-07 15:25:23 +0200 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2007-09-15 08:40:38 +0200 |
commit | ec2064acc84d9cc6e0bfae04c591974efc449d8a (patch) | |
tree | fc20b7c780175d6f428c392ce333199c9b24e79f /tests/du/long-from-unreadable | |
parent | 18b3231bbfdb1fe36c08511bda930588cc836c71 (diff) | |
download | coreutils-ec2064acc84d9cc6e0bfae04c591974efc449d8a.tar.xz |
Convert tests/du/*, too.
Diffstat (limited to 'tests/du/long-from-unreadable')
-rwxr-xr-x | tests/du/long-from-unreadable | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/tests/du/long-from-unreadable b/tests/du/long-from-unreadable index 9718b2bd2..64c35b9a5 100755 --- a/tests/du/long-from-unreadable +++ b/tests/du/long-from-unreadable @@ -1,7 +1,7 @@ #!/bin/sh # Show fts fails on old-fashioned systems. -# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 2006-2007 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ if test "$VERBOSE" = yes; then du --version fi -. $srcdir/../envvar-check +. $srcdir/../test-lib.sh proc_file=/proc/self/fd if test ! -d $proc_file; then @@ -44,44 +44,32 @@ EOF (exit 77); exit 77 fi -pwd=`pwd` -t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$ -trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0 -trap '(exit $?); exit $?' 1 2 13 15 - -framework_failure=0 -mkdir -p $tmp || framework_failure=1 -cd $tmp || framework_failure=1 - dir=`printf '%200s\n' ' '|tr ' ' x` # Construct a hierarchy containing a relative file with a name # longer than PATH_MAX. # for i in `seq 52`; do -# mkdir $dir || framework_failure=1 -# cd $dir || framework_failure=1 +# mkdir $dir || framework_failure +# cd $dir || framework_failure # done -# cd $tmp || framework_failure=1 +# cd $tmp || framework_failure # Sheesh. Bash 3.1.5 can't create this hierarchy. I get # cd: error retrieving current directory: getcwd: cannot access parent directories: + +cwd=`pwd` # Use perl instead: : ${PERL=perl} $PERL \ -e 'my $d = '$dir'; foreach my $i (1..52)' \ -e ' { mkdir ($d, 0700) && chdir $d or die "$!" }' \ - || framework_failure=1 + || framework_failure -mkdir inaccessible || framework_failure=1 -cd inaccessible || framework_failure=1 -chmod 0 . || framework_failure=1 - -if test $framework_failure = 1; then - echo "$0: failure in testing framework" 1>&2 - (exit 1); exit 1 -fi +mkdir inaccessible || framework_failure +cd inaccessible || framework_failure +chmod 0 . || framework_failure fail=0 -du -s "$pwd/$tmp/$dir" > /dev/null || fail=1 +du -s "$cwd/$dir" > /dev/null || fail=1 (exit $fail); exit $fail |