- Act malicious API complete
[oweals/gnunet.git] / src / dht / test_dht_tools.sh
index 9613cbf542882b4fd36f45de9c897ac69b64318f..f83c26a1a615272be4f19e7fa920e3fc28e9532a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-out=`mktemp /tmp/test-gnunet-arm-logXXXXXXXX`
+out=`mktemp /tmp/test-gnunet-dht-logXXXXXXXX`
 tempcfg=`mktemp /tmp/test_dht_api_peer1.XXXXXXXX`
 checkout="check.out"
 armexe="gnunet-arm -c $tempcfg "
@@ -13,8 +13,10 @@ stop_arm()
     echo "FAIL: error running $armexe"
     echo "Command output was:"
     cat $out
+    rm -f $out $tempcfg
     exit 1
   fi
+  rm -f $out $tempcfg
 }
 
 cp test_dht_api_peer1.conf $tempcfg
@@ -40,7 +42,7 @@ echo "PASS"
 sleep 1
 
 echo -n "TEST: Testing put..."
-if ! $putexe -k testkey -d testdata > $out ; then
+if ! $putexe -k testkey -d testdata -t 8 > $out ; then
   echo "FAIL: error running $putexe"
   echo "Command output was:"
   cat $out
@@ -51,21 +53,21 @@ echo "PASS"
 sleep 1
 
 echo -n "TEST: Testing get..."
-echo "Result 0, type 0:" > $checkout
+echo "Result 0, type 8:" > $checkout
 echo "testdata" >> $checkout
 
-if ! $getexe -k testkey -T 1 > $out ; then
+if ! $getexe -k testkey -T 5 -t 8 > $out ; then
   echo "FAIL: error running $putexe"
   echo "Command output was:"
   cat $out
   stop_arm
   exit 1
 fi
-if ! diff -q $out $checkout ; then
+
+if ! diff --strip-trailing-cr -q $out $checkout ; then
   echo "FAIL: $out and $checkout differ"
   stop_arm
   exit 1
 fi
 echo "PASS"
-
 stop_arm