Diff options
| -rwxr-xr-x | tests/t0201-filters.sh | 15 |
1 file changed, 15 insertions, 0 deletions
diff --git a/tests/t0201-filters.sh b/tests/t0201-filters.sh index f84774f..d928dec 100755 --- a/tests/t0201-filters.sh +++ b/tests/t0201-filters.sh @@ -93,6 +93,21 @@ test_expect_success 'a content filter that exits non-zero still renders the page test_grep "<div class=.commit-subject.>commit 5" tmp ' +# A filter killed by a signal leaves no exit status to go on, so the request +# ends there. The auth filter runs before any of the page is out, which lets +# the error page carry its own status. +test_expect_success 'a filter killed by a signal ends the request' ' + write_script killed-filter <<-\EOF && + cat >/dev/null + kill -9 $$ + EOF + cgitrc_repo killedrc foo "auth-filter=exec:$PWD/killed-filter" && + cgit_rc killedrc "url=foo/" >tmp 2>err && + test $(grep -c "^Status:" tmp) = 1 && + test_grep "^Status: 500" tmp && + test_grep -F "Subprocess $PWD/killed-filter exited abnormally" err +' + # A die inside a lua filter has to reach the visitor as an error page rather # than being fed back into the filter that just failed, and the reason goes to # the log. |
