2 # This file is in the public domain.
3 trap "gnunet-arm -e -c test_dns2gns.conf" INT
4 which timeout > /dev/null 2>&1 && DO_TIMEOUT="timeout 30"
6 LOCATION=$(which gnunet-config)
9 LOCATION="gnunet-config"
11 $LOCATION --version 1> /dev/null
14 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
18 rm -rf `gnunet-config -c test_dns2gns.conf -f -s paths -o GNUNET_TEST_HOME`
21 TEST_IPV6="dead::beef"
23 TEST_DOMAIN="gnunet.org"
25 gnunet-arm -s -c test_dns2gns.conf
26 PKEY=`gnunet-identity -V -C $MY_EGO -c test_dns2gns.conf`
27 gnunet-namestore -p -z $MY_EGO -a -n $LABEL -t A -V $TEST_IP -e 3600s -c test_dns2gns.conf
28 gnunet-namestore -p -z $MY_EGO -a -n $LABEL -t AAAA -V $TEST_IPV6 -e 3600s -c test_dns2gns.conf
30 # FIXME resolution works but always returns all available records
31 # also, the records seem to be returned twice if using GNS
33 if nslookup -port=12000 $LABEL.$PKEY localhost && nslookup -port=12000 $LABEL.$MY_EGO localhost; then
34 echo "PASS: GNS records can be resolved using dns2gns bridge"
36 echo "FAIL: GNS records can't be resolved using dns2gns bridge"
37 rm -rf `gnunet-config -c test_dns2gns.conf -f -s paths -o GNUNET_TEST_HOME`
41 if nslookup -port=12000 gnunet.org localhost; then
42 echo "PASS: DNS records can be resolved using dns2gns bridge"
44 echo "FAIL: DNS records can't be resolved using dns2gns bridge"
45 rm -rf `gnunet-config -c test_dns2gns.conf -f -s paths -o GNUNET_TEST_HOME`
48 gnunet-arm -e -c test_dns2gns.conf
50 rm -rf `gnunet-config -c test_dns2gns.conf -f -s paths -o GNUNET_TEST_HOME`