aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_testing_lib.h
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2011-07-25 14:27:33 +0000
committerNathan S. Evans <evans@in.tum.de>2011-07-25 14:27:33 +0000
commit08f1114108442793fb00dc443ed6b94b81c3b443 (patch)
treeec282bc9ef6963f2a9d6ff21e5b9f3db395bbd8a /src/include/gnunet_testing_lib.h
parent91d1bc4750c36d7f3e996f483fe4bee7c242eb45 (diff)
downloadgnunet-08f1114108442793fb00dc443ed6b94b81c3b443.tar.gz
gnunet-08f1114108442793fb00dc443ed6b94b81c3b443.zip
churn a service
Diffstat (limited to 'src/include/gnunet_testing_lib.h')
-rw-r--r--src/include/gnunet_testing_lib.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h
index 60b0256a0..34920bbab 100644
--- a/src/include/gnunet_testing_lib.h
+++ b/src/include/gnunet_testing_lib.h
@@ -176,6 +176,18 @@ enum GNUNET_TESTING_StartPhase
176 SP_SHUTDOWN_START, 176 SP_SHUTDOWN_START,
177 177
178 /** 178 /**
179 * We should shutdown a *single* service via gnunet-arm. Call the dead_cb
180 * upon notification from gnunet-arm that the service has been stopped.
181 */
182 SP_SERVICE_SHUTDOWN_START,
183
184 /**
185 * We should start a *single* service via gnunet-arm. Call the daemon cb
186 * upon notification from gnunet-arm that the service has been started.
187 */
188 SP_SERVICE_START,
189
190 /**
179 * We've received a configuration update and are currently waiting for 191 * We've received a configuration update and are currently waiting for
180 * the copy process for the update to complete. Once it is, we will 192 * the copy process for the update to complete. Once it is, we will
181 * return to "SP_START_DONE" (and rely on ARM to restart all affected 193 * return to "SP_START_DONE" (and rely on ARM to restart all affected
@@ -362,6 +374,14 @@ struct GNUNET_TESTING_Daemon
362 * (if it's going to be restarted later) 374 * (if it's going to be restarted later)
363 */ 375 */
364 int churn; 376 int churn;
377
378 /**
379 * Currently, a single char * pointing to a service
380 * that has been churned off.
381 *
382 * FIXME: make this a linked list of services that have been churned off!!!
383 */
384 char *churned_services;
365}; 385};
366 386
367 387
@@ -494,6 +514,21 @@ GNUNET_TESTING_daemon_start_stopped (struct GNUNET_TESTING_Daemon *daemon,
494 void *cb_cls); 514 void *cb_cls);
495 515
496/** 516/**
517 * Stops a GNUnet daemon.
518 *
519 * @param d the daemon for which the service should be started
520 * @param service the name of the service to start
521 * @param timeout how long to wait for process for shutdown to complete
522 * @param cb function called once the daemon was stopped
523 * @param cb_cls closure for cb
524 */
525void
526GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon *d,
527 char *service,
528 struct GNUNET_TIME_Relative timeout,
529 GNUNET_TESTING_NotifyDaemonRunning cb, void *cb_cls);
530
531/**
497 * Get a certain testing daemon handle. 532 * Get a certain testing daemon handle.
498 * 533 *
499 * @param pg handle to the set of running peers 534 * @param pg handle to the set of running peers
@@ -549,6 +584,24 @@ void GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d,
549 GNUNET_TESTING_NotifyCompletion cb, 584 GNUNET_TESTING_NotifyCompletion cb,
550 void * cb_cls); 585 void * cb_cls);
551 586
587/**
588 * Stops a single service of a GNUnet daemon. Used like daemon_stop,
589 * only doesn't stop the entire peer in any case. If the service
590 * is not currently running, this call is likely to fail after
591 * timeout!
592 *
593 * @param d the daemon that should be stopped
594 * @param service the name of the service to stop
595 * @param timeout how long to wait for process for shutdown to complete
596 * @param cb function called once the service was stopped
597 * @param cb_cls closure for cb
598 */
599void
600GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d,
601 char *service,
602 struct GNUNET_TIME_Relative timeout,
603 GNUNET_TESTING_NotifyCompletion cb, void *cb_cls);
604
552 605
553/** 606/**
554 * Establish a connection between two GNUnet daemons. 607 * Establish a connection between two GNUnet daemons.
@@ -677,6 +730,7 @@ GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup *pg);
677 * running even though the "peer" is being varied offline. 730 * running even though the "peer" is being varied offline.
678 * 731 *
679 * @param pg handle for the peer group 732 * @param pg handle for the peer group
733 * @param service the service to churn on/off, NULL for all
680 * @param voff number of peers that should go offline 734 * @param voff number of peers that should go offline
681 * @param von number of peers that should come back online; 735 * @param von number of peers that should come back online;
682 * must be zero on first call (since "testbed_start" 736 * must be zero on first call (since "testbed_start"
@@ -688,6 +742,7 @@ GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup *pg);
688 */ 742 */
689void 743void
690GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg, 744GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg,
745 char *service,
691 unsigned int voff, 746 unsigned int voff,
692 unsigned int von, 747 unsigned int von,
693 struct GNUNET_TIME_Relative timeout, 748 struct GNUNET_TIME_Relative timeout,