re-establish fastcgi test

This commit is contained in:
Omar Polo 2023-06-09 10:46:50 +00:00
parent 5d22294a59
commit 9adeb26579
2 changed files with 19 additions and 5 deletions

View File

@ -50,7 +50,7 @@ run_test test_block_return_fmt
run_test test_require_client_ca
run_test test_root_inside_location
run_test test_root_inside_location_with_redirect
# run_test test_fastcgi XXX: needs to be fixed
run_test test_fastcgi
run_test test_macro_expansion
run_test test_proxy_relay_to
run_test test_proxy_with_certs

View File

@ -205,11 +205,25 @@ location "/foo/*" { root "'$PWD'/testdata" strip 1 }'
}
test_fastcgi() {
# XXX: prefork 1 for testing
setup_simple_test 'prefork 1' 'fastcgi spawn "'$PWD'/fcgi-test"'
./fcgi-test fcgi.sock &
fcgi_pid=$!
fetch /
check_reply "20 text/gemini" "# Hello, world!"
setup_simple_test 'prefork 1' 'fastcgi "'$PWD'/fcgi.sock"'
i=0
while [ $i -lt 10 ]; do
fetch /
check_reply "20 text/gemini" "# hello from fastcgi!"
if [ $? -ne 0 ]; then
kill $fcgi_pid
return 1
fi
i=$(($i + 1))
done
kill $fcgi_pid
return 0
}
test_macro_expansion() {