gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r3408 - in GNUnet: . src/applications/fs/ecrs src/applicati


From: grothoff
Subject: [GNUnet-SVN] r3408 - in GNUnet: . src/applications/fs/ecrs src/applications/fs/namespace src/include
Date: Mon, 18 Sep 2006 22:10:36 -0700 (PDT)

Author: grothoff
Date: 2006-09-18 22:10:30 -0700 (Mon, 18 Sep 2006)
New Revision: 3408

Added:
   GNUnet/src/applications/fs/namespace/check.conf
   GNUnet/src/applications/fs/namespace/peer.conf
Modified:
   GNUnet/src/applications/fs/ecrs/peer.conf
   GNUnet/src/applications/fs/namespace/Makefile.am
   GNUnet/src/applications/fs/namespace/namespace_info.c
   GNUnet/src/applications/fs/namespace/namespace_infotest.c
   GNUnet/src/include/gnunet_namespace_lib.h
   GNUnet/todo
Log:
fixing namespace testcase

Modified: GNUnet/src/applications/fs/ecrs/peer.conf
===================================================================
--- GNUnet/src/applications/fs/ecrs/peer.conf   2006-09-16 18:36:37 UTC (rev 
3407)
+++ GNUnet/src/applications/fs/ecrs/peer.conf   2006-09-19 05:10:30 UTC (rev 
3408)
@@ -1,6 +1,8 @@
 # This is the configuration for the GNUnet daemon when running
 # the test in this directory (make check).
 
+GNUNETD_HOME     = /tmp/gnunet-check-ecrs
+
 [GNUNETD]
 GNUNETD_HOME     = /tmp/gnunet-check-ecrs
 # VALGRIND        = 300

Modified: GNUnet/src/applications/fs/namespace/Makefile.am
===================================================================
--- GNUnet/src/applications/fs/namespace/Makefile.am    2006-09-16 18:36:37 UTC 
(rev 3407)
+++ GNUnet/src/applications/fs/namespace/Makefile.am    2006-09-19 05:10:30 UTC 
(rev 3408)
@@ -15,11 +15,14 @@
 
 TESTS = $(check_PROGRAMS)
 
+EXTRA_DIST = check.conf peer.conf
+
 namespace_infotest_SOURCES = \
   namespace_infotest.c 
 namespace_infotest_LDADD = \
   $(top_builddir)/src/applications/fs/namespace/libgnunetnamespace.la \
   $(top_builddir)/src/applications/fs/ecrs/libgnunetecrs.la \
+  $(top_builddir)/src/util/config_impl/libgnunetutil_config.la \
   $(top_builddir)/src/util/crypto/libgnunetutil_crypto.la \
   $(top_builddir)/src/util/libgnunetutil.la 
 

Added: GNUnet/src/applications/fs/namespace/check.conf
===================================================================
--- GNUnet/src/applications/fs/namespace/check.conf     2006-09-16 18:36:37 UTC 
(rev 3407)
+++ GNUnet/src/applications/fs/namespace/check.conf     2006-09-19 05:10:30 UTC 
(rev 3408)
@@ -0,0 +1,12 @@
+# General settings
+[GNUNET]
+GNUNET_HOME = "/tmp/gnunet-session-test-driver"
+LOGLEVEL = "WARNING"
+LOGFILE = ""
+PROCESS-PRIORITY = "NORMAL"
+
+# Network options for the clients
+[NETWORK]
+CLIENT-PORT = 2087
+HOST = "localhost"
+

Modified: GNUnet/src/applications/fs/namespace/namespace_info.c
===================================================================
--- GNUnet/src/applications/fs/namespace/namespace_info.c       2006-09-16 
18:36:37 UTC (rev 3407)
+++ GNUnet/src/applications/fs/namespace/namespace_info.c       2006-09-19 
05:10:30 UTC (rev 3408)
@@ -115,10 +115,12 @@
   strcat(fn, namespaceName);
   FREE(fnBase);
 
-  if (OK != disk_file_size(ectx,
-                          fn,
-                          &len,
-                          YES)) {
+  if ( (OK != disk_file_test(ectx,
+                            fn)  ||
+       (OK != disk_file_size(ectx,
+                             fn,
+                             &len,
+                             YES)) ) ) {
     FREE(fn);
     return SYSERR;
   }

Modified: GNUnet/src/applications/fs/namespace/namespace_infotest.c
===================================================================
--- GNUnet/src/applications/fs/namespace/namespace_infotest.c   2006-09-16 
18:36:37 UTC (rev 3407)
+++ GNUnet/src/applications/fs/namespace/namespace_infotest.c   2006-09-19 
05:10:30 UTC (rev 3408)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2005 Christian Grothoff (and other contributing authors)
+     (C) 2005, 2006 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
@@ -27,36 +27,16 @@
 #include "platform.h"
 #include "gnunet_util.h"
 #include "gnunet_ecrs_lib.h"
-#include "gnunet_fsui_lib.h"
+#include "gnunet_namespace_lib.h"
+#include "gnunet_namespace_lib.h"
+#include "gnunet_util_config_impl.h"
+#include "gnunet_util_crypto.h"
+#include "gnunet_util_network_client.h"
 
 #define CHECK(a) if (!(a)) { ok = NO; GE_BREAK(ectx, 0); goto FAILURE; }
 
-static int parseCommandLine(int argc,
-                           char * argv[]) {
-  FREENONNULL(setConfigurationString("GNUNETD",
-                                    "_MAGIC_",
-                                    "NO"));
-  FREENONNULL(setConfigurationString("GNUNETD",
-                                    "LOGFILE",
-                                    NULL));
-  FREENONNULL(setConfigurationString("GNUNET",
-                                    "LOGLEVEL",
-                                    "NOTHING"));
-  FREENONNULL(setConfigurationString("GNUNET",
-                                    "GNUNETD-CONFIG",
-                                    "check.conf"));
-  FREENONNULL(setConfigurationString("GNUNET",
-                                    "GNUNET_HOME",
-                                    "/tmp/gnunet-namespace-infotest"));
-  return OK;
-}
+static struct GE_Context * ectx;
 
-
-static void eventCallback(void * cls,
-                         const FSUI_Event * event) {
-}
-
-
 int main(int argc, char * argv[]){
   pid_t daemon;
   int ok;
@@ -66,82 +46,96 @@
   HashCode512 root;
   int old;
   int newVal;
-  struct FSUI_Context * ctx;
+  struct GC_Configuration * cfg;
 
-  if (OK != initUtil(argc,
-                    argv,
-                    &parseCommandLine))
-    return -1;
-  daemon = startGNUnetDaemon(NO);
-  GE_ASSERT(ectx, daemon > 0);
+  cfg = GC_create_C_impl();
+  if (-1 == GC_parse_configuration(cfg,
+                                  "check.conf")) {
+    GC_free(cfg);
+    return -1;  
+  }
+  daemon  = os_daemon_start(NULL,
+                           cfg,
+                           "peer.conf",
+                           NO);
+  GE_ASSERT(NULL, daemon > 0);
+  GE_ASSERT(NULL, OK == connection_wait_for_running(NULL,
+                                                   cfg,
+                                                   30 * cronSECONDS));
   ok = YES;
-  startCron();
-  GE_ASSERT(ectx, OK == waitForGNUnetDaemonRunning(2 * cronMINUTES));
-  ECRS_deleteNamespace("test");
+  NS_deleteNamespace(ectx,
+                    cfg,
+                    "test");
   PTHREAD_SLEEP(5 * cronSECONDS); /* give apps time to start */
 
   /* ACTUAL TEST CODE */
-  ctx = FSUI_start("namespace_infotest",
-                  NO,
-                  &eventCallback,
-                  NULL);
-  CHECK(ctx != NULL);
-  old = FSUI_listNamespaces(ctx,
-                           YES,
-                           NULL,
-                           NULL);
+  old = NS_listNamespaces(ectx,
+                         cfg,
+                         YES,
+                         NULL,
+                         NULL);
                                
   meta = ECRS_createMetaData();
   ECRS_addToMetaData(meta,
                     0,
                     "test");
   makeRandomId(&root);
-  uri = FSUI_createNamespace(ctx,
-                            1,
-                            "test",
-                            meta,
-                            NULL,
-                            &root);
+  uri = NS_createNamespace(ectx,
+                          cfg,
+                          1,
+                          1,
+                          5000,
+                          "test",
+                          meta,
+                          NULL,
+                          &root);
   CHECK(uri != NULL);
-  CHECK(old + 1 == FSUI_listNamespaces(ctx,
-                                      YES,
-                                      NULL,
-                                      NULL));
-  old = FSUI_listNamespaceContent(ctx,
-                                 "test",
-                                 NULL,
-                                 NULL);
-  euri = FSUI_addToNamespace(ctx,
-                            1,
-                            "test",
-                            42,
-                            NULL,
-                            &root,
-                            NULL,
-                            uri,
-                            meta);
-  CHECK(euri != NULL);
-  newVal = FSUI_listNamespaceContent(ctx,
-                                    "test",
+  CHECK(old + 1 == NS_listNamespaces(ectx,
+                                    cfg,
+                                    YES,
                                     NULL,
-                                    NULL);
+                                    NULL));
+  old = NS_listNamespaceContent(ectx,
+                               cfg,
+                               "test",
+                               NULL,
+                               NULL);
+  euri = NS_addToNamespace(ectx,
+                          cfg,
+                          1,
+                          1,
+                          5000,
+                          "test",
+                          42,
+                          NULL,
+                          &root,
+                          NULL,
+                          uri,
+                          meta);
+  CHECK(euri != NULL);
+  newVal = NS_listNamespaceContent(ectx,
+                                  cfg,
+                                  "test",
+                                  NULL,
+                                  NULL);
   CHECK(old + 1 == newVal);
-  CHECK(OK == ECRS_deleteNamespace("test"));
+  CHECK(OK == NS_deleteNamespace(ectx,
+                                cfg,
+                                "test"));
   /* END OF TEST CODE */
  FAILURE:
-  if (ctx != NULL)
-    FSUI_stop(ctx);
   if (uri != NULL)
     ECRS_freeUri(uri);
   if (euri != NULL)
     ECRS_freeUri(euri);
   if (meta != NULL)
     ECRS_freeMetaData(meta);
-  ECRS_deleteNamespace("test");
-  stopCron();
-  GE_ASSERT(ectx, OK == stopGNUnetDaemon());
-  GE_ASSERT(ectx, OK == waitForGNUnetDaemonTermination(daemon));
-  doneUtil();
+  ECRS_deleteNamespace(ectx,
+                      cfg,
+                      "test");
+ 
+  GE_ASSERT(NULL, OK == os_daemon_stop(NULL, daemon));
+  GC_free(cfg);
   return (ok == YES) ? 0 : 1;
 }
 

Added: GNUnet/src/applications/fs/namespace/peer.conf
===================================================================
--- GNUnet/src/applications/fs/namespace/peer.conf      2006-09-16 18:36:37 UTC 
(rev 3407)
+++ GNUnet/src/applications/fs/namespace/peer.conf      2006-09-19 05:10:30 UTC 
(rev 3408)
@@ -0,0 +1,54 @@
+# This is the configuration for the GNUnet daemon when running
+# the test in this directory (make check).
+
+GNUNETD_HOME     = /tmp/gnunet-check-ecrs
+
+[GNUNETD]
+GNUNETD_HOME     = /tmp/gnunet-check-ecrs
+# VALGRIND        = 300
+HELLOEXPIRES     = 60
+LOGLEVEL        = NOTHING
+LOGFILE         = $GNUNETD_HOME/logs
+KEEPLOG         = 0
+PIDFILE         = $GNUNETD_HOME/gnunetd.pid
+HOSTS          = $GNUNETD_HOME/data/hosts/
+APPLICATIONS = "fs getoption stats"
+# TRANSPORTS = -- no transports!
+
+[MODULES]
+sqstore = "sqstore_sqlite"
+# you can also use sqstore_mysql here if 
+# that DB is available...
+topology = "topology_default"
+
+[NETWORK]
+PORT = 2087
+INTERFACE = eth0
+HELOEXCHANGE = NO
+TRUSTED = 127.0.0.0/8;
+
+[LOAD]
+INTERFACES      = eth0
+BASICLIMITING = YES
+MAXNETUPBPSTOTAL       = 50000
+MAXNETDOWNBPSTOTAL     = 50000
+MAXCPULOAD             = 100
+
+[FS]
+QUOTA  = 1024
+ACTIVEMIGRATION = NO
+DIR          = /tmp/gnunet-ecrs-test/
+INDEX-DIRECTORY = $GNUNETD_HOME/data/shared/
+INDEX-QUOTA = 8192
+
+[MYSQL]
+DELAYED = NO
+DATABASE = gnunetcheck
+
+[GAP]
+TABLESIZE = 65536
+
+[DHT]
+BUCKETCOUNT = 160
+MASTER-TABLE-SIZE = 65536
+

Modified: GNUnet/src/include/gnunet_namespace_lib.h
===================================================================
--- GNUnet/src/include/gnunet_namespace_lib.h   2006-09-16 18:36:37 UTC (rev 
3407)
+++ GNUnet/src/include/gnunet_namespace_lib.h   2006-09-19 05:10:30 UTC (rev 
3408)
@@ -213,10 +213,10 @@
  * List all updateable content in a given namespace.
  */
 int NS_listNamespaceContent(struct GE_Context * ectx,
-                             struct GC_Configuration * cfg,
-                             const char * name,
-                             NS_UpdateIterator iterator,
-                             void * closure); /* namespace_info.c */
+                           struct GC_Configuration * cfg,
+                           const char * name,
+                           NS_UpdateIterator iterator,
+                           void * closure); /* namespace_info.c */
 
 
 

Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2006-09-16 18:36:37 UTC (rev 3407)
+++ GNUnet/todo 2006-09-19 05:10:30 UTC (rev 3408)
@@ -18,19 +18,14 @@
     + loggers: SMTP logger
     + use new loggers in for CS error reporting
   * make testcases compile & pass again:
-    + fs/namespace -- does not yet compile
     + fs/fsui -- downloadtest does not yet compile
     + dht/tools, dht/module
   * transports:
     + SMTP/HTTP: do not yet compile (commented out from build)
       - libcurl / libmicrohttpd / libesmtp?
-  * server:
-    + needs more testing
   * applications:
-    + testing needed:
-      - transport,
-      - state
-      - advertising,
+    + more testing needed:
+      - advertising
       - ecrs_core
       - tracekit
       - gap





reply via email to

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