2 CONFIGURATION="test_namestore_api.conf"
3 trap "gnunet-arm -e -c $CONFIGURATION" SIGINT
4 rm -rf `gnunet-config -c $CONFIGURATION -s PATHS -o SERVICEHOME`
5 TEST_IP_PLUS="127.0.0.1"
6 TEST_RECORD_NAME_DNS="www3"
7 which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
11 gnunet-arm -s -c $CONFIGURATION
12 gnunet-identity -C testego -c $CONFIGURATION
17 gnunet-identity -D testego -c $CONFIGURATION
18 gnunet-arm -e -c $CONFIGURATION
23 # Create a public record
24 gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_DNS -t A -V $TEST_IP_PLUS -e never -c $CONFIGURATION
26 # Lookup specific name
27 OUTPUT=`gnunet-namestore -p -z testego -n $TEST_RECORD_NAME_DNS -D`
34 if echo "$LINE" | grep -q "$TEST_RECORD_NAME_DNS"; then
38 if echo "$LINE" | grep -q "$TEST_IP_PLUS"; then
46 if [ $FOUND_NAME == true -a $FOUND_IP == true ]
48 echo "PASS: Lookup name in namestore"
50 elif [ $FOUND_NAME == false ]
52 echo "FAIL: Lookup name in namestore: name not returned"
54 elif [ $FOUND_IP == false ]
56 echo "FAIL: Lookup name in namestore: IP not returned"