diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/install/basic-1 | 25 | ||||
-rwxr-xr-x | tests/mkdir/p-3 | 13 |
2 files changed, 27 insertions, 11 deletions
diff --git a/tests/install/basic-1 b/tests/install/basic-1 index c41ea889b..bfddd6ef8 100755 --- a/tests/install/basic-1 +++ b/tests/install/basic-1 @@ -1,7 +1,7 @@ #! /bin/sh # Basic tests for "install". -# Copyright (C) 1998, 2000, 2001, 2002, 2004, 2005 Free Software +# Copyright (C) 1998, 2000, 2001, 2002, 2004, 2005, 2006 Free Software # Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -95,16 +95,27 @@ test -d newdir3 || fail=1 # initial working directory ($abs) after creating the first argument, and # hence cannot do anything meaningful with the following relative-named dirs. abs=$pwd/$tmp -mkdir sub && cd sub -chmod 0 .; ginstall -d $abs/xx/yy rel/sub1 rel/sub2 2> /dev/null && fail=1 -chmod 755 $abs/sub +mkdir sub || fail=1 +(cd sub && chmod 0 . && ginstall -d $abs/xx/yy rel/sub1 rel/sub2 2> /dev/null) && fail=1 +chmod 755 sub # Ensure that the first argument-dir has been created. -test -d $abs/xx/yy || fail=1 +test -d xx/yy || fail=1 # Make sure that the `rel' directory was not created... -test -d $abs/sub/rel && fail=1 +test -d sub/rel && fail=1 # and make sure it was not created in the wrong place. -test -d $abs/xx/rel && fail=1 +test -d xx/rel && fail=1 + +# Test that we can install from an unreadable directory with an +# inaccessible parent. coreutils 5.97 fails this test. +mkdir -p sub1/d || fail=1 +(cd sub1/d && chmod a-rx .. && chmod a-r . && + ginstall -d $abs/xx/zz rel/a rel/b 2> /dev/null) || fail=1 +chmod 755 sub1 || fail=1 +chmod 755 sub1/d || fail=1 +test -d xx/zz || fail=1 +test -d sub1/d/rel/a || fail=1 +test -d sub1/d/rel/b || fail=1 (exit $fail); exit $fail diff --git a/tests/mkdir/p-3 b/tests/mkdir/p-3 index 3fab37827..59bf33781 100755 --- a/tests/mkdir/p-3 +++ b/tests/mkdir/p-3 @@ -37,7 +37,7 @@ mkdir -p $tmp || framework_failure=1 cd $tmp || framework_failure=1 mkdir no-access || framework_failure=1 mkdir no-acce2s || framework_failure=1 -mkdir no-acce3s || framework_failure=1 +mkdir -p no-acce3s/d || framework_failure=1 if test $framework_failure = 1; then echo "$0: failure in testing framework" 1>&2 @@ -45,13 +45,18 @@ if test $framework_failure = 1; then fi p=$pwd/$tmp -(cd no-access; chmod 0 . && mkdir -p $p/a/b u/v) 2> /dev/null && fail=1 +(cd no-access && chmod 0 . && mkdir -p $p/a/b u/v) 2> /dev/null && fail=1 test -d $p/a/b || fail=1 # Same as above, but with a following *absolute* name, it should succeed -(cd no-acce2s; chmod 0 . && mkdir -p $p/b/b $p/z) || fail=1 +(cd no-acce2s && chmod 0 . && mkdir -p $p/b/b $p/z) || fail=1 +test -d $p/b/b && test -d $p/z || fail=1 -test -d $p/z || fail=1 +# Same as above, but a trailing relative name in an unreadable directory +# whose parent is inaccessible. coreutils 5.97 fails this test. +(cd no-acce3s/d && chmod a-rx .. && chmod a-r . && mkdir -p a/b $p/b/c d/e && + test -d a/b && test -d d/e) || fail=1 +test -d $p/b/c || fail=1 b=`ls $p/a|tr -d '\n'` # With coreutils-5.3.0, this would fail with $b=bu. |