]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/unbound/testdata/root_zonemd.tdir/root_zonemd.test
unbound: Vendor import 1.19.1
[FreeBSD/FreeBSD.git] / contrib / unbound / testdata / root_zonemd.tdir / root_zonemd.test
1 # #-- root_zonemd.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
7 PRE="../.."
8 # do the test
9 echo "> dig www.example.com."
10 dig @localhost -p $UNBOUND_PORT . SOA | tee outfile
11 echo "> check answer"
12 if grep root-servers outfile | grep "nstld.verisign-grs.com"; then
13         echo "OK"
14 else
15         echo "Not OK"
16         exit 1
17 fi
18
19 echo "> unbound-control status"
20 $PRE/unbound-control -c ub.conf status
21 if test $? -ne 0; then
22         echo "wrong exit value."
23         exit 1
24 else
25         echo "exit value: OK"
26 fi
27
28 # This is the output when an unsupported algorithm is used.
29 if grep "auth zone . ZONEMD unsupported algorithm" unbound.log; then
30         echo "OK"
31 else
32         echo "ZONEMD verification not OK"
33         exit 1
34 fi
35
36 echo "> unbound-control auth_zone_reload ."
37 $PRE/unbound-control -c ub.conf auth_zone_reload . 2>&1 | tee outfile
38 if test $? -ne 0; then
39         echo "wrong exit value."
40         exit 1
41 fi
42 # The output of the reload can be checked.
43 #echo "> check unbound-control output"
44 #if grep "example.com: ZONEMD verification successful" outfile; then
45         #echo "OK"
46 #else
47         #echo "Not OK"
48         #exit 1
49 #fi
50
51 exit 0