gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r19886 - gnunet/src/namestore
Date: Tue, 21 Feb 2012 12:05:50 +0100

Author: wachs
Date: 2012-02-21 12:05:50 +0100 (Tue, 21 Feb 2012)
New Revision: 19886

Added:
   gnunet/src/namestore/test_namestore_api.c
   gnunet/src/namestore/test_namestore_api.conf
Modified:
   gnunet/src/namestore/Makefile.am
   gnunet/src/namestore/gnunet-service-namestore.c
Log:
- adding namestore api test


Modified: gnunet/src/namestore/Makefile.am
===================================================================
--- gnunet/src/namestore/Makefile.am    2012-02-21 10:57:01 UTC (rev 19885)
+++ gnunet/src/namestore/Makefile.am    2012-02-21 11:05:50 UTC (rev 19886)
@@ -17,30 +17,32 @@
 endif
 
 
-#lib_LTLIBRARIES = \
-#  libgnunetnamestore.la
-#
-#libgnunetnamestore_la_SOURCES = \
-#  namestore_api.c namestore.h 
-#libgnunetnamestore_la_LIBADD = \
-#  $(top_builddir)/src/statistics/libgnunetstatistics.la \
-#  $(top_builddir)/src/util/libgnunetutil.la \
-#  $(GN_LIBINTL) 
-#libgnunetnamestore_la_LDFLAGS = \
-#  $(GN_LIB_LDFLAGS) $(WINFLAGS) \
-#  -version-info 0:0:0
-#
+check_PROGRAMS = \
+ test_namestore_api
 
-#bin_PROGRAMS = \
-# gnunet-service-namestore
-#
-#gnunet_service_namestore_SOURCES = \
-# gnunet-service-namestore.c 
-#gnunet_service_namestore_LDADD = \
-#  $(top_builddir)/src/statistics/libgnunetstatistics.la \
-#  $(top_builddir)/src/util/libgnunetutil.la \
-#  $(GN_LIBINTL)
+lib_LTLIBRARIES = \
+  libgnunetnamestore.la
 
+libgnunetnamestore_la_SOURCES = \
+  namestore_api.c namestore.h 
+libgnunetnamestore_la_LIBADD = \
+  $(top_builddir)/src/statistics/libgnunetstatistics.la \
+  $(top_builddir)/src/util/libgnunetutil.la \
+  $(GN_LIBINTL) 
+libgnunetnamestore_la_LDFLAGS = \
+  $(GN_LIB_LDFLAGS) $(WINFLAGS) \
+  -version-info 0:0:0
+
+bin_PROGRAMS = \
+ gnunet-service-namestore
+
+gnunet_service_namestore_SOURCES = \
+ gnunet-service-namestore.c 
+gnunet_service_namestore_LDADD = \
+  $(top_builddir)/src/statistics/libgnunetstatistics.la \
+  $(top_builddir)/src/util/libgnunetutil.la \
+  $(GN_LIBINTL)
+
 if HAVE_SQLITE
  SQLITE_PLUGIN = libgnunet_plugin_namestore_sqlite.la
 endif
@@ -56,3 +58,14 @@
 libgnunet_plugin_namestore_sqlite_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS)
 
+
+test_namestore_api_SOURCES = \
+ test_namestore_api.c
+test_namestore_api_LDADD = \
+  $(top_builddir)/src/util/libgnunetutil.la \
+  $(top_builddir)/src/namestore/libgnunetnamestore.la
+
+EXTRADIST = \
+  test_namestore_api.conf
+
+ 
\ No newline at end of file

Modified: gnunet/src/namestore/gnunet-service-namestore.c
===================================================================
--- gnunet/src/namestore/gnunet-service-namestore.c     2012-02-21 10:57:01 UTC 
(rev 19885)
+++ gnunet/src/namestore/gnunet-service-namestore.c     2012-02-21 11:05:50 UTC 
(rev 19886)
@@ -28,6 +28,7 @@
 #include "gnunet_service_lib.h"
 #include "gnunet_namestore_service.h"
 
+
 /**
  * Task run during shutdown.
  *
@@ -56,7 +57,7 @@
     /* FIXME: add handlers here! */
     {NULL, NULL, 0, 0}
   };
-  /* FIXME: do setup here */
+
   GNUNET_SERVER_add_handlers (server, handlers);
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup_task,
                                 NULL);

Added: gnunet/src/namestore/test_namestore_api.c
===================================================================
--- gnunet/src/namestore/test_namestore_api.c                           (rev 0)
+++ gnunet/src/namestore/test_namestore_api.c   2012-02-21 11:05:50 UTC (rev 
19886)
@@ -0,0 +1,72 @@
+/*
+     This file is part of GNUnet.
+     (C) 2009 Christian Grothoff (and other contributing authors)
+
+     GNUnet is free software; you can redistribute it and/or modify
+     it under the terms of the GNU General Public License as published
+     by the Free Software Foundation; either version 3, or (at your
+     option) any later version.
+
+     GNUnet is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+/**
+ * @file namestore/test_namestore_api.c
+ * @brief testcase for namestore_api.c
+ */
+#include "platform.h"
+#include "gnunet_common.h"
+#include "gnunet_namestore_service.h"
+
+#define VERBOSE GNUNET_EXTRA_LOGGING
+
+static int res;
+
+static void
+run (void *cls, char *const *args, const char *cfgfile,
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
+{
+
+  res = 0;
+}
+
+static int
+check ()
+{
+  static char *const argv[] = { "test-namestore-api",
+    "-c",
+    "test_namestore_api.conf",
+#if VERBOSE
+    "-L", "DEBUG",
+#endif
+    NULL
+  };
+  static struct GNUNET_GETOPT_CommandLineOption options[] = {
+    GNUNET_GETOPT_OPTION_END
+  };
+
+  res = 1;
+  GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, 
"test-namestore-api",
+                      "nohelp", options, &run, &res);
+  return res;
+}
+
+int
+main (int argc, char *argv[])
+{
+  int ret;
+
+
+  ret = check ();
+
+  return ret;
+}
+
+/* end of test_namestore_api.c */

Added: gnunet/src/namestore/test_namestore_api.conf
===================================================================
--- gnunet/src/namestore/test_namestore_api.conf                                
(rev 0)
+++ gnunet/src/namestore/test_namestore_api.conf        2012-02-21 11:05:50 UTC 
(rev 19886)
@@ -0,0 +1,30 @@
+[namestore]
+AUTOSTART = YES
+UNIXPATH = /tmp/gnunet-service-namestore.sock
+UNIX_MATCH_UID = YES
+UNIX_MATCH_GID = YES
+# PORT = 2099
+HOSTNAME = localhost
+HOME = $SERVICEHOME
+CONFIG = $DEFAULTCONFIG
+BINARY = gnunet-service-namestore
+ACCEPT_FROM = 127.0.0.1;
+ACCEPT_FROM6 = ::1;
+DATABASE = sqlite
+
+[namestore-sqlite]
+FILENAME = $SERVICEHOME/namestore/sqlite.db
+
+[namestore-postgres]
+CONFIG = connect_timeout=10; dbname=gnunet
+
+[namestore-mysql]
+DATABASE = gnunet
+CONFIG = ~/.my.cnf
+# USER = gnunet
+# PASSWORD = 
+# HOST = localhost
+# PORT = 3306
+
+
+




reply via email to

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