diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0303-robustness.sh | 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 28 insertions, 0 deletions
diff --git a/tests/t0303-robustness.sh b/tests/t0303-robustness.sh index 3f9c80d..87a85ce 100755 --- a/tests/t0303-robustness.sh +++ b/tests/t0303-robustness.sh @@ -655,4 +655,32 @@ test_expect_success 'a chain of single directories is followed a bounded number test $(grep -o "class=.ls-dir." tmp | wc -l) -le 17 ' +# The line has to carry the read error rather than the flag ferror returns. +# Linux opens a directory and fails the read, while macOS already refuses the +# open, so the same error text is expected from either path. +test_expect_success 'an unreadable project list is named with its error' ' + mkdir -p projdir && + { + echo "virtual-root=/" && + echo "cache-size=0" && + echo "project-list=$PWD/projdir" && + echo "scan-path=$PWD/repos" + } >projrc && + CGIT_CONFIG="$PWD/projrc" QUERY_STRING="url=" cgit >tmp 2>err && + grep "project list .*projdir: Is a directory" err +' + +test_expect_success SANITY 'a scan entry that cannot be searched is named in full' ' + mkdir -p scanperm/locked && + test_when_finished "chmod 755 scanperm/locked" && + chmod 644 scanperm/locked && + { + echo "virtual-root=/" && + echo "cache-size=0" && + echo "scan-path=$PWD/scanperm" + } >scanpermrc && + CGIT_CONFIG="$PWD/scanpermrc" QUERY_STRING="url=" cgit >tmp 2>err && + grep "Unable to stat .*scanperm/locked/objects: Permission denied" err +' + test_done |
