gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r29700 - gnunet/src/namestore


From: gnunet
Subject: [GNUnet-SVN] r29700 - gnunet/src/namestore
Date: Mon, 30 Sep 2013 11:16:25 +0200

Author: wachs
Date: 2013-09-30 11:16:25 +0200 (Mon, 30 Sep 2013)
New Revision: 29700

Added:
   gnunet/src/namestore/test_namestore_delete.sh
Modified:
   gnunet/src/namestore/Makefile.am
   gnunet/src/namestore/test_namestore_lookup.sh
Log:
next test


Modified: gnunet/src/namestore/Makefile.am
===================================================================
--- gnunet/src/namestore/Makefile.am    2013-09-30 09:07:43 UTC (rev 29699)
+++ gnunet/src/namestore/Makefile.am    2013-09-30 09:16:25 UTC (rev 29700)
@@ -282,7 +282,8 @@
  
 check_SCRIPTS = \
        test_namestore_put.sh \
-       test_namestore_lookup.sh
+       test_namestore_lookup.sh \
+       test_namestore_delete.sh 
 
 EXTRA_DIST = \
   test_namestore_api.conf \

Added: gnunet/src/namestore/test_namestore_delete.sh
===================================================================
--- gnunet/src/namestore/test_namestore_delete.sh                               
(rev 0)
+++ gnunet/src/namestore/test_namestore_delete.sh       2013-09-30 09:16:25 UTC 
(rev 29700)
@@ -0,0 +1,63 @@
+#!/bin/bash
+CONFIGURATION="test_namestore_defaults.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"
+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    
+}
+
+function stop_peer
+{
+       gnunet-identity -D testego -c $CONFIGURATION
+       gnunet-arm -e -c $CONFIGURATION
+}
+
+
+start_peer
+# Create a public record
+gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_DNS -t A -V 
$TEST_IP_PLUS -e never -c $CONFIGURATION
+# Delete record
+gnunet-namestore -p -z testego -d -n $TEST_RECORD_NAME_DNS -t A -V 
$TEST_IP_PLUS -e never -c $CONFIGURATION
+# Lookup specific name
+OUTPUT=`gnunet-namestore -p -z testego -n $TEST_RECORD_NAME_DNS -D`
+FOUND_IP=false
+FOUND_NAME=false
+for LINE in $OUTPUT ;
+ do
+       if echo "$LINE" | grep -q "$TEST_RECORD_NAME_DNS"; then
+               FOUND_NAME=true;
+       fi
+       if echo "$LINE" | grep -q "$TEST_IP_PLUS"; then
+               FOUND_IP=true;
+       fi      
+ done
+stop_peer
+
+
+if [ $FOUND_NAME == false -a $FOUND_IP != false ]
+then
+  echo "PASS: Delete name in namestore"
+  exit 0
+elif [ $FOUND_NAME == true ]
+then
+  echo "FAIL: Delete name in namestore: name returned"
+  exit 1
+elif [ $FOUND_IP == true ]
+then
+  echo "FAIL: Delete name in namestore: IP returned"
+  exit 1
+fi


Property changes on: gnunet/src/namestore/test_namestore_delete.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: gnunet/src/namestore/test_namestore_lookup.sh
===================================================================
--- gnunet/src/namestore/test_namestore_lookup.sh       2013-09-30 09:07:43 UTC 
(rev 29699)
+++ gnunet/src/namestore/test_namestore_lookup.sh       2013-09-30 09:16:25 UTC 
(rev 29700)
@@ -40,20 +40,22 @@
 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;
+               #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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]