[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r29699 - gnunet/src/namestore
From: |
gnunet |
Subject: |
[GNUnet-SVN] r29699 - gnunet/src/namestore |
Date: |
Mon, 30 Sep 2013 11:07:43 +0200 |
Author: wachs
Date: 2013-09-30 11:07:43 +0200 (Mon, 30 Sep 2013)
New Revision: 29699
Added:
gnunet/src/namestore/test_namestore_lookup.sh
gnunet/src/namestore/test_namestore_put.sh
Modified:
gnunet/src/namestore/Makefile.am
Log:
new namestore CLI tests
Modified: gnunet/src/namestore/Makefile.am
===================================================================
--- gnunet/src/namestore/Makefile.am 2013-09-30 08:59:57 UTC (rev 29698)
+++ gnunet/src/namestore/Makefile.am 2013-09-30 09:07:43 UTC (rev 29699)
@@ -62,7 +62,9 @@
endif
if ENABLE_TEST_RUN
-TESTS = $(check_PROGRAMS)
+TESTS = \
+ $(check_PROGRAMS) \
+ $(check_SCRIPTS)
endif
lib_LTLIBRARIES = \
@@ -266,18 +268,6 @@
$(top_builddir)/src/util/libgnunetutil.la \
$(top_builddir)/src/namestore/libgnunetnamestore.la
-EXTRA_DIST = \
- test_namestore_api.conf \
- test_plugin_namestore_sqlite.conf \
- test_plugin_namestore_postgres.conf \
- test_hostkey \
- zonefiles/S5I9DSGQVAB5FVV16T3B3CC5H1B2JGL3Q412JBKURME8EKU0600G.zkey \
- zonefiles/AQ835GVL939H4O8QJQ7GBLPTQC0QAAO91BN7QK01BA63MDSK6I4G.zkey \
- zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey \
- zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey
-
-
-
test_plugin_namestore_sqlite_SOURCES = \
test_plugin_namestore.c
test_plugin_namestore_sqlite_LDADD = \
@@ -288,4 +278,21 @@
test_plugin_namestore.c
test_plugin_namestore_postgres_LDADD = \
$(top_builddir)/src/testing/libgnunettesting.la \
- $(top_builddir)/src/util/libgnunetutil.la
+ $(top_builddir)/src/util/libgnunetutil.la
+
+check_SCRIPTS = \
+ test_namestore_put.sh \
+ test_namestore_lookup.sh
+
+EXTRA_DIST = \
+ test_namestore_api.conf \
+ test_plugin_namestore_sqlite.conf \
+ test_plugin_namestore_postgres.conf \
+ test_namestore_defaults.conf \
+ test_hostkey \
+ zonefiles/S5I9DSGQVAB5FVV16T3B3CC5H1B2JGL3Q412JBKURME8EKU0600G.zkey \
+ zonefiles/AQ835GVL939H4O8QJQ7GBLPTQC0QAAO91BN7QK01BA63MDSK6I4G.zkey \
+ zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey \
+ zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey \
+ $(check_SCRIPTS)
+
Added: gnunet/src/namestore/test_namestore_lookup.sh
===================================================================
--- gnunet/src/namestore/test_namestore_lookup.sh
(rev 0)
+++ gnunet/src/namestore/test_namestore_lookup.sh 2013-09-30 09:07:43 UTC
(rev 29699)
@@ -0,0 +1,64 @@
+#!/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
+NAMESTORE_RES=$?
+# 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_DNS=true;
+ fi
+ if echo "$LINE" | grep -q "$TEST_IP_PLUS"; then
+ FOUND_IP=true;
+ fi
+ done
+stop_peer
+
+
+if [ $FOUND_DNS == true -a $FOUND_IP == true ]
+then
+ echo "PASS: Lookup name in namestore"
+ exit 0
+elif [ $FOUND_DNS == false ]
+then
+ echo "FAIL: Lookup name in namestore: name not returned"
+ exit 1
+elif [ $FOUND_IP == false ]
+then
+ echo "FAIL: Lookup name in namestore: IP not returned"
+ exit 1
+fi
Property changes on: gnunet/src/namestore/test_namestore_lookup.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: gnunet/src/namestore/test_namestore_put.sh
===================================================================
--- gnunet/src/namestore/test_namestore_put.sh (rev 0)
+++ gnunet/src/namestore/test_namestore_put.sh 2013-09-30 09:07:43 UTC (rev
29699)
@@ -0,0 +1,42 @@
+#!/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
+NAMESTORE_RES=$?
+stop_peer
+
+if [ $NAMESTORE_RES == 0 ]
+then
+ echo "PASS: Creating name in namestore"
+else
+ echo "FAIL: Creating name in namestore failed with $NAMESTORE_RES."
+ exit 1
+fi
Property changes on: gnunet/src/namestore/test_namestore_put.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r29699 - gnunet/src/namestore,
gnunet <=