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_DOMAIN_PLUS="www.gnu"
19 TEST_DOMAIN_DNS="www3.gnu"
20 TEST_IP_PLUS="127.0.0.1"
21 TEST_IP_DNS="131.159.74.67"
22 TEST_RECORD_CNAME_SERVER="server"
23 TEST_RECORD_CNAME_PLUS="server.+"
24 TEST_RECORD_CNAME_DNS="gnunet.org"
25 TEST_RECORD_NAME_SERVER="server"
26 TEST_RECORD_NAME_PLUS="www"
27 TEST_RECORD_NAME_DNS="www3"
28 which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
32 gnunet-arm -s -c $CONFIGURATION
33 gnunet-identity -C testego -c $CONFIGURATION
38 gnunet-identity -D testego -c $CONFIGURATION
39 gnunet-arm -e -c $CONFIGURATION
44 # Create a public record
45 gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_DNS -t A -V $TEST_IP_PLUS -e never -c $CONFIGURATION
47 gnunet-namestore -p -z testego -d -n $TEST_RECORD_NAME_DNS -t A -V $TEST_IP_PLUS -e never -c $CONFIGURATION
49 OUTPUT=`gnunet-namestore -p -z testego -D`
54 if echo "$LINE" | grep -q "$TEST_RECORD_NAME_DNS"; then
57 if echo "$LINE" | grep -q "$TEST_IP_PLUS"; then
64 if [ $FOUND_NAME == false -a $FOUND_IP != false ]
66 echo "PASS: Delete name in namestore"
68 elif [ $FOUND_NAME == true ]
70 echo "FAIL: Delete name in namestore: name returned"
72 elif [ $FOUND_IP == true ]
74 echo "FAIL: Delete name in namestore: IP returned"