From 59bebfc82a36beb2be15b91b0b8ececd2557d557 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 27 Feb 2018 13:00:06 -0500 Subject: [PATCH] run-tests.sh: add two tests for regular file and symlink exit codes. --- run-tests.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/run-tests.sh b/run-tests.sh index e4ca376..fc7fed4 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -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 -- 2.43.2