add some simple test for fastcgi

and while there reorder the targets in the Makefile a bit
This commit is contained in:
Omar Polo 2021-06-12 13:47:01 +00:00
parent 03fcfb79d6
commit 0f2124e291
3 changed files with 23 additions and 3 deletions

1
.gitignore vendored
View File

@ -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

View File

@ -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

View File

@ -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