X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=run-tests.sh;h=d75e91eaa74f03b08929426c1268225fbba42ddd;hb=fb27d1a185dd5824cc2795e0283202379575368e;hp=7f7ba8fb41f456a54b9155e9aec26640ef285a98;hpb=e5d36040a86457ed66782496d79136d6bdc4d9a3;p=apply-default-acl.git diff --git a/run-tests.sh b/run-tests.sh index 7f7ba8f..d75e91e 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -32,7 +32,7 @@ for idx in $( seq 0 $((${#USERS[@]} - 1)) ); do done # The program name. -BIN=src/apply-default-acl +BIN=$(realpath src/apply-default-acl) # The directory where we'll do all the ACL manipulation. TESTDIR=test @@ -749,3 +749,49 @@ other::r-- EOF ) compare + + +# We should be able to run the tool with a relative path from within a +# directory that contains a symlink, so long as the relative path +# doesn't contain one. +TESTNUM=31 +TARGET="${TESTDIR}/foo/bar" +LINK2TARGET="${TESTDIR}/baz" +mkdir -p $(dirname "${TARGET}") +touch "${TARGET}" +ln -s foo "${TESTDIR}/baz" +setfacl --default --modify user:${USERS[0]}:rw $(dirname "${TARGET}") +pushd "${TESTDIR}/baz" > /dev/null +"${BIN}" bar +popd > /dev/null +ACTUAL=$( getfacl --omit-header "${TARGET}" ) +EXPECTED=$(cat <