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/inaccessible-cwd | |
parent | 18b3231bbfdb1fe36c08511bda930588cc836c71 (diff) | |
download | coreutils-ec2064acc84d9cc6e0bfae04c591974efc449d8a.tar.xz |
Convert tests/du/*, too.
Diffstat (limited to 'tests/du/inaccessible-cwd')
-rwxr-xr-x | tests/du/inaccessible-cwd | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/tests/du/inaccessible-cwd b/tests/du/inaccessible-cwd index c5aaabe40..6706c19aa 100755 --- a/tests/du/inaccessible-cwd +++ b/tests/du/inaccessible-cwd @@ -2,7 +2,7 @@ # Ensure that even when run from an inaccessible directory, du can still # operate on accessible directories elsewhere. -# Copyright (C) 2003, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 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 @@ -26,26 +26,15 @@ if test "$VERBOSE" = yes; then fi PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check +. $srcdir/../test-lib.sh -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 -mkdir -p no-x a/b || framework_failure=1 -cd no-x || 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 +cwd=`pwd` +mkdir -p no-x a/b || framework_failure +cd no-x || framework_failure +chmod 0 . || framework_failure fail=0 -du "$pwd/$tmp/a" > /dev/null || fail=1 +du "$cwd/a" > /dev/null || fail=1 (exit $fail); exit $fail |