6 echo "This test only works if run as root. Skipping."
9 if ! which sudo > /dev/null
11 echo "This test requires sudo. Skipping."
14 if [ ! -x `which sudo` ]
16 echo "This test requires sudo. Skipping."
19 if ! which nslookup > /dev/null
21 echo "This test requires nslookup. Skipping."
24 if [ ! -x `which nslookup` ]
26 echo "This test requires nslookup. Skipping."
29 if [ ! -x `which iptables` ]
31 echo "This test requires iptables. Skipping."
34 if ! iptables -t mangle --list > /dev/null 2>&1
36 echo "This test requires iptables with 'mangle' support. Skipping."
39 if grep % /etc/resolv.conf > /dev/null 2>&1
41 echo "This system seems to use a DNS server on an IPv6 link-local address, which is not supported. Skipping."
46 gnunet-service-dns -c dns.conf &
47 gnunet-dns-redirector -c dns.conf -4 127.0.0.1 &
49 # need to run 'nslookup' as 'nobody', as gnunet-service-dns runs as root
50 # and thus 'root' is excepted from DNS interception!
51 LO=`sudo -u nobody nslookup -type=A gnunet.org | grep Address | tail -n1`
52 if [ "$LO" != "Address: 127.0.0.1" ]
54 echo "Fail: got address $LO, wanted 127.0.0.1"
57 echo "Test run, with success."
60 # TODO: jobs is a possible bashism. Fix.