]>
gitweb.michael.orlitzky.com - apply-default-acl.git/blob - run-tests.sh
4bfd36461bbe3cd944792df67785938046326986
3 # The directory where we'll do all the ACL manipulation.
7 # Remove any ACLs on our test directory and remove its contents.
8 setfacl
--remove-all --recursive "$TESTDIR"
13 if [[ "${ACTUAL}" == "${EXPECTED}" ]]; then
14 echo "Success (#${TESTNUM})"
17 echo "Failure (#${TESTNUM})"
18 echo "Expected result:"
26 # Start by removing and recreating the 'acl' directory.
31 # When using a minimal ACL, the default user, group, and other
32 # permissions should all be propagated to the mode bits.
34 TARGET
="${TESTDIR}"/foo
35 setfacl
-d -m user
::r
-- "${TESTDIR}"
36 setfacl
-d -m group
::r
-- "${TESTDIR}"
37 setfacl
-d -m other
::r
-- "${TESTDIR}"
50 ACTUAL
=`getfacl --omit-header "${TARGET}"`
53 # Do the same thing as the last test, except with an extended ACL.
55 setfacl
-d -m user
::r
-- "${TESTDIR}"
56 setfacl
-d -m group
::r
-- "${TESTDIR}"
57 setfacl
-d -m other
::r
-- "${TESTDIR}"
58 setfacl
-d -m user
:mail:rwx
"${TESTDIR}"
73 ACTUAL
=`getfacl --omit-header "${TARGET}"`
76 # A file shared by a group, should still be group-writable
81 setfacl
-d -m group
:mail:rwx
"${TESTDIR}"
87 group:mail:rwx #effective:rw-
93 ACTUAL
=`getfacl --omit-header "${TARGET}"`
96 # Same test as before except with a directory.
98 setfacl
-d -m group
:mail:rwx
"${TESTDIR}"
100 chmod 755 "${TARGET}"
111 default:group:mail:rwx
118 ACTUAL
=`getfacl --omit-header "${TARGET}"`
122 # With no default, things are left alone.
125 chmod 744 "${TARGET}"
137 ACTUAL
=`getfacl --omit-header "${TARGET}"`
142 # Make sure execute permission is removed for group/other after the
146 chmod 744 "${TARGET}"
147 setfacl
-d -m user
:mail:rwx
"${TESTDIR}"
161 ACTUAL
=`getfacl --omit-header "${TARGET}"`
165 # In fact, no existing named entries without execute permissions
166 # should be granted execute permissions as the result of
170 chmod 744 "${TARGET}"
171 setfacl
-m user
:news
:rw
"${TARGET}"
172 setfacl
-d -m user
:mail:rwx
"${TESTDIR}"
173 setfacl
-d -m user
:news
:rwx
"${TESTDIR}"
188 ACTUAL
=`getfacl --omit-header "${TARGET}"`