aboutsummaryrefslogtreecommitdiff
path: root/src/dns/test_gnunet_dns.sh
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2023-10-19 09:03:33 +0200
committerMartin Schanzenbach <schanzen@gnunet.org>2023-10-19 09:03:33 +0200
commit7f72b05249f6ac663cee7a033f3cac5d9400ede7 (patch)
treed15cec717aa9568adc1876ec1b717cf18596e1f6 /src/dns/test_gnunet_dns.sh
parent5ae8ee063302cc6c1fc7b74328af46a11cb02cdc (diff)
downloadgnunet-7f72b05249f6ac663cee7a033f3cac5d9400ede7.tar.gz
gnunet-7f72b05249f6ac663cee7a033f3cac5d9400ede7.zip
BUILD: Move regex/dns to service
Diffstat (limited to 'src/dns/test_gnunet_dns.sh')
-rwxr-xr-xsrc/dns/test_gnunet_dns.sh68
1 files changed, 0 insertions, 68 deletions
diff --git a/src/dns/test_gnunet_dns.sh b/src/dns/test_gnunet_dns.sh
deleted file mode 100755
index e0fcb711d..000000000
--- a/src/dns/test_gnunet_dns.sh
+++ /dev/null
@@ -1,68 +0,0 @@
1#!/bin/sh
2
3ME=`whoami`
4if [ "$ME" != "root" ]
5then
6 echo "This test only works if run as root. Skipping."
7 exit 77
8fi
9if ! which sudo > /dev/null
10then
11 echo "This test requires sudo. Skipping."
12 exit 77
13fi
14if [ ! -x `which sudo` ]
15then
16 echo "This test requires sudo. Skipping."
17 exit 77
18fi
19if ! which nslookup > /dev/null
20then
21 echo "This test requires nslookup. Skipping."
22 exit 77
23fi
24if [ ! -x `which nslookup` ]
25then
26 echo "This test requires nslookup. Skipping."
27 exit 77
28fi
29if [ ! -x `which iptables` ]
30then
31 echo "This test requires iptables. Skipping."
32 exit 77
33fi
34if ! iptables -t mangle --list > /dev/null 2>&1
35then
36 echo "This test requires iptables with 'mangle' support. Skipping."
37 exit 77
38fi
39if grep % /etc/resolv.conf > /dev/null 2>&1
40then
41 echo "This system seems to use a DNS server on an IPv6 link-local address, which is not supported. Skipping."
42 exit 77
43fi
44
45if test ! `id nobody`;
46then
47 echo "This tests requires a user account 'nobody'. Skipping."
48 exit 77
49fi
50
51export PATH=".:$PATH"
52gnunet-service-dns -c dns.conf &
53gnunet-dns-redirector -c dns.conf -4 127.0.0.1 &
54sleep 1
55# need to run 'nslookup' as 'nobody', as gnunet-service-dns runs as root
56# and thus 'root' is excepted from DNS interception!
57LO=`sudo -u nobody nslookup -type=A gnunet.org | grep Address | tail -n1`
58if [ "$LO" != "Address: 127.0.0.1" ]
59then
60 echo "Fail: got address $LO, wanted 127.0.0.1"
61 ret=1
62else
63 echo "Test run, with success."
64 ret=0
65fi
66# TODO: jobs is a possible bashism. Fix.
67kill `jobs -p`
68exit $ret