xref: /netbsd-src/external/bsd/unbound/dist/testdata/auth_https.tdir/auth_https.test (revision 7a540f2bd4f5b968566c2607d6462c7f2fb452cf)
1# #-- auth_https.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. ../common.sh
9# do the test
10echo "> dig www.example.com."
11dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
12if grep SERVFAIL outfile; then
13	echo "> try again"
14	dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
15fi
16if grep SERVFAIL outfile; then
17	echo "> try again"
18	sleep 1
19	dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
20fi
21if grep SERVFAIL outfile; then
22	echo "> try again"
23	sleep 1
24	dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
25fi
26if grep SERVFAIL outfile; then
27	echo "> try again"
28	sleep 1
29	dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
30fi
31if grep SERVFAIL outfile; then
32	echo "> try again"
33	sleep 10
34	dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
35fi
36if grep SERVFAIL outfile; then
37	echo "> try again"
38	sleep 10
39	dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
40fi
41echo "> cat logfiles"
42cat petal.log
43cat unbound.log
44echo "> check answer"
45if grep "1.2.3.4" outfile; then
46	echo "OK"
47else
48	echo "Not OK"
49	exit 1
50fi
51
52# Test that notify is allowed from the webserver address
53get_ldns_notify
54echo "> ldns-notify -z example.com"
55$LDNS_NOTIFY -p $UNBOUND_PORT -z example.com 127.0.0.1 | tee outfile
56if grep "rcode: REFUSED"  outfile; then
57	echo "Not OK"
58	exit 1
59else
60	echo "OK"
61fi
62
63exit 0
64