]>
gitweb.michael.orlitzky.com - apply-default-acl.git/blob - run-tests.sh
a01d47c1922df9481ecb7213405593b8956776d5
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 # Since the default ACL will grant r-x to group/other, they will wind
146 chmod 744 "${TARGET}"
147 setfacl
-d -m user
:mail:rwx
"${TESTDIR}"
161 ACTUAL
=`getfacl --omit-header "${TARGET}"`
165 # Some named entries can be granted execute permissions as the result
169 chmod 744 "${TARGET}"
170 setfacl
-m user
:news
:rw
"${TARGET}"
171 setfacl
-d -m user
:mail:rwx
"${TESTDIR}"
172 setfacl
-d -m user
:news
:rwx
"${TESTDIR}"
187 ACTUAL
=`getfacl --omit-header "${TARGET}"`
191 # We should not retain any entries that aren't in the default.
194 chmod 644 "${TARGET}"
195 setfacl
-m user
:news
:rw
"${TARGET}"
196 setfacl
-d -m user
:mail:rwx
"${TESTDIR}"
202 user:mail:rwx #effective:rw-
210 ACTUAL
=`getfacl --omit-header "${TARGET}"`
214 # A slightly modified test #1 to make sure it works right.
216 TARGET
="${TESTDIR}"/foo
218 chmod 777 "${TARGET}"
219 setfacl
-d -m user
::r
-- "${TESTDIR}"
230 ACTUAL
=`getfacl --omit-header "${TARGET}"`