library for writing DHT tests More...
Go to the source code of this file.
Data Structures | |
struct | GNUNET_DHT_TEST_Context |
Test context for a DHT Test. More... | |
Functions | |
static void * | dht_connect_adapter (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Adapter function called to establish a connection to the DHT service. More... | |
static void | dht_disconnect_adapter (void *cls, void *op_result) |
Adapter function called to destroy a connection to the DHT service. More... | |
static void | dht_connect_cb (void *cls, struct GNUNET_TESTBED_Operation *op, void *ca_result, const char *emsg) |
Callback to be called when a service connect operation is completed. More... | |
void | GNUNET_DHT_TEST_cleanup (struct GNUNET_DHT_TEST_Context *ctx) |
Clean up the testbed. More... | |
static void | dht_test_run (void *cls, struct GNUNET_TESTBED_RunHandle *h, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, unsigned int links_succeeded, unsigned int links_failed) |
void | GNUNET_DHT_TEST_run (const char *testname, const char *cfgname, unsigned int num_peers, GNUNET_DHT_TEST_AppMain tmain, void *tmain_cls) |
Run a test using the given name, configuration file and number of peers. More... | |
library for writing DHT tests
Definition in file dht_test_lib.c.
|
static |
Adapter function called to establish a connection to the DHT service.
cls | closure |
cfg | configuration of the peer to connect to; will be available until GNUNET_TESTBED_operation_done() is called on the operation returned from GNUNET_TESTBED_service_connect() |
Definition at line 76 of file dht_test_lib.c.
References cfg, and GNUNET_DHT_connect().
Referenced by dht_test_run().
|
static |
Adapter function called to destroy a connection to the DHT service.
cls | closure |
op_result | service handle returned from the connect adapter |
Definition at line 91 of file dht_test_lib.c.
References dht, GNUNET_DHT_disconnect(), and op_result().
Referenced by dht_test_run().
|
static |
Callback to be called when a service connect operation is completed.
cls | the callback closure from functions generating an operation |
op | the operation that has been finished |
ca_result | the service handle returned from GNUNET_TESTBED_ConnectAdapter() |
emsg | error message in case the operation has failed; will be NULL if operation has executed successfully. |
Definition at line 110 of file dht_test_lib.c.
References ctx, GNUNET_SCHEDULER_shutdown(), and op.
Referenced by dht_test_run().
void GNUNET_DHT_TEST_cleanup | ( | struct GNUNET_DHT_TEST_Context * | ctx | ) |
Clean up the testbed.
ctx | handle for the testbed |
Definition at line 142 of file dht_test_lib.c.
References ctx, GNUNET_free, GNUNET_SCHEDULER_shutdown(), and GNUNET_TESTBED_operation_done().
|
static |
Definition at line 154 of file dht_test_lib.c.
References ctx, dht_connect_adapter(), dht_connect_cb(), dht_disconnect_adapter(), GNUNET_assert, GNUNET_TESTBED_service_connect(), num_peers, and peers.
Referenced by GNUNET_DHT_TEST_run().
void GNUNET_DHT_TEST_run | ( | const char * | testname, |
const char * | cfgname, | ||
unsigned int | num_peers, | ||
GNUNET_DHT_TEST_AppMain | tmain, | ||
void * | tmain_cls | ||
) |
Run a test using the given name, configuration file and number of peers.
testname | name of the test (for logging) |
cfgname | 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' |
Definition at line 178 of file dht_test_lib.c.
References ctx, dht_test_run(), GNUNET_new, GNUNET_new_array, GNUNET_TESTBED_test_run(), num_peers, and tmain().