2 trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
4 LOCATION=$(which gnunet-config)
7 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
11 rm -r `gnunet-config -c test_gns_lookup.conf -s PATHS -o GNUNET_HOME -f`
12 TEST_DOMAIN="homepage.gnu"
13 # some public DNS resolver we can use
14 TEST_IP_GNS2DNS="184.172.157.218"
15 TEST_RECORD_NAME="homepage"
16 TEST_RECORD_GNS2DNS="gnunet.org"
18 if ! nslookup $TEST_RECORD_GNS2DNS $TEST_IP_GNS2DNS &> /dev/null
20 echo "Cannot reach DNS, skipping test"
24 gnunet-arm -s -c test_gns_lookup.conf
25 gnunet-identity -C testego -c test_gns_lookup.conf
26 gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME -t GNS2DNS -V ${TEST_RECORD_GNS2DNS}@${TEST_IP_GNS2DNS} -e never -c test_gns_lookup.conf
27 RES_SOA=$(timeout 5 gnunet-gns --raw -z testego -u $TEST_DOMAIN -t SOA -c test_gns_lookup.conf)
28 gnunet-namestore -z testego -d -n $TEST_RECORD_NAME -t GNS2DNS -V ${TEST_RECORD_GNS2DNS}@${TEST_IP_GNS2DNS} -e never -c test_gns_lookup.conf &> /dev/null
29 gnunet-identity -D testego -c test_gns_lookup.conf
30 gnunet-arm -e -c test_gns_lookup.conf
32 if [ "x$RES_SOA" != "x" ]
34 echo "PASS: Resolved SOA for $TEST_DOMAIN to $RES_SOA."
37 echo "Failed to resolve to proper SOA for $TEST_DOMAIN, got no result."