aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-07-06 11:52:28 +0000
committerOmar Polo <op@omarpolo.com>2021-07-06 11:52:28 +0000
commitfb4102a5ffdf34311e88a8c0ac6712546482f09d (patch)
tree898c6948b78ee78b083e225270b9bbf00d376f8e
parent3759d3eb56e899a8982c7e7df9555842b398b9b6 (diff)
test macro expansion too
-rwxr-xr-xregress/runtime30
1 files changed, 27 insertions, 3 deletions
diff --git a/regress/runtime b/regress/runtime
index e62b872..9431f50 100755
--- a/regress/runtime
+++ b/regress/runtime
@@ -4,12 +4,16 @@ set -e
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"
@@ -43,7 +47,7 @@ raw() {
}
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.
@@ -339,3 +343,23 @@ restart
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