]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
set up for tpkg test
authortcarpay <tom@nlnetlabs.nl>
Mon, 23 Aug 2021 12:00:04 +0000 (14:00 +0200)
committertcarpay <tom@nlnetlabs.nl>
Mon, 23 Aug 2021 12:00:04 +0000 (14:00 +0200)
testdata/ede.tdir/ede.conf [new file with mode: 0644]
testdata/ede.tdir/ede.dsc [new file with mode: 0644]
testdata/ede.tdir/ede.post [new file with mode: 0644]
testdata/ede.tdir/ede.pre [new file with mode: 0644]
testdata/ede.tdir/ede.test [new file with mode: 0644]

diff --git a/testdata/ede.tdir/ede.conf b/testdata/ede.tdir/ede.conf
new file mode 100644 (file)
index 0000000..2281f46
--- /dev/null
@@ -0,0 +1,12 @@
+server:
+       verbosity: 2
+       interface: 127.0.0.1
+       port: @PORT@
+       use-syslog: no
+       directory: .
+       pidfile: "unbound.pid"
+       chroot: ""
+       username: ""
+
+       # @TODO change this to local file
+       auto-trust-anchor-file: "/var/lib/unbound/root.key"
diff --git a/testdata/ede.tdir/ede.dsc b/testdata/ede.tdir/ede.dsc
new file mode 100644 (file)
index 0000000..da4796f
--- /dev/null
@@ -0,0 +1,16 @@
+BaseName: svcb
+Version: 1.0
+Description: Test Extended DNS Errors (rfc8914)
+CreationDate: Fri Aug 20 15:42:11 UTC 2021
+Maintainer: Tom Carpay
+Category: 
+Component:
+CmdDepends: 
+Depends:
+Help:
+Pre:
+Post:
+Test: ede.test
+AuxFiles: 
+Passed:
+Failure:
diff --git a/testdata/ede.tdir/ede.post b/testdata/ede.tdir/ede.post
new file mode 100644 (file)
index 0000000..96279b3
--- /dev/null
@@ -0,0 +1,31 @@
+# #-- fwd_tcp.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
+
+. ../common.sh
+get_random_port 2
+UNBOUND_PORT=$RND_PORT
+FWD_PORT=$(($RND_PORT + 1))
+echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
+echo "FWD_PORT=$FWD_PORT" >> .tpkg.var.test
+
+# start forwarder
+get_ldns_testns
+$LDNS_TESTNS -p $FWD_PORT fwd_tcp.testns >fwd.log 2>&1 &
+FWD_PID=$!
+echo "FWD_PID=$FWD_PID" >> .tpkg.var.test
+
+# make config file
+sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's/@TOPORT\@/'$FWD_PORT'/' < fwd_tcp.conf > ub.conf
+# start unbound in the background
+PRE="../.."
+$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_ldns_testns_up fwd.log
+wait_unbound_up unbound.log
+
diff --git a/testdata/ede.tdir/ede.pre b/testdata/ede.tdir/ede.pre
new file mode 100644 (file)
index 0000000..ac8fb90
--- /dev/null
@@ -0,0 +1,32 @@
+# #-- fwd_tcp.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
+
+. ../common.sh
+get_random_port 2
+UNBOUND_PORT=$RND_PORT
+FWD_PORT=$(($RND_PORT + 1))
+echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
+echo "FWD_PORT=$FWD_PORT" >> .tpkg.var.test
+
+# start forwarder
+get_ldns_testns
+$LDNS_TESTNS -p $FWD_PORT fwd_tcp.testns >fwd.log 2>&1 &
+FWD_PID=$!
+echo "FWD_PID=$FWD_PID" >> .tpkg.var.test
+
+# rewrite config file with created ports
+sed -e 's/@PORT\@/'$UNBOUND_PORT'/' -e 's/@TOPORT\@/'$FWD_PORT'/' < fwd_tcp.conf > ub.conf
+
+# start unbound in the background
+PRE="../.."
+$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_ldns_testns_up fwd.log
+wait_unbound_up unbound.log
+
diff --git a/testdata/ede.tdir/ede.test b/testdata/ede.tdir/ede.test
new file mode 100644 (file)
index 0000000..2c98f70
--- /dev/null
@@ -0,0 +1,37 @@
+# #-- svcb.test --#
+# 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
+
+. ../common.sh
+get_random_port 2
+UNBOUND_PORT=$RND_PORT
+FWD_PORT=$(($RND_PORT + 1))
+echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
+echo "FWD_PORT=$FWD_PORT" >> .tpkg.var.test
+
+# rewrite config file with created ports
+sed -e 's/@PORT\@/'$UNBOUND_PORT'/' < fwd_tcp.conf > ub.conf
+
+# start unbound in the background
+PRE="../.."
+$PRE/unbound -d -c ub.conf > unbound.log 2>&1 &
+UNBOUND_PID=$!
+echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test
+
+
+# query with bad edns keepalive
+dig @127.0.0.1 -p $UNBOUND_PORT +tcp +ednsopt=11:010203 > keepalive.txt
+
+# refused nonrec (cache snoop) (Not Auth)
+dig @127.0.0.1 -p $UNBOUND_PORT +norec > snoop.text
+
+# DNAME expansion
+
+
+
+
+
+# teardown
+kill_pid $UNBOUND_PID
\ No newline at end of file