~ubuntu-branches/ubuntu/wily/maradns/wily-proposed

« back to all changes in this revision

Viewing changes to deadwood-3.2.07/sqa/dwood2rc_s_ip_blacklist/do.test

  • Committer: Package Import Robot
  • Author(s): Dariusz Dwornikowski, Tomasz Buchert, Dariusz Dwornikowski
  • Date: 2015-03-27 18:34:08 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20150327183408-wnfachdkdjt96yu6
Tags: 2.0.11-1
[ Tomasz Buchert ]
* Imported Upstream version 2.0.11

[ Dariusz Dwornikowski ]
* d/patches: 
  - refreshed all patches for new deadwood version
  - removed generating of random prime on build (Closes: #785536) 
* d/rules: date taken from changelog (Closes: #785535)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# Give localhost the fd4d:6172:6144:4e53::1 + fd4d:6172:6144:4e53::2 addresses;
 
4
# addresses come from RFC4193
 
5
ifconfig lo add fd4d:6172:6144:4e53::1
 
6
ifconfig lo add fd4d:6172:6144:4e53::2
 
7
sleep 2
 
8
 
 
9
# This is a basic Deadwood test to make sure it works
 
10
 
 
11
killall maradns > /dev/null 2>&1 # Don't run this test on Solaris
 
12
sleep 2
 
13
 
 
14
cat > mararc-IPv6 << EOF
 
15
chroot_dir="$( pwd )"
 
16
ipv4_bind_addresses="127.0.0.2"
 
17
ipv6_bind_address="fd4d:6172:6144:4e53::2"
 
18
csv2 = {}
 
19
csv2["example.com."] = "db.example.com"
 
20
EOF
 
21
 
 
22
 
 
23
cat > db.example.com << EOF
 
24
www.% A 10.1.2.3
 
25
black4.% A 10.222.33.44
 
26
black6.% AAAA fd4d:6172:6144:4e53::3
 
27
good.% AAAA fd4d:6172:6144:4e53::2
 
28
EOF
 
29
 
 
30
# OK, test the server
 
31
../../../server/maradns -f mararc-IPv6 > /dev/null 2>&1 &
 
32
#../../../server/maradns -f mararc-IPv6 &
 
33
sleep 1
 
34
 
 
35
# Now, make sure Deadwood's ip_blacklist works
 
36
 
 
37
for BLACKLIST in 10.222.33.44 fd4d:6172:6144:4e53::3 ; do
 
38
 
 
39
cat > dwood2rc << EOF
 
40
chroot_dir="$( pwd )"
 
41
bind_address="fd4d:6172:6144:4e53::1"
 
42
upstream_servers = {}
 
43
upstream_servers["."]="fd4d:6172:6144:4e53::2"
 
44
recursive_acl="::1/128, fd4d:6172:6144:4e53::0/32"
 
45
ip_blacklist="${BLACKLIST}"
 
46
filter_rfc1918 = 0
 
47
EOF
 
48
 
 
49
../../src/Deadwood -f dwood2rc | grep -v version | sed 's/forwarder/cache/' &
 
50
sleep 3
 
51
 
 
52
echo Blacklist: ${BLACKLIST}
 
53
 
 
54
echo
 
55
dig @fd4d:6172:6144:4e53::1 www.example.com A | \
 
56
        grep -v DiG | grep -v WHEN | grep -v time | \
 
57
        grep -v 'recursion requested but not available' | \
 
58
        grep -v HEADER | grep -v 'global options' | awk '
 
59
                /example.com/ {gsub(/86[0-9][0-9][0-9]/,"")} {print}'
 
60
echo
 
61
dig @fd4d:6172:6144:4e53::1 black4.example.com A | \
 
62
        grep -v DiG | grep -v WHEN | grep -v time | \
 
63
        grep -v 'recursion requested but not available' | \
 
64
        grep -v HEADER | grep -v 'global options' | awk '
 
65
                /example.com/ {gsub(/86[0-9][0-9][0-9]/,"")} {print}'
 
66
echo
 
67
dig @fd4d:6172:6144:4e53::1 black6.example.com AAAA | \
 
68
        grep -v DiG | grep -v WHEN | grep -v time | \
 
69
        grep -v 'recursion requested but not available' | \
 
70
        grep -v HEADER | grep -v 'global options' | awk '
 
71
                /example.com/ {gsub(/86[0-9][0-9][0-9]/,"")} {print}'
 
72
echo
 
73
dig @fd4d:6172:6144:4e53::1 good.example.com AAAA | \
 
74
        grep -v DiG | grep -v WHEN | grep -v time | \
 
75
        grep -v 'recursion requested but not available' | \
 
76
        grep -v HEADER | grep -v 'global options' | awk '
 
77
                /example.com/ {gsub(/86[0-9][0-9][0-9]/,"")} {print}'
 
78
echo
 
79
 
 
80
killall Deadwood
 
81
sleep 2
 
82
 
 
83
done
 
84
 
 
85
killall maradns.authonly
 
86
rm mararc-*
 
87
rm db.example.com
 
88
rm dwood2rc
 
89
ifconfig lo del fd4d:6172:6144:4e53::1
 
90
ifconfig lo del fd4d:6172:6144:4e53::2