aboutsummaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-06-12 13:47:01 +0000
committerOmar Polo <op@omarpolo.com>2021-06-12 13:47:01 +0000
commit0f2124e29194b42209e879a539e35d295f525311 (patch)
treeb710cb44e368e0690be31e141f9569d0823fcd48 /regress
parent03fcfb79d607e491c3d5fade1bf1afbd1beba851 (diff)
add some simple test for fastcgi
and while there reorder the targets in the Makefile a bit
Diffstat (limited to 'regress')
-rw-r--r--regress/Makefile11
-rwxr-xr-xregress/runtime14
2 files changed, 22 insertions, 3 deletions
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