diff options
Diffstat (limited to 'src/include/gnunet_testing_lib.h')
-rw-r--r-- | src/include/gnunet_testing_lib.h | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h index 8199607a1..10b1d5a87 100644 --- a/src/include/gnunet_testing_lib.h +++ b/src/include/gnunet_testing_lib.h | |||
@@ -51,12 +51,30 @@ extern "C" | |||
51 | struct GNUNET_TESTING_Daemon; | 51 | struct GNUNET_TESTING_Daemon; |
52 | 52 | ||
53 | /** | 53 | /** |
54 | * Linked list of hostnames to use for starting daemons. | 54 | * Linked list of hostnames and ports to use for starting daemons. |
55 | */ | 55 | */ |
56 | struct GNUNET_TESTING_Host | 56 | struct GNUNET_TESTING_Host |
57 | { | 57 | { |
58 | /** | ||
59 | * Pointer to next item in the list. | ||
60 | */ | ||
58 | struct GNUNET_TESTING_Host *next; | 61 | struct GNUNET_TESTING_Host *next; |
62 | |||
63 | /** | ||
64 | * Hostname to connect to. | ||
65 | */ | ||
59 | char *hostname; | 66 | char *hostname; |
67 | |||
68 | /** | ||
69 | * Username to use when connecting (may be null). | ||
70 | */ | ||
71 | char *username; | ||
72 | |||
73 | /** | ||
74 | * Port to use for SSH connection (used for ssh | ||
75 | * connection forwarding, 0 to let ssh decide) | ||
76 | */ | ||
77 | uint16_t port; | ||
60 | }; | 78 | }; |
61 | 79 | ||
62 | /** | 80 | /** |
@@ -207,6 +225,11 @@ struct GNUNET_TESTING_Daemon | |||
207 | char *hostname; | 225 | char *hostname; |
208 | 226 | ||
209 | /** | 227 | /** |
228 | * Port to use for ssh, NULL to let system choose default. | ||
229 | */ | ||
230 | char *ssh_port_str; | ||
231 | |||
232 | /** | ||
210 | * Result of GNUNET_i2s of this peer, | 233 | * Result of GNUNET_i2s of this peer, |
211 | * for printing | 234 | * for printing |
212 | */ | 235 | */ |
@@ -392,11 +415,13 @@ typedef void (*GNUNET_TESTING_NotifyTopology)(void *cls, | |||
392 | * @param timeout how long to wait starting up peers | 415 | * @param timeout how long to wait starting up peers |
393 | * @param hostname name of the machine where to run GNUnet | 416 | * @param hostname name of the machine where to run GNUnet |
394 | * (use NULL for localhost). | 417 | * (use NULL for localhost). |
418 | * @param ssh_username ssh username to use when connecting to hostname | ||
419 | * @param sshport port to pass to ssh process when connecting to hostname | ||
395 | * @param hostkey_callback function to call once the hostkey has been | 420 | * @param hostkey_callback function to call once the hostkey has been |
396 | * generated for this peer, but it hasn't yet been started | 421 | * generated for this peer, but it hasn't yet been started |
397 | * (NULL to start immediately, otherwise waits on GNUNET_TESTING_daemon_continue_start) | 422 | * (NULL to start immediately, otherwise waits on GNUNET_TESTING_daemon_continue_start) |
398 | * @param hostkey_cls closure for hostkey callback | 423 | * @param hostkey_cls closure for hostkey callback |
399 | * @param cb function to call with the result | 424 | * @param cb function to call once peer is up, or failed to start |
400 | * @param cb_cls closure for cb | 425 | * @param cb_cls closure for cb |
401 | * @return handle to the daemon (actual start will be completed asynchronously) | 426 | * @return handle to the daemon (actual start will be completed asynchronously) |
402 | */ | 427 | */ |
@@ -405,6 +430,8 @@ GNUNET_TESTING_daemon_start (struct GNUNET_SCHEDULER_Handle *sched, | |||
405 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 430 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
406 | struct GNUNET_TIME_Relative timeout, | 431 | struct GNUNET_TIME_Relative timeout, |
407 | const char *hostname, | 432 | const char *hostname, |
433 | const char *ssh_username, | ||
434 | uint16_t sshport, | ||
408 | GNUNET_TESTING_NotifyHostkeyCreated hostkey_callback, | 435 | GNUNET_TESTING_NotifyHostkeyCreated hostkey_callback, |
409 | void *hostkey_cls, | 436 | void *hostkey_cls, |
410 | GNUNET_TESTING_NotifyDaemonRunning cb, | 437 | GNUNET_TESTING_NotifyDaemonRunning cb, |
@@ -599,6 +626,16 @@ GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, | |||
599 | 626 | ||
600 | 627 | ||
601 | /** | 628 | /** |
629 | * Count the number of running peers. | ||
630 | * | ||
631 | * @param pg handle for the peer group | ||
632 | * | ||
633 | * @return the number of currently running peers in the peer group | ||
634 | */ | ||
635 | unsigned int | ||
636 | GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup *pg); | ||
637 | |||
638 | /** | ||
602 | * Simulate churn by stopping some peers (and possibly | 639 | * Simulate churn by stopping some peers (and possibly |
603 | * re-starting others if churn is called multiple times). This | 640 | * re-starting others if churn is called multiple times). This |
604 | * function can only be used to create leave-join churn (peers "never" | 641 | * function can only be used to create leave-join churn (peers "never" |