]> gitweb.michael.orlitzky.com - apply-default-acl.git/commitdiff
run-tests.sh: add two tests for regular file and symlink exit codes.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 27 Feb 2018 18:00:06 +0000 (13:00 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 27 Feb 2018 18:00:06 +0000 (13:00 -0500)
run-tests.sh

index e4ca3766721bdb58ff661aa246c3ff0915bc2523..fc7fed4f6090fe49be8af02a561ff14a53c6e18c 100755 (executable)
@@ -798,3 +798,25 @@ other::r--
 EOF
 )
 compare
+
+
+# Test that our exit code succeeds on a single, normal path.
+TESTNUM=33
+TARGET="${TESTDIR}/foo"
+touch "${TARGET}"
+setfacl --default --modify user:${USERS[0]}:rw "${TESTDIR}"
+"${BIN}" "${TARGET}"
+ACTUAL="$?"
+EXPECTED="0"
+compare
+
+# Test that our exit code fails on a symlink.
+TESTNUM=34
+TARGET="${TESTDIR}/bar"
+touch "${TESTDIR}/foo"
+ln -s foo "${TARGET}"
+setfacl --default --modify user:${USERS[0]}:rw "${TESTDIR}"
+"${BIN}" "${TARGET}"
+ACTUAL="$?"
+EXPECTED="1"
+compare