]> gitweb.michael.orlitzky.com - apply-default-acl.git/commitdiff
Add two new tests for repeated application on a directory.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 8 Jan 2013 19:57:45 +0000 (14:57 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 8 Jan 2013 19:57:45 +0000 (14:57 -0500)
run-tests.sh

index 0ce549c84ca1e6a64a1a7cb9f1dd50d19d3b57e8..31c9f30ab94ec7f6ceae1908649c6787252e59e9 100755 (executable)
@@ -334,3 +334,61 @@ EOF
 
 ACTUAL=`getfacl --omit-header "${TARGET}"/bar`
 compare
+
+
+# Test double application on a directory.
+#
+TESTNUM=14
+TARGET="${TESTDIR}"/baz
+mkdir "${TARGET}"
+chmod 644 "${TARGET}"
+setfacl -d -m user:mail:rwx "${TESTDIR}"
+
+$BIN "${TARGET}"
+$BIN "${TARGET}"
+
+EXPECTED=$(cat <<EOF
+user::rwx
+user:mail:rwx
+group::r-x
+mask::rwx
+other::r-x
+default:user::rwx
+default:user:mail:rwx
+default:group::r-x
+default:mask::rwx
+default:other::r-x
+EOF
+)
+
+ACTUAL=`getfacl --omit-header "${TARGET}"`
+compare
+
+
+# Same as test #14, with 755 initial perms.
+#
+TESTNUM=15
+TARGET="${TESTDIR}"/baz
+mkdir "${TARGET}"
+chmod 755 "${TARGET}"
+setfacl -d -m user:mail:rwx "${TESTDIR}"
+
+$BIN "${TARGET}"
+$BIN "${TARGET}"
+
+EXPECTED=$(cat <<EOF
+user::rwx
+user:mail:rwx
+group::r-x
+mask::rwx
+other::r-x
+default:user::rwx
+default:user:mail:rwx
+default:group::r-x
+default:mask::rwx
+default:other::r-x
+EOF
+)
+
+ACTUAL=`getfacl --omit-header "${TARGET}"`
+compare