aboutsummaryrefslogtreecommitdiff
path: root/testdata/local_nodefault.tdir/local_nodefault.test
blob: 9bca122610f5a15740307d920c6e35a3f8130d3e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# #-- local_nodefault.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

PRE="../.."

# this one should have NXDOMAIN builtin
#
echo "> dig 1.0.31.172.in-addr.arpa."
dig @127.0.0.1 -p $UNBOUND_PORT 1.0.31.172.in-addr.arpa. | tee outfile
echo "> cat logfiles"
cat fwd.log 
cat unbound.log
echo "> check answer"
if grep "NXDOMAIN" outfile; then
	echo "OK for a blocked by default zone"
else
	echo "Not OK"
	exit 1
fi

# this one should give our own data as the reply
echo "> dig 1.0.30.172.in-addr.arpa."
dig @127.0.0.1 -p $UNBOUND_PORT 1.0.30.172.in-addr.arpa. | tee outfile
echo "> cat logfiles"
cat fwd.log 
cat unbound.log
echo "> check answer"
if grep "10.20.30.40" outfile; then
	echo "OK for nodefault zone"
else
	echo "Not OK"
	exit 1
fi

# this one should give our own data as the reply
# but different trailing dot in unbound.conf file
echo "> dig 1.0.29.172.in-addr.arpa."
dig @127.0.0.1 -p $UNBOUND_PORT 1.0.29.172.in-addr.arpa. | tee outfile
echo "> cat logfiles"
cat fwd.log 
cat unbound.log
echo "> check answer"
if grep "10.20.30.42" outfile; then
	echo "OK for nodefault zone"
else
	echo "Not OK"
	exit 1
fi

exit 0