commit - 3759d3eb56e899a8982c7e7df9555842b398b9b6
commit + fb4102a5ffdf34311e88a8c0ac6712546482f09d
blob - e62b872aec06b23b37c99306ae550fa0466a3f07
blob + 9431f509782022a8984e32067f49c60d572487dd
--- regress/runtime
+++ regress/runtime
ggflags=
+config_common='
+ipv6 off
+port 10965
+'
+
# usage: config <global config> <stuff for localhost>
# generates a configuration file reg.conf
config() {
cat <<EOF > reg.conf
-ipv6 off
-port 10965
+$config_common
$1
server "localhost" {
cert "$PWD/cert.pem"
}
run() {
- ./../gmid -f -c reg.conf &
+ ./../gmid -vvv -f -c reg.conf &
pid=$!
# give gmid time to bind the port, otherwise we end up
# executing gg when gmid isn't ready yet.
eq "$(head /)" "20 text/gemini" "Unexpected head for /"
eq "$(get /)" "# Hello, world!" "Unexpected body for /"
echo OK GET / with fastcgi
+
+# test macro expansion
+
+cat <<EOF > reg.conf
+pwd = "$PWD"
+$config_common
+
+server "localhost" {
+ # the quoting of \$ is for sh
+ cert \$pwd "/cert.pem"
+ key \$pwd "/key.pem"
+ root \$pwd "/testdata"
+}
+EOF
+checkconf
+restart
+
+eq "$(head /)" "20 text/gemini" "Unexpected head for /"
+eq "$(get /)" "# hello world$ln" "Unexpected body for /"
+echo OK GET / with macro expansion