From: Michael Orlitzky Date: Wed, 15 Aug 2012 03:59:19 +0000 (-0400) Subject: Add a few more tricky tests. X-Git-Tag: v0.0.1~13 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=950ef1a3228a2c6427dbd8f836100d0d91221740;p=apply-default-acl.git Add a few more tricky tests. --- diff --git a/run-tests.sh b/run-tests.sh index 75414ca..4bfd364 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -1,8 +1,5 @@ #!/bin/bash -# Our exit code. -RESULT=0 - # The directory where we'll do all the ACL manipulation. TESTDIR=test @@ -14,15 +11,15 @@ acl_reset() { compare() { if [[ "${ACTUAL}" == "${EXPECTED}" ]]; then - echo "Success." + echo "Success (#${TESTNUM})" acl_reset else - echo "Failure." + echo "Failure (#${TESTNUM})" echo "Expected result:" echo "${EXPECTED}" echo "Actual result:" echo "${ACTUAL}" - RESULT=1 + exit 1 fi } @@ -33,6 +30,7 @@ mkdir "${TESTDIR}" # When using a minimal ACL, the default user, group, and other # permissions should all be propagated to the mode bits. +TESTNUM=1 TARGET="${TESTDIR}"/foo setfacl -d -m user::r-- "${TESTDIR}" setfacl -d -m group::r-- "${TESTDIR}" @@ -53,6 +51,7 @@ ACTUAL=`getfacl --omit-header "${TARGET}"` compare # Do the same thing as the last test, except with an extended ACL. +TESTNUM=2 setfacl -d -m user::r-- "${TESTDIR}" setfacl -d -m group::r-- "${TESTDIR}" setfacl -d -m other::r-- "${TESTDIR}" @@ -74,11 +73,12 @@ EOF ACTUAL=`getfacl --omit-header "${TARGET}"` compare -# A directory shared by a group, should still be group-writable +# A file shared by a group, should still be group-writable # afterwards. -setfacl -d -m group:mail:rwx "${TESTDIR}" +TESTNUM=3 touch "${TARGET}" chmod 644 "${TARGET}" +setfacl -d -m group:mail:rwx "${TESTDIR}" ./aclq "${TARGET}" EXPECTED=$(cat <