--- /dev/null
+#!/bin/bash
+
+# Our exit code.
+RESULT=0
+
+# The directory where we'll do all the ACL manipulation.
+TESTDIR=test
+
+acl_reset() {
+ # Remove any ACLs on our test directory and remove its contents.
+ setfacl --remove-all --recursive "$TESTDIR"
+ rm "${TESTDIR}"/*
+}
+
+compare() {
+ if [[ "${ACTUAL}" == "${EXPECTED}" ]]; then
+ echo "Success."
+ else
+ echo "Failure."
+ echo "Expected result:"
+ echo "${EXPECTED}"
+ echo "Actual result:"
+ echo "${ACTUAL}"
+ RESULT=1
+ fi
+}
+
+# Start by removing and recreating the 'acl' directory.
+rm -rf "${TESTDIR}"
+mkdir "${TESTDIR}"
+
+
+# When using a minimal ACL, the default user, group, and other
+# permissions should all be propagated to the mode bits.
+
+TARGET="${TESTDIR}"/foo
+touch "${TARGET}"
+chmod 777 "${TARGET}"
+setfacl -d -m user::r-- "${TESTDIR}"
+setfacl -d -m group::r-- "${TESTDIR}"
+setfacl -d -m other::r-- "${TESTDIR}"
+
+./aclq "${TARGET}"
+
+EXPECTED=$(cat <<EOF
+user::r--
+group::r--
+other::r--
+
+EOF
+)
+
+ACTUAL=`getfacl --omit-header "${TARGET}"`
+compare