xref: /netbsd-src/external/bsd/unbound/dist/testdata/ctrl_itr.tdir/ctrl_itr.test (revision 0cd9f4ecf44538bbdd5619b5b2081449960ab3e6)
1# #-- ctrl_itr.test --#
2# source the master var file when it's there
3[ -f ../.tpkg.var.master ] && source ../.tpkg.var.master
4# use .tpkg.var.test for in test variable passing
5[ -f .tpkg.var.test ] && source .tpkg.var.test
6
7PRE="../.."
8
9# exit value is 1 on usage
10$PRE/unbound-control -c ub.conf forward_add +i bla bla
11if test $? -ne 0; then
12	echo "wrong exit value."
13	cat fwd.log
14	cat unbound.log
15	exit 1
16else
17	echo "exit value: OK"
18fi
19
20
21# test if the server is up.
22echo "> dig www.example.com."
23dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
24echo "> check answer"
25if grep "10.20.30.40" outfile; then
26	echo "OK"
27else
28	echo "> cat logfiles"
29	cat fwd.log
30	cat unbound.log
31	echo "Not OK"
32	exit 1
33fi
34
35echo "> cat logfiles"
36cat fwd.log
37cat unbound.log
38echo "> OK"
39exit 0
40