-fix leaks
[oweals/gnunet.git] / src / gns / test_gnunet_gns.sh
1 #!/bin/bash
2
3 LOCATION=$(which gnunet-config)
4 if [ -z $LOCATION ]
5 then
6         echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX" 
7         exit 1
8 fi
9
10 trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
11 ME=`whoami`
12 if [ "$ME" != "root" ]
13 then
14   echo "This test only works if run as root.  Skipping."
15   exit 0
16 fi
17 export PATH=".:$PATH"
18 gnunet-service-gns -c gns.conf &
19 sleep 1
20 LO=`nslookup alice.gnu | grep Address | tail -n1`
21 if [ "$LO" != "Address: 1.2.3.4" ]
22 then
23  echo "Fail: $LO"
24 fi
25 LO=`nslookup www.bob.gnu | grep Address | tail -n1`
26 if [ "$LO" != "Address: 4.5.6.7" ]
27 then
28   echo "Fail: $LO"
29 fi
30 kill `jobs -p`