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