library for writing CADET tests More...
Go to the source code of this file.
Typedefs | |
typedef void(* | GNUNET_CADET_TEST_AppMain) (void *cls, struct GNUNET_CADET_TEST_Context *ctx, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, struct GNUNET_CADET_Handle **cadets) |
Main function of a CADET test. More... | |
Functions | |
void | GNUNET_CADET_TEST_ruN (const char *testname, const char *cfgfile, unsigned int num_peers, GNUNET_CADET_TEST_AppMain tmain, void *tmain_cls, GNUNET_CADET_ConnectEventHandler connects, GNUNET_CADET_WindowSizeEventHandler window_changes, GNUNET_CADET_DisconnectEventHandler disconnects, struct GNUNET_MQ_MessageHandler *handlers, const struct GNUNET_HashCode **ports) |
Run a test using the given name, configuration file and number of peers. More... | |
void | GNUNET_CADET_TEST_cleanup (struct GNUNET_CADET_TEST_Context *ctx) |
Clean up the testbed. More... | |
library for writing CADET tests
Definition in file cadet_test_lib.h.
typedef void(* GNUNET_CADET_TEST_AppMain) (void *cls, struct GNUNET_CADET_TEST_Context *ctx, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, struct GNUNET_CADET_Handle **cadets) |
Main function of a CADET test.
cls | Closure. |
ctx | Argument to give to GNUNET_CADET_TEST_cleanup on test end. |
num_peers | Number of peers that are running. |
peers | Array of peers. |
cadets | Handle to each of the CADETs of the peers. |
Definition at line 54 of file cadet_test_lib.h.
void GNUNET_CADET_TEST_ruN | ( | const char * | testname, |
const char * | cfgfile, | ||
unsigned int | num_peers, | ||
GNUNET_CADET_TEST_AppMain | tmain, | ||
void * | tmain_cls, | ||
GNUNET_CADET_ConnectEventHandler | connects, | ||
GNUNET_CADET_WindowSizeEventHandler | window_changes, | ||
GNUNET_CADET_DisconnectEventHandler | disconnects, | ||
struct GNUNET_MQ_MessageHandler * | handlers, | ||
const struct GNUNET_HashCode ** | ports | ||
) |
Run a test using the given name, configuration file and number of peers.
All cadet callbacks will receive the peer number (long) as the closure.
testname | Name of the test (for logging). |
cfgfile | Name of the configuration file. |
num_peers | Number of peers to start. |
tmain | Main function to run once the testbed is ready. |
tmain_cls | Closure for tmain. |
connects | Handler for incoming channels. |
window_changes | Handler for the window size change notification. |
disconnects | Cleaner for destroyed incoming channels. |
handlers | Message handlers. |
ports | Ports the peers offer, NULL-terminated. |
Definition at line 338 of file cadet_test_lib.c.
References cadet_test_run(), connects(), ctx, disconnects(), GNUNET_MQ_copy_handlers(), GNUNET_new, GNUNET_new_array, GNUNET_TESTBED_test_run(), handlers, num_peers, GNUNET_CADET_TEST_Context::ports, tmain(), and GNUNET_CADET_TEST_Context::window_changes.
void GNUNET_CADET_TEST_cleanup | ( | struct GNUNET_CADET_TEST_Context * | ctx | ) |
Clean up the testbed.
ctx | handle for the testbed |
Definition at line 238 of file cadet_test_lib.c.
References ctx, GNUNET_assert, GNUNET_free, GNUNET_SCHEDULER_shutdown(), and GNUNET_TESTBED_operation_done().
Referenced by disconnect_cadet_peers(), start_test(), and warmup().