gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r11528 - in gnunet: . src/fs


From: gnunet
Subject: [GNUnet-SVN] r11528 - in gnunet: . src/fs
Date: Wed, 26 May 2010 22:46:25 +0200

Author: grothoff
Date: 2010-05-26 22:46:25 +0200 (Wed, 26 May 2010)
New Revision: 11528

Added:
   gnunet/src/fs/test_gnunet_service_fs_migration_data.conf
Modified:
   gnunet/TODO
   gnunet/src/fs/
   gnunet/src/fs/Makefile.am
   gnunet/src/fs/fs_test_lib.c
   gnunet/src/fs/fs_test_lib.h
   gnunet/src/fs/test_fs_test_lib.c
   gnunet/src/fs/test_gnunet_service_fs_migration.c
   gnunet/src/fs/test_gnunet_service_fs_p2p.c
Log:
adding test for content migration

Modified: gnunet/TODO
===================================================================
--- gnunet/TODO 2010-05-26 20:01:48 UTC (rev 11527)
+++ gnunet/TODO 2010-05-26 20:46:25 UTC (rev 11528)
@@ -1,7 +1,5 @@
 0.9.0pre1:
 * FS: [CG]
-  - test indexing
-  - test migration
   - TTL/priority calculations
   - hot-path routing, load considerations
   - statistics


Property changes on: gnunet/src/fs
___________________________________________________________________
Modified: svn:ignore
   - test_fs_unindex_persistence
test_fs_search_persistence
test_fs_publish_persistence
test_fs_download_persistence
test_gnunet_fs_rec.py
test_gnunet_fs_psd.py
test_gnunet_fs_ns.py
test_gnunet_fs_idx.py
test_gnunet_service_fs_p2p
test_fs_test_lib
gnunet-service-fs.gcda
test_fs_unindex.gcno
test_fs_unindex.gcda
test_fs_start_stop.gcno
test_fs_start_stop.gcda
test_fs_search.gcno
test_fs_search.gcda
test_fs_publish.gcno
test_fs_publish.gcda
test_fs_namespace.gcno
test_fs_list_indexed.gcno
test_fs_list_indexed.gcda
test_fs_file_information.gcno
test_fs_file_information.gcda
test_fs_download.gcno
test_fs_download.gcda
test_fs_publish
test_fs_list_indexed
test_fs_file_information
test_fs_unindex
test_fs_namespace
test_fs_start_stop
test_fs_search
test_fs_download
test_fs_uri.gcno
test_fs_uri.gcda
test_fs_getopt.gcno
test_fs_directory.gcno
test_fs_directory.gcda
test_fs_collection.gcno
gnunet-unindex.gcno
gnunet-service-fs.gcno
gnunet-search.gcno
gnunet-publish.gcno
gnunet-pseudonym.gcno
gnunet-download.gcno
gnunet-directory.gcno
fs_uri.gcno
fs_uri.gcda
fs_unindex.gcno
fs_unindex.gcda
fs_tree.gcno
fs_tree.gcda
fs_search.gcno
fs_search.gcda
fs_publish.gcno
fs_publish.gcda
fs_namespace.gcno
fs_namespace.gcda
fs_list_indexed.gcno
fs_list_indexed.gcda
fs_getopt.gcno
fs_getopt.gcda
fs_file_information.gcno
fs_file_information.gcda
fs_download.gcno
fs_download.gcda
fs_directory.gcno
fs_directory.gcda
fs_collection.gcno
fs_collection.gcda
fs.gcno
fs.gcda
test_fs_uri
test_fs_getopt
test_fs_directory
test_fs_collection
gnunet-service-fs
gnunet-pseudonym
gnunet-directory
gnunet-unindex
gnunet-search
gnunet-download
gnunet-publish
Makefile.in
Makefile
.deps

   + test_gnunet_service_fs_migration
test_fs_download_indexed
test_fs_unindex_persistence
test_fs_search_persistence
test_fs_publish_persistence
test_fs_download_persistence
test_gnunet_fs_rec.py
test_gnunet_fs_psd.py
test_gnunet_fs_ns.py
test_gnunet_fs_idx.py
test_gnunet_service_fs_p2p
test_fs_test_lib
gnunet-service-fs.gcda
test_fs_unindex.gcno
test_fs_unindex.gcda
test_fs_start_stop.gcno
test_fs_start_stop.gcda
test_fs_search.gcno
test_fs_search.gcda
test_fs_publish.gcno
test_fs_publish.gcda
test_fs_namespace.gcno
test_fs_list_indexed.gcno
test_fs_list_indexed.gcda
test_fs_file_information.gcno
test_fs_file_information.gcda
test_fs_download.gcno
test_fs_download.gcda
test_fs_publish
test_fs_list_indexed
test_fs_file_information
test_fs_unindex
test_fs_namespace
test_fs_start_stop
test_fs_search
test_fs_download
test_fs_uri.gcno
test_fs_uri.gcda
test_fs_getopt.gcno
test_fs_directory.gcno
test_fs_directory.gcda
test_fs_collection.gcno
gnunet-unindex.gcno
gnunet-service-fs.gcno
gnunet-search.gcno
gnunet-publish.gcno
gnunet-pseudonym.gcno
gnunet-download.gcno
gnunet-directory.gcno
fs_uri.gcno
fs_uri.gcda
fs_unindex.gcno
fs_unindex.gcda
fs_tree.gcno
fs_tree.gcda
fs_search.gcno
fs_search.gcda
fs_publish.gcno
fs_publish.gcda
fs_namespace.gcno
fs_namespace.gcda
fs_list_indexed.gcno
fs_list_indexed.gcda
fs_getopt.gcno
fs_getopt.gcda
fs_file_information.gcno
fs_file_information.gcda
fs_download.gcno
fs_download.gcda
fs_directory.gcno
fs_directory.gcda
fs_collection.gcno
fs_collection.gcda
fs.gcno
fs.gcda
test_fs_uri
test_fs_getopt
test_fs_directory
test_fs_collection
gnunet-service-fs
gnunet-pseudonym
gnunet-directory
gnunet-unindex
gnunet-search
gnunet-download
gnunet-publish
Makefile.in
Makefile
.deps


Modified: gnunet/src/fs/Makefile.am
===================================================================
--- gnunet/src/fs/Makefile.am   2010-05-26 20:01:48 UTC (rev 11527)
+++ gnunet/src/fs/Makefile.am   2010-05-26 20:46:25 UTC (rev 11528)
@@ -324,6 +324,7 @@
   test_fs_search_data.conf \
   test_fs_unindex_data.conf \
   test_fs_uri_data.conf \
+  test_gnunet_service_fs_migration_data.conf \
   test_gnunet_fs_idx_data.conf \
   test_gnunet_fs_ns_data.conf \
   test_gnunet_fs_psd_data.conf \

Modified: gnunet/src/fs/fs_test_lib.c
===================================================================
--- gnunet/src/fs/fs_test_lib.c 2010-05-26 20:01:48 UTC (rev 11527)
+++ gnunet/src/fs/fs_test_lib.c 2010-05-26 20:46:25 UTC (rev 11528)
@@ -316,6 +316,7 @@
  * Start daemons for testing.
  *
  * @param sched scheduler to use
+ * @param template_cfg_file configuration template to use
  * @param timeout if this operation cannot be completed within the
  *                given period, call the continuation with an error code
  * @param total number of daemons to start
@@ -326,6 +327,7 @@
  */
 void
 GNUNET_FS_TEST_daemons_start (struct GNUNET_SCHEDULER_Handle *sched,
+                             const char *template_cfg_file,
                              struct GNUNET_TIME_Relative timeout,
                              unsigned int total,
                              struct GNUNET_FS_TestDaemon **daemons,
@@ -345,7 +347,7 @@
   sctx->cfg = GNUNET_CONFIGURATION_create ();
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_load (sctx->cfg,
-                                "fs_test_lib_data.conf"))
+                                template_cfg_file))
     {
       GNUNET_break (0);
       GNUNET_CONFIGURATION_destroy (sctx->cfg);

Modified: gnunet/src/fs/fs_test_lib.h
===================================================================
--- gnunet/src/fs/fs_test_lib.h 2010-05-26 20:01:48 UTC (rev 11527)
+++ gnunet/src/fs/fs_test_lib.h 2010-05-26 20:46:25 UTC (rev 11528)
@@ -42,6 +42,7 @@
  * Start daemons for testing.
  *
  * @param sched scheduler to use
+ * @param template_cfg_file configuration template to use
  * @param timeout if this operation cannot be completed within the
  *                given period, call the continuation with an error code
  * @param total number of daemons to start
@@ -52,6 +53,7 @@
  */
 void
 GNUNET_FS_TEST_daemons_start (struct GNUNET_SCHEDULER_Handle *sched,
+                             const char *template_cfg_file,
                              struct GNUNET_TIME_Relative timeout,
                              unsigned int total,
                              struct GNUNET_FS_TestDaemon **daemons,

Modified: gnunet/src/fs/test_fs_test_lib.c
===================================================================
--- gnunet/src/fs/test_fs_test_lib.c    2010-05-26 20:01:48 UTC (rev 11527)
+++ gnunet/src/fs/test_fs_test_lib.c    2010-05-26 20:46:25 UTC (rev 11528)
@@ -152,6 +152,7 @@
 {
   sched = s;
   GNUNET_FS_TEST_daemons_start (sched,
+                               "fs_test_lib_data.conf",
                                TIMEOUT,
                                NUM_DAEMONS,
                                daemons,

Modified: gnunet/src/fs/test_gnunet_service_fs_migration.c
===================================================================
--- gnunet/src/fs/test_gnunet_service_fs_migration.c    2010-05-26 20:01:48 UTC 
(rev 11527)
+++ gnunet/src/fs/test_gnunet_service_fs_migration.c    2010-05-26 20:46:25 UTC 
(rev 11528)
@@ -22,12 +22,6 @@
  * @file fs/test_gnunet_service_fs_migration.c
  * @brief test content migration between two peers
  * @author Christian Grothoff
- *
- * TODO:
- * - change configuration to enable migration
- * - shutdown source peer during download
- * - wait long enough to allow for migration between
- *   publish and download
  */
 #include "platform.h"
 #include "fs_test_lib.h"
@@ -37,18 +31,21 @@
 /**
  * File-size we use for testing.
  */
-#define FILESIZE (1024 * 1024 * 2)
+#define FILESIZE (2 * 32 * 1024)
 
 /**
  * How long until we give up on transmitting the message?
  */
 #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 600)
 
-#define NUM_DAEMONS 2
+/**
+ * How long do we give the peers for content migration?
+ */
+#define MIGRATION_DELAY GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_SECONDS, 60)
 
 #define SEED 42
 
-static struct GNUNET_FS_TestDaemon *daemons[NUM_DAEMONS];
+static struct GNUNET_FS_TestDaemon *daemons[2];
 
 static struct GNUNET_SCHEDULER_Handle *sched;
 
@@ -64,7 +61,7 @@
   char *fancy;
 
   GNUNET_FS_TEST_daemons_stop (sched,
-                              NUM_DAEMONS,
+                              1,
                               daemons);
   if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
     {
@@ -91,18 +88,11 @@
 
 static void
 do_download (void *cls,
-            const struct GNUNET_FS_Uri *uri)
+            const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  if (NULL == uri)
-    {
-      GNUNET_FS_TEST_daemons_stop (sched,
-                                  NUM_DAEMONS,
-                                  daemons);
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                 "Timeout during upload attempt, shutting down with error\n");
-      ok = 1;
-      return;
-    }
+  struct GNUNET_FS_Uri *uri = cls;
+
+  GNUNET_FS_TEST_daemons_stop (sched, 1, &daemons[1]);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Downloading %llu bytes\n",
              (unsigned long long) FILESIZE);
@@ -117,13 +107,38 @@
 
 
 static void
+do_wait (void *cls,
+        const struct GNUNET_FS_Uri *uri)
+{
+  struct GNUNET_FS_Uri *d;
+
+  if (NULL == uri)
+    {
+      GNUNET_FS_TEST_daemons_stop (sched,
+                                  2,
+                                  daemons);
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Timeout during upload attempt, shutting down with error\n");
+      ok = 1;
+      return;
+    }
+  d = GNUNET_FS_uri_dup (uri);
+  GNUNET_SCHEDULER_add_delayed (sched,
+                               MIGRATION_DELAY,
+                               &do_download,
+                               d);
+}
+
+
+
+static void
 do_publish (void *cls,
            const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
     {
       GNUNET_FS_TEST_daemons_stop (sched,
-                                  NUM_DAEMONS,
+                                  2,
                                   daemons);
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                  "Timeout during connect attempt, shutting down with error\n");
@@ -138,7 +153,7 @@
                          TIMEOUT,
                          1, GNUNET_NO, FILESIZE, SEED, 
                          VERBOSE, 
-                         &do_download, NULL);
+                         &do_wait, NULL);
 }
 
 
@@ -167,8 +182,9 @@
 {
   sched = s;
   GNUNET_FS_TEST_daemons_start (sched,
+                               "test_gnunet_service_fs_migration_data.conf",
                                TIMEOUT,
-                               NUM_DAEMONS,
+                               2,
                                daemons,
                                &do_connect,
                                NULL);

Added: gnunet/src/fs/test_gnunet_service_fs_migration_data.conf
===================================================================
--- gnunet/src/fs/test_gnunet_service_fs_migration_data.conf                    
        (rev 0)
+++ gnunet/src/fs/test_gnunet_service_fs_migration_data.conf    2010-05-26 
20:46:25 UTC (rev 11528)
@@ -0,0 +1,58 @@
+[PATHS]
+SERVICEHOME = /tmp/test-gnunet-service-fs-migration/
+DEFAULTCONFIG = test_gnunet_service_fs_migration_data.conf
+
+[gnunetd]
+HOSTKEY = $SERVICEHOME/.hostkey
+
+[resolver]
+PORT = 43464
+HOSTNAME = localhost
+
+[transport]
+PORT = 43465
+PLUGINS = tcp
+#DEBUG = YES
+
+[arm]
+PORT = 43466
+HOSTNAME = localhost
+DEFAULTSERVICES = fs
+
+[datastore]
+#DEBUG = YES
+#PREFIX = valgrind --tool=memcheck --leak-check=yes
+
+[statistics]
+PORT = 43467
+HOSTNAME = localhost
+
+[transport-tcp]
+TIMEOUT = 300000
+PORT = 43468
+
+[peerinfo]
+PORT = 43469
+HOSTNAME = localhost
+
+[core]
+PORT = 43470
+HOSTNAME = localhost
+#TOTAL_QUOTA_IN = 9321
+#TOTAL_QUOTA_OUT = 9321
+TOTAL_QUOTA_IN = 3932160
+TOTAL_QUOTA_OUT = 3932160
+#DEBUG = YES
+#PREFIX = valgrind --tool=memcheck --leak-check=yes
+
+[fs]
+PORT = 43471
+HOSTNAME = localhost
+#OPTIONS = -L DEBUG
+ACTIVEMIGRATION = YES
+#DEBUG = YES
+#PREFIX = valgrind --tool=memcheck --leak-check=yes 
+#PREFIX = xterm -e gdb -x cmd --args 
+
+[testing]
+WEAKRANDOM = YES

Modified: gnunet/src/fs/test_gnunet_service_fs_p2p.c
===================================================================
--- gnunet/src/fs/test_gnunet_service_fs_p2p.c  2010-05-26 20:01:48 UTC (rev 
11527)
+++ gnunet/src/fs/test_gnunet_service_fs_p2p.c  2010-05-26 20:46:25 UTC (rev 
11528)
@@ -161,6 +161,7 @@
 {
   sched = s;
   GNUNET_FS_TEST_daemons_start (sched,
+                               "fs_test_lib_data.conf",
                                TIMEOUT,
                                NUM_DAEMONS,
                                daemons,




reply via email to

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