diff options
author | Jim Meyering <jim@meyering.net> | 2007-09-06 17:34:49 +0200 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2007-09-15 08:40:38 +0200 |
commit | df0beae1eb1318869d51a064aec8fdd401877cbf (patch) | |
tree | 94f2224056162eadbb3d6b640e32f56d3f405cbf /tests/cp/fail-perm | |
parent | c840cd4334c086f5ce4d9144d9fac75643824a38 (diff) | |
download | coreutils-df0beae1eb1318869d51a064aec8fdd401877cbf.tar.xz |
Adjust chgrp, chmod, chown, cp tests to use test-lib.sh.
* tests/check.mk: Also define abs_top_builddir.
Diffstat (limited to 'tests/cp/fail-perm')
-rwxr-xr-x | tests/cp/fail-perm | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/tests/cp/fail-perm b/tests/cp/fail-perm index 31b4cb3ad..0ed9166f4 100755 --- a/tests/cp/fail-perm +++ b/tests/cp/fail-perm @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006 Free Software +# Copyright (C) 2000, 2002-2007 Free Software # Foundation, Inc. # This program is free software: you can redistribute it and/or modify @@ -23,25 +23,12 @@ fi . $srcdir/../lang-default 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 D D/D || framework_failure=1 -touch D/a || framework_failure=1 -chmod 0 D/a || framework_failure=1 -chmod u=rx,go=,-st D || framework_failure=1 - -if test $framework_failure = 1; then - echo 'failure in testing framework' - exit 1 -fi +mkdir D D/D || framework_failure +touch D/a || framework_failure +chmod 0 D/a || framework_failure +chmod u=rx,go=,-st D || framework_failure fail=0 @@ -66,11 +53,11 @@ cp F symlink 2> out && fail=1 # ...: The file access permissions do not allow the specified action. # to the expected one: sed 's/: The file access permissions.*/: Permission denied/'<out>o1;mv o1 out -cmp out exp || { (diff -c out exp) 2> /dev/null; fail=1; } +compare out exp || fail=1 cp --target-directory=symlink F 2> out && fail=1 sed 's/: The file access permissions.*/: Permission denied/'<out>o1;mv o1 out -cmp out exp || { (diff -c out exp) 2> /dev/null; fail=1; } +compare out exp || fail=1 chmod 700 D |