2 CONFIGURATION="test_namestore_api.conf"
3 trap "gnunet-arm -e -c $CONFIGURATION" SIGINT
5 LOCATION=$(which gnunet-config)
8 LOCATION="gnunet-config"
10 $LOCATION --version 1> /dev/null
13 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
17 rm -rf `$LOCATION -c $CONFIGURATION -s PATHS -o GNUNET_HOME`
18 TEST_IP_PLUS="127.0.0.1"
19 TEST_RECORD_NAME_DNS="www3"
20 which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
24 gnunet-arm -s -c $CONFIGURATION
25 gnunet-identity -C testego -c $CONFIGURATION
30 gnunet-identity -D testego -c $CONFIGURATION
31 gnunet-arm -e -c $CONFIGURATION
36 # Create a public record
37 gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_DNS -t A -V $TEST_IP_PLUS -e never -c $CONFIGURATION
39 # Lookup specific name
40 OUTPUT=`gnunet-namestore -p -z testego -n $TEST_RECORD_NAME_DNS -D`
47 if echo "$LINE" | grep -q "$TEST_RECORD_NAME_DNS"; then
51 if echo "$LINE" | grep -q "$TEST_IP_PLUS"; then
59 if [ $FOUND_NAME == true -a $FOUND_IP == true ]
61 echo "PASS: Lookup name in namestore"
63 elif [ $FOUND_NAME == false ]
65 echo "FAIL: Lookup name in namestore: name not returned"
67 elif [ $FOUND_IP == false ]
69 echo "FAIL: Lookup name in namestore: IP not returned"