X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fnamestore%2Ftest_namestore_lookup.sh;h=90735b17e094fd0e67c624a9f98fa28807658f80;hb=c15e7951180d954ca584a95206543e8997b3a7d4;hp=da4724ebf66e9f634a7b35f8f59cd86f8a60af6f;hpb=e8873abb7cd92b5b71785a0e5a24de68fae40b21;p=oweals%2Fgnunet.git diff --git a/src/namestore/test_namestore_lookup.sh b/src/namestore/test_namestore_lookup.sh index da4724ebf..90735b17e 100755 --- a/src/namestore/test_namestore_lookup.sh +++ b/src/namestore/test_namestore_lookup.sh @@ -1,23 +1,28 @@ #!/bin/bash -CONFIGURATION="test_namestore_defaults.conf" +CONFIGURATION="test_namestore_api.conf" trap "gnunet-arm -e -c $CONFIGURATION" SIGINT -rm -rf `gnunet-config -c $CONFIGURATION -s PATHS -o SERVICEHOME` -TEST_DOMAIN_PLUS="www.gnu" -TEST_DOMAIN_DNS="www3.gnu" + +LOCATION=$(which gnunet-config) +if [ -z $LOCATION ] +then + LOCATION="gnunet-config" +fi +$LOCATION --version 1> /dev/null +if test $? != 0 +then + echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX" + exit 77 +fi + +rm -rf `$LOCATION -c $CONFIGURATION -s PATHS -o GNUNET_HOME` TEST_IP_PLUS="127.0.0.1" -TEST_IP_DNS="131.159.74.67" -TEST_RECORD_CNAME_SERVER="server" -TEST_RECORD_CNAME_PLUS="server.+" -TEST_RECORD_CNAME_DNS="gnunet.org" -TEST_RECORD_NAME_SERVER="server" -TEST_RECORD_NAME_PLUS="www" TEST_RECORD_NAME_DNS="www3" which timeout &> /dev/null && DO_TIMEOUT="timeout 5" function start_peer { gnunet-arm -s -c $CONFIGURATION - gnunet-identity -C testego -c $CONFIGURATION + gnunet-identity -C testego -c $CONFIGURATION } function stop_peer @@ -40,20 +45,22 @@ FOUND_NAME=false for LINE in $OUTPUT ; do if echo "$LINE" | grep -q "$TEST_RECORD_NAME_DNS"; then - FOUND_DNS=true; + FOUND_NAME=true; + #echo $FOUND_NAME fi if echo "$LINE" | grep -q "$TEST_IP_PLUS"; then FOUND_IP=true; - fi + #echo $FOUND_IP + fi done stop_peer -if [ $FOUND_DNS == true -a $FOUND_IP == true ] +if [ $FOUND_NAME == true -a $FOUND_IP == true ] then echo "PASS: Lookup name in namestore" exit 0 -elif [ $FOUND_DNS == false ] +elif [ $FOUND_NAME == false ] then echo "FAIL: Lookup name in namestore: name not returned" exit 1