summaryrefslogtreecommitdiffstats
path: root/src/tests/modules/unbound/dns.unlang
blob: d53e4337b79885b3378b2ea2375a628259d8752e (plain)
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
#  Use builtin "local" zone
update request {
	&Tmp-IP-Address-0 := "%{dns-a:localhost}"
}

if (&Tmp-IP-Address-0 != 127.0.0.1) {
	test_fail
}

update request {
	&Tmp-String-0 := "%{dns-aaaa:localhost}"
}

if (&Tmp-String-0 != "::1") {
	test_fail
}

update request {
	&Tmp-String-1 := "%{dns-ptr:1.0.0.127.in-addr.arpa}"
}

if (&Tmp-String-1 != "localhost") {
	test_fail
}

#  Use local data in module config to allow for dotted names
update request {
	&Tmp-IP-Address-0 := "%{dns-a:www.example.com}"
}

if (&Tmp-IP-Address-0 != 192.168.1.1) {
	test_fail
}

update request {
	&Tmp-String-0 := "%{dns-ptr:1.1.168.192.in-addr.arpa}"
}

if (&Tmp-String-0 != "www.example.com") {
	test_fail
}

# Try a real, known, network response
# Temporarily disabled while there is a bug in unbound
#update request {
#	&Tmp-String-0 := "%{dns-ptr:8.8.8.8.in-addr.arpa}"
#}

#if (&Tmp-String-0 != "dns.google") {
#	test_fail
#}

test_pass