commit 0f2124e29194b42209e879a539e35d295f525311 from: Omar Polo date: Sat Jun 12 13:47:01 2021 UTC add some simple test for fastcgi and while there reorder the targets in the Makefile a bit commit - 03fcfb79d607e491c3d5fade1bf1afbd1beba851 commit + 0f2124e29194b42209e879a539e35d295f525311 blob - df68f5fe15728c02a7547eefaa8923a40092d37f blob + 64e7d57a5d3dd44a1d73af2feb184fbdbd3b7e2e --- .gitignore +++ .gitignore @@ -21,6 +21,7 @@ regress/*.crt regress/*.csr regress/*.srl regress/reg.conf +regress/fcgi-test regress/fill-file regress/iri_test regress/puny-test blob - 4f416d36626c56cd952559923fe8d658465648ce blob + 428338f15b78f340084ad805c6077c1cb1781174 --- regress/Makefile +++ regress/Makefile @@ -1,12 +1,14 @@ include ../Makefile.local -.PHONY: all clean runtime +.PHONY: all data clean runtime -all: gg puny-test testdata iri_test cert.pem testca.pem valid.crt invalid.cert.pem +all: data gg puny-test fcgi-test ./puny-test - ./runtime ./iri_test + ./runtime +data: testdata iri_test cert.pem testca.pem valid.crt invalid.cert.pem + gg: gg.o ../iri.o ../utf8.o ${COMPAT} ${CC} gg.o ../iri.o ../utf8.o ${COMPAT} -o $@ ${LDFLAGS} @@ -20,6 +22,9 @@ iri_test: iri_test.o ../iri.o ../utf8.o ${COMPAT} fill-file: fill-file.o ${CC} fill-file.o -o fill-file +fcgi-test: fcgi-test.o + ${CC} fcgi-test.o ${COMPAT} -o fcgi-test ${LDFLAGS} + key.pem: cert.pem # XXX: key size is NOT GOOD. This is only for testing. Smaller keys blob - 098db1a4668faecb1226eae970a097a09e7c26e7 blob + e62b872aec06b23b37c99306ae550fa0466a3f07 --- regress/runtime +++ regress/runtime @@ -314,6 +314,7 @@ restart eq "$(head /foo)" "51 not found" "Unexpected head for /foo" eq "$(head /foo/)" "20 text/gemini" "Unexpected head for /foo/" +echo OK /foo and /foo/ with root inside location # how to match both /foo and /foo/* config '' ' @@ -325,3 +326,16 @@ restart eq "$(head /foo)" "31 /foo/" "Unexpected head for /foo" eq "$(head /foo/)" "20 text/gemini" "Unexpected head for /foo/" +echo OK /foo and /foo/ with root inside location + +# test with fastcgi + +# NB: the fcgi spawn is NOT supported outside of this test suite + +config 'prefork 1' 'fastcgi spawn "'$PWD'/fcgi-test"' +checkconf +restart + +eq "$(head /)" "20 text/gemini" "Unexpected head for /" +eq "$(get /)" "# Hello, world!" "Unexpected body for /" +echo OK GET / with fastcgi