clean up test after execution
[oweals/gnunet.git] / src / gns / test_gns_cname_lookup.sh
index 1a4c10268651d80c86ac5f8cc694ce2a734aaf63..00614f0382975e70fa41df84c8215120bb072cbe 100755 (executable)
@@ -4,11 +4,17 @@ trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
 LOCATION=$(which gnunet-config)
 if [ -z $LOCATION ]
 then
-       echo "GNUnet command line tools cannot be found, check environmental variables PATH and GNUNET_PREFIX" 
-       exit 1
+  LOCATION="gnunet-config"
 fi
+$LOCATION --version &> /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 /tmp/test-gnunet-gns-peer-1/
 
-rm -rf `gnunet-config -c test_gns_lookup.conf -s PATHS -o GNUNET_HOME -f`
 TEST_DOMAIN_PLUS="www.gnu"
 TEST_DOMAIN_DNS="www3.gnu"
 TEST_IP_PLUS="127.0.0.1"
@@ -35,6 +41,7 @@ gnunet-namestore -p -z testego -d -n $TEST_RECORD_NAME_PLUS -t CNAME -V $TEST_RE
 gnunet-namestore -p -z testego -d -n $TEST_RECORD_CNAME_SERVER -t A -V $TEST_IP_PLUS -e never -c test_gns_lookup.conf
 gnunet-identity -D testego -c test_gns_lookup.conf
 gnunet-arm -e -c test_gns_lookup.conf
+rm -rf /tmp/test-gnunet-gns-peer-1/
 
 if [ "$RES_CNAME_RAW" == "server.$TESTEGOZONE.zkey" ]
 then