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 ! iptables -t mangle --list &> /dev/null
31 echo "This test requires iptables with 'mangle' support. Skipping."
36 gnunet-service-dns -c dns.conf &
37 gnunet-dns-redirector -c dns.conf -4 127.0.0.1 &
39 # need to run 'nslookup' as 'nobody', as gnunet-service-dns runs as root
40 # and thus 'root' is excepted from DNS interception!
41 LO=`sudo -u nobody nslookup gnunet.org | grep Address | tail -n1`
42 if [ "$LO" != "Address: 127.0.0.1" ]
44 echo "Fail: got address $LO, wanted 127.0.0.1"
47 echo "Test run, with success."