gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r11295 - gnunet/src/include


From: gnunet
Subject: [GNUnet-SVN] r11295 - gnunet/src/include
Date: Tue, 11 May 2010 09:36:06 +0200

Author: nevans
Date: 2010-05-11 09:36:06 +0200 (Tue, 11 May 2010)
New Revision: 11295

Modified:
   gnunet/src/include/gnunet_testing_lib.h
Log:
testing api change

Modified: gnunet/src/include/gnunet_testing_lib.h
===================================================================
--- gnunet/src/include/gnunet_testing_lib.h     2010-05-11 07:35:38 UTC (rev 
11294)
+++ gnunet/src/include/gnunet_testing_lib.h     2010-05-11 07:36:06 UTC (rev 
11295)
@@ -305,6 +305,12 @@
    * Set to GNUNET_YES once the peer is up.
    */
   int running;
+
+  /**
+   * Used to tell shutdown not to remove configuration for the peer
+   * (if it's going to be restarted later)
+   */
+  int churn;
 };
 
 
@@ -387,6 +393,21 @@
                                GNUNET_TESTING_NotifyDaemonRunning cb, void 
*cb_cls);
 
 /**
+ * Start a peer that has previously been stopped using the daemon_stop
+ * call (and files weren't deleted and the allow restart flag)
+ *
+ * @param daemon the daemon to start (has been previously stopped)
+ * @param timeout how long to wait for restart
+ * @param cb the callback for notification when the peer is running
+ * @param cb_cls closure for the callback
+ */
+void
+GNUNET_TESTING_daemon_start_stopped (struct GNUNET_TESTING_Daemon *daemon,
+                                     struct GNUNET_TIME_Relative timeout,
+                                     GNUNET_TESTING_NotifyDaemonRunning cb,
+                                     void *cb_cls);
+
+/**
  * Get a certain testing daemon handle.
  *
  * @param pg handle to the set of running peers
@@ -406,12 +427,14 @@
  * @param delete_files GNUNET_YES to remove files, GNUNET_NO
  *        to leave them (i.e. for restarting at a later time,
  *        or logfile inspection once finished)
+ * @param allow_restart GNUNET_YES to restart peer later (using this API)
+ *        GNUNET_NO to kill off and clean up for good
  */
 void
 GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d,
                             struct GNUNET_TIME_Relative timeout,
                             GNUNET_TESTING_NotifyCompletion cb, void *cb_cls,
-                            int delete_files);
+                            int delete_files, int allow_restart);
 
 
 /**
@@ -518,7 +541,37 @@
 void
 GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, struct 
GNUNET_TIME_Relative timeout);
 
+/**
+ * Simulate churn by stopping some peers (and possibly
+ * re-starting others if churn is called multiple times).  This
+ * function can only be used to create leave-join churn (peers "never"
+ * leave for good).  First "voff" random peers that are currently
+ * online will be taken offline; then "von" random peers that are then
+ * offline will be put back online.  No notifications will be
+ * generated for any of these operations except for the callback upon
+ * completion.  Note that the implementation is at liberty to keep
+ * the ARM service itself (but none of the other services or daemons)
+ * running even though the "peer" is being varied offline.
+ *
+ * @param pg handle for the peer group
+ * @param voff number of peers that should go offline
+ * @param von number of peers that should come back online;
+ *            must be zero on first call (since "testbed_start"
+ *            always starts all of the peers)
+ * @param timeout how long to wait for operations to finish before
+ *        giving up
+ * @param cb function to call at the end
+ * @param cb_cls closure for cb
+ */
+void
+GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg,
+                              unsigned int voff,
+                              unsigned int von,
+                              struct GNUNET_TIME_Relative timeout,
+                              GNUNET_TESTING_NotifyCompletion cb,
+                              void *cb_cls);
 
+
 /**
  * Topologies supported for testbeds.
  */




reply via email to

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