2 CONFIGURATION="test_namestore_api.conf"
3 trap "gnunet-arm -e -c $CONFIGURATION" SIGINT
5 LOCATION=$(which gnunet-config)
8 echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX"
12 rm -rf `gnunet-config -c $CONFIGURATION -s PATHS -o GNUNET_HOME`
13 TEST_DOMAIN_PLUS="www.gnu"
14 TEST_DOMAIN_DNS="www3.gnu"
15 TEST_IP_PLUS="127.0.0.1"
16 TEST_IP_DNS="131.159.74.67"
17 TEST_RECORD_CNAME_SERVER="server"
18 TEST_RECORD_CNAME_PLUS="server.+"
19 TEST_RECORD_CNAME_DNS="gnunet.org"
20 TEST_RECORD_NAME_SERVER="server"
21 TEST_RECORD_NAME_PLUS="www"
22 TEST_RECORD_NAME_DNS="www3"
23 which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
27 gnunet-arm -s -c $CONFIGURATION
28 gnunet-identity -C testego -c $CONFIGURATION
33 gnunet-identity -D testego -c $CONFIGURATION
34 gnunet-arm -e -c $CONFIGURATION
39 # Create a public record
40 gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_DNS -t A -V $TEST_IP_PLUS -e never -c $CONFIGURATION
42 gnunet-namestore -p -z testego -d -n $TEST_RECORD_NAME_DNS -t A -V $TEST_IP_PLUS -e never -c $CONFIGURATION
44 OUTPUT=`gnunet-namestore -p -z testego -D`
49 if echo "$LINE" | grep -q "$TEST_RECORD_NAME_DNS"; then
52 if echo "$LINE" | grep -q "$TEST_IP_PLUS"; then
59 if [ $FOUND_NAME == false -a $FOUND_IP != false ]
61 echo "PASS: Delete name in namestore"
63 elif [ $FOUND_NAME == true ]
65 echo "FAIL: Delete name in namestore: name returned"
67 elif [ $FOUND_IP == true ]
69 echo "FAIL: Delete name in namestore: IP returned"