2 trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
3 rm -r `gnunet-config -c test_gns_lookup.conf -s PATHS -o GNUNET_HOME -f`
4 which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
7 gnunet-arm -s -c test_gns_lookup.conf
8 gnunet-identity -C testego -c test_gns_lookup.conf
9 gnunet-namestore -p -z testego -a -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf
10 gnunet-namestore -p -z testego -a -n www -t AAAA -V $TEST_IP6 -e never -c test_gns_lookup.conf
11 RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.gnu -t A -c test_gns_lookup.conf`
12 RES_IP6=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.gnu -t AAAA -c test_gns_lookup.conf`
13 gnunet-namestore -z testego -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf
14 gnunet-namestore -z testego -d -n www -t AAAA -V $TEST_IP6 -e never -c test_gns_lookup.conf
15 gnunet-identity -D testego -c test_gns_lookup.conf
16 gnunet-arm -e -c test_gns_lookup.conf
18 if [ "$RES_IP6" == "$TEST_IP6" ]
20 echo "PASS: Resolved correct IPv6 address, got $RES_IP6"
22 echo "FAIL: Failed to resolve to proper IP, got $RES_IP6."
26 if [ "$RES_IP" == "$TEST_IP" ]
28 echo "PASS: Resolved correct IP address, got $RES_IP"
31 echo "FAIL: Failed to resolve to proper IP, got $RES_IP."