summaryrefslogtreecommitdiff
path: root/testdata/http_user_agent.tdir/http_user_agent.pre
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2021-08-16 23:55:17 +0000
committerCy Schubert <cy@FreeBSD.org>2021-08-16 23:57:03 +0000
commit625f1c1312fb7defbd148c8ba121a0cf058707ef (patch)
tree31510b9372850c8a8dd3e0a8dac37308308d8429 /testdata/http_user_agent.tdir/http_user_agent.pre
parentd60fa10fd872db7e3d8cb1e161cfdae026c43b14 (diff)
Diffstat (limited to 'testdata/http_user_agent.tdir/http_user_agent.pre')
-rw-r--r--testdata/http_user_agent.tdir/http_user_agent.pre37
1 files changed, 37 insertions, 0 deletions
diff --git a/testdata/http_user_agent.tdir/http_user_agent.pre b/testdata/http_user_agent.tdir/http_user_agent.pre
new file mode 100644
index 000000000000..e94bd536edb4
--- /dev/null
+++ b/testdata/http_user_agent.tdir/http_user_agent.pre
@@ -0,0 +1,37 @@
+# #-- http_user_agent.pre--#
+# source the master var file when it's there
+[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
+# use .tpkg.var.test for in test variable passing
+[ -f .tpkg.var.test ] && source .tpkg.var.test
+
+PRE="../.."
+. ../common.sh
+get_random_port 3
+UNBOUND_PORT=$RND_PORT
+PETAL_PORT=$(($RND_PORT + 1))
+CONTROL_PORT=$(($RND_PORT + 3))
+echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
+echo "PETAL_PORT=$PETAL_PORT" >> .tpkg.var.test
+echo "CONTROL_PORT=$CONTROL_PORT" >> .tpkg.var.test
+
+get_make
+(cd $PRE; $MAKE petal)
+
+# start https daemon
+# More verbosity because we need to see the HTTP headers
+$PRE/petal -vv -a "127.0.0.1" -p $PETAL_PORT >petal.log 2>&1 &
+PETAL_PID=$!
+echo "PETAL_PID=$PETAL_PID" >> .tpkg.var.test
+cat .tpkg.var.test
+wait_petal_up petal.log
+
+# make config file
+sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's/@TOPORT\@/'$PETAL_PORT'/' -e 's/@CONTROL_PORT\@/'$CONTROL_PORT'/'< http_user_agent.conf > ub.conf
+# start unbound in the background
+$PRE/unbound -d -c ub.conf >unbound.log 2>&1 &
+UNBOUND_PID=$!
+echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test
+
+cat .tpkg.var.test
+wait_unbound_up unbound.log
+