From 0f2124e29194b42209e879a539e35d295f525311 Mon Sep 17 00:00:00 2001 From: Omar Polo Date: Sat, 12 Jun 2021 13:47:01 +0000 Subject: [PATCH] add some simple test for fastcgi and while there reorder the targets in the Makefile a bit --- .gitignore | 1 + regress/Makefile | 11 ++++++++--- regress/runtime | 14 ++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index df68f5f..64e7d57 100644 --- a/.gitignore +++ b/.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 diff --git a/regress/Makefile b/regress/Makefile index 4f416d3..428338f 100644 --- a/regress/Makefile +++ b/regress/Makefile @@ -1,11 +1,13 @@ 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 diff --git a/regress/runtime b/regress/runtime index 098db1a..e62b872 100755 --- a/regress/runtime +++ b/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