X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Finclude%2Fgnunet_testing_lib.h;h=8de3548533f66ee22645a8d43fc8ecdee026ece4;hb=beb7e51b1c1606856e2a8cbe2d6f5d64a56ca3b8;hp=521e4283fad784e9e655758f366d1f3a15b3a0cb;hpb=b33ccc91d52fa8b25b996bb20ee8e3cc45281ce5;p=oweals%2Fgnunet.git diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h index 521e4283f..8de354853 100644 --- a/src/include/gnunet_testing_lib.h +++ b/src/include/gnunet_testing_lib.h @@ -70,14 +70,13 @@ typedef void (*GNUNET_TESTING_NotifyDaemonRunning)(void *cls, /** - * Starts a GNUnet daemon. + * Starts a GNUnet daemon. GNUnet must be installed on the target + * system and available in the PATH. The machine must furthermore be + * reachable via "ssh" (unless the hostname is "NULL") without the + * need to enter a password. * * @param sched scheduler to use * @param cfg configuration to use - * @param service_home directory to use as the service home directory - * @param transports transport services that should be loaded - * @param applications application services and daemons that should be started - * @param port_offset offset to add to all ports for all services * @param hostname name of the machine where to run GNUnet * (use NULL for localhost). * @param cb function to call with the result @@ -86,11 +85,7 @@ typedef void (*GNUNET_TESTING_NotifyDaemonRunning)(void *cls, */ struct GNUNET_TESTING_Daemon * GNUNET_TESTING_daemon_start (struct GNUNET_SCHEDULER_Handle *sched, - struct GNUNET_CONFIGURATION_Handle *cfg, - const char *service_home, - const char *transports, - const char *applications, - uint16_t port_offset, + const struct GNUNET_CONFIGURATION_Handle *cfg, const char *hostname, GNUNET_TESTING_NotifyDaemonRunning cb, void *cb_cls); @@ -128,12 +123,11 @@ void GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, * @param cb_cls closure for cb */ void GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, - const struct GNUNET_CONFIGURATION_Handle *cfg, + struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_TESTING_NotifyCompletion cb, void * cb_cls); - /** * Establish a connection between two GNUnet daemons. * @@ -169,57 +163,17 @@ struct GNUNET_TESTING_PeerGroup; * @param total number of daemons to start * @param cb function to call on each daemon that was started * @param cb_cls closure for cb - * @param cbe function to call at the end - * @param cbe_cls closure for cbe - * @param hostname where to run the peers; can be NULL (to run - * everything on localhost). - * @param va Additional hosts can be specified using a NULL-terminated list of - * varargs, hosts will then be used round-robin from that - * list; va only contains anything if hostname != NULL. - * @return NULL on error, otherwise handle to control peer group - */ -struct GNUNET_TESTING_PeerGroup * -GNUNET_TESTING_daemons_start_va (struct GNUNET_SCHEDULER_Handle *sched, - const struct GNUNET_CONFIGURATION_Handle *cfg, - unsigned int total, - GNUNET_TESTING_NotifyDaemonRunning cb, - void *cb_cls, - GNUNET_TESTING_NotifyCompletion cbe, - void *cbe_cls, - const char *hostname, - va_list va); - - -/** - * Start count gnunetd processes with the same set of - * transports and applications. The port numbers will - * be computed by adding delta each time (zero - * times for the first peer). - * - * @param total number of daemons to start - * @param timeout how long is this allowed to take? - * @param cb function to call on each daemon that was started - * @param cb_cls closure for cb - * @param cbe function to call at the end - * @param cbe_cls closure for cbe - * @param hostname where to run the peers; can be NULL (to run - * everything on localhost). Additional - * hosts can be specified using a NULL-terminated list of - * varargs, hosts will then be used round-robin from that - * list. + * @param hostnames space-separated list of hostnames to use, + * NULL to use localhost only * @return NULL on error, otherwise handle to control peer group */ struct GNUNET_TESTING_PeerGroup * GNUNET_TESTING_daemons_start (struct GNUNET_SCHEDULER_Handle *sched, - struct GNUNET_CONFIGURATION_Handle *cfg, + const struct GNUNET_CONFIGURATION_Handle *cfg, unsigned int total, GNUNET_TESTING_NotifyDaemonRunning cb, void *cb_cls, - GNUNET_TESTING_NotifyCompletion cbe, - void *cbe_cls, - const char *hostname, - ...); - + const char *hostnames); /** @@ -237,17 +191,6 @@ GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg); struct GNUNET_TESTING_Testbed; -/** - * Prototype of a function that will be called when - * a testbed is being created. - * - * @param cls closure - * @param tb NULL on error - */ -typedef void (*GNUNET_TESTING_NotifyTestbedRunning)(void *cls, - struct GNUNET_TESTING_Testbed *tb); - - /** * Topologies supported for testbeds. */ @@ -285,50 +228,38 @@ enum GNUNET_TESTING_Topology }; - /** - * Start count GNUnet daemons with a particular - * topology. + * Start "count" GNUnet daemons with a particular topology. * - * @param size number of peers the testbed should have + * @param sched scheduler to use + * @param cfg configuration template to use + * @param count number of peers the testbed should have * @param topology desired topology (enforced via F2F) - * @param service_home_prefix path to use as the prefix for the home of the services - * @param transports which transports should all peers use - * @param applications which applications should be used? - * @param timeout how long is this allowed to take? * @param cb function to call on each daemon that was started * @param cb_cls closure for cb - * @param cte function to call at the end - * @param cte_cls closure for cbe * @param hostname where to run the peers; can be NULL (to run * everything on localhost). Additional * hosts can be specified using a NULL-terminated list of * varargs, hosts will then be used round-robin from that * list. + * @return handle to control the testbed */ -void +struct GNUNET_TESTING_Testbed * GNUNET_TESTING_testbed_start (struct GNUNET_SCHEDULER_Handle *sched, - struct GNUNET_CONFIGURATION_Handle *cfg, - unsigned int size, + const struct GNUNET_CONFIGURATION_Handle *cfg, + unsigned int count, enum GNUNET_TESTING_Topology topology, - const char *service_home_prefix, - const char *transports, - const char *applications, GNUNET_TESTING_NotifyDaemonRunning cb, void *cb_cls, - GNUNET_TESTING_NotifyTestbedRunning cte, - void *cte_cls, const char *hostname, ...); - - /** * Stop all of the daemons started with the start function. * * @param tb handle for the testbed - * @param cb function to call at the end + * @param cb function to call when done * @param cb_cls closure for cb */ void @@ -337,7 +268,6 @@ GNUNET_TESTING_testbed_stop (struct GNUNET_TESTING_Testbed *tb, void *cb_cls ); - /** * Simulate churn in the testbed by stopping some peers (and possibly * re-starting others if churn is called multiple times). This @@ -366,7 +296,6 @@ GNUNET_TESTING_testbed_churn (struct GNUNET_TESTING_Testbed *tb, void *cb_cls); - #if 0 /* keep Emacsens' auto-indent happy */ { #endif