static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { tth = GNUNET_TRANSPORT_TESTING_init (); timeout_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &end_badly, NULL); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting peer\n"); p1 = GNUNET_TRANSPORT_TESTING_start_peer (tth, "test_transport_api_tcp_peer1.conf", 1, ¬ify_receive, ¬ify_connect, ¬ify_disconnect, &start_cb, p1); p2 = GNUNET_TRANSPORT_TESTING_start_peer (tth, "test_transport_api_tcp_peer2.conf", 2, ¬ify_receive, ¬ify_connect, ¬ify_disconnect, &start_cb, p2); if (p1 == NULL) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer1 was not started successfully\n"); GNUNET_SCHEDULER_shutdown (); } if (p2 == NULL) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer2 was not started successfully\n"); GNUNET_SCHEDULER_shutdown (); } }
int main (int argc, char *argv[]) { int ret; GNUNET_TRANSPORT_TESTING_get_test_name (argv[0], &test_name); GNUNET_log_setup (test_name, "WARNING", NULL); GNUNET_TRANSPORT_TESTING_get_test_source_name (__FILE__, &test_source); GNUNET_TRANSPORT_TESTING_get_test_plugin_name (argv[0], test_source, &test_plugin); tth = GNUNET_TRANSPORT_TESTING_init (); GNUNET_TRANSPORT_TESTING_get_config_name (argv[0], &cfg_file_p1, 1); GNUNET_TRANSPORT_TESTING_get_config_name (argv[0], &cfg_file_p2, 2); ret = check (); GNUNET_free (cfg_file_p1); GNUNET_free (cfg_file_p2); GNUNET_free (test_source); GNUNET_free (test_plugin); GNUNET_free (test_name); return ret; }
static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { ret = 1; tth = GNUNET_TRANSPORT_TESTING_init (); GNUNET_assert (NULL != tth); timeout_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &end_badly, NULL); p = GNUNET_TRANSPORT_TESTING_start_peer (tth, cfgfile, 1, NULL, /* receive cb */ NULL, /* connect cb */ NULL, /* disconnect cb */ NULL, /* nc/nd closure */ &start_cb, /* startup cb */ NULL); /* closure */ if (NULL == p) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failed to start peer\n"); if (timeout_task != NULL) GNUNET_SCHEDULER_cancel (timeout_task); timeout_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); } }
int main (int argc, char *argv0[]) { ok = 1; GNUNET_TRANSPORT_TESTING_get_test_name (argv0[0], &test_name); GNUNET_log_setup ("test-transport-api-blacklisting", "WARNING", NULL); static char *const argv[] = { "date", "-c", "test_transport_api_data.conf", NULL }; static struct GNUNET_GETOPT_CommandLineOption options[] = { GNUNET_GETOPT_OPTION_END }; tth = GNUNET_TRANSPORT_TESTING_init (); GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, "test-transport-api-blacklisting", "nohelp", options, &run, NULL); GNUNET_TRANSPORT_TESTING_done (tth); return ok; }
static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL); tth = GNUNET_TRANSPORT_TESTING_init (); p1 = GNUNET_TRANSPORT_TESTING_start_peer (tth, cfg_file_p1, 1, ¬ify_receive, ¬ify_connect, ¬ify_disconnect, &start_cb, NULL); p2 = GNUNET_TRANSPORT_TESTING_start_peer (tth, cfg_file_p2, 2, ¬ify_receive, ¬ify_connect, ¬ify_disconnect, &start_cb, NULL); if ((p1 == NULL) || (p2 == NULL)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n"); if (die_task != GNUNET_SCHEDULER_NO_TASK) GNUNET_SCHEDULER_cancel (die_task); die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); return; } }
int main (int argc, char *argv[]) { char *test_source; int ret; static char *const argv_new[] = { "test-transport-api-reliability", "-c", "test_transport_api_data.conf", NULL }; static struct GNUNET_GETOPT_CommandLineOption options[] = { GNUNET_GETOPT_OPTION_END }; GNUNET_TRANSPORT_TESTING_get_test_name (argv[0], &test_name); GNUNET_log_setup (test_name, "WARNING", NULL); GNUNET_TRANSPORT_TESTING_get_test_source_name (__FILE__, &test_source); GNUNET_TRANSPORT_TESTING_get_test_plugin_name (argv[0], test_source, &test_plugin); tth = GNUNET_TRANSPORT_TESTING_init (); GNUNET_TRANSPORT_TESTING_get_config_name (argv[0], &cfg_file_p1, 1); GNUNET_TRANSPORT_TESTING_get_config_name (argv[0], &cfg_file_p2, 2); #if WRITECONFIG setTransportOptions ("test_transport_api_data.conf"); #endif ok = GNUNET_SYSERR; ret = GNUNET_PROGRAM_run ((sizeof (argv_new) / sizeof (char *)) - 1, argv_new, test_name, "nohelp", options, &run, &ok); if (GNUNET_SYSERR == ret) { fprintf (stderr, "Test failed: %d\n", ok); ok = -1; } GNUNET_free (cfg_file_p1); GNUNET_free (cfg_file_p2); GNUNET_free (test_source); GNUNET_free (test_plugin); GNUNET_free (test_name); return ok; }
int main (int argc, char *argv[]) { int ret; GNUNET_log_setup ("test-transport-api-blacklisting", "WARNING", NULL); tth = GNUNET_TRANSPORT_TESTING_init (); ret = check (); GNUNET_TRANSPORT_TESTING_done (tth); return ret; }
int main (int argc, char *argv[]) { GNUNET_TRANSPORT_TESTING_get_test_name (argv[0], &test_name); GNUNET_log_setup (test_name, "WARNING", NULL); GNUNET_TRANSPORT_TESTING_get_test_source_name (__FILE__, &test_source); GNUNET_TRANSPORT_TESTING_get_test_plugin_name (argv[0], test_source, &test_plugin); tth = GNUNET_TRANSPORT_TESTING_init (); GNUNET_TRANSPORT_TESTING_get_config_name (argv[0], &cfg_file_p1, 1); GNUNET_TRANSPORT_TESTING_get_config_name (argv[0], &cfg_file_p2, 2); check (); GNUNET_free (cfg_file_p1); GNUNET_free (cfg_file_p2); if (GNUNET_YES == GNUNET_DISK_file_test (gen_cfg_p1)) { GNUNET_DISK_directory_remove (gen_cfg_p1); GNUNET_free (gen_cfg_p1); } if (GNUNET_YES == GNUNET_DISK_file_test (gen_cfg_p2)) { GNUNET_DISK_directory_remove (gen_cfg_p2); GNUNET_free (gen_cfg_p2); } GNUNET_free (test_source); GNUNET_free (test_plugin); GNUNET_free (test_name); GNUNET_TRANSPORT_TESTING_done (tth); return test_failed; }
int main (int argc, char *argv[]) { int ret; GNUNET_TRANSPORT_TESTING_get_test_name (argv[0], &test_name); GNUNET_log_setup (test_name, "WARNING", NULL); tth = GNUNET_TRANSPORT_TESTING_init (); GNUNET_asprintf (&cfg_file_p1, "test_transport_api_tcp_peer1.conf"); GNUNET_asprintf (&cfg_file_p2, "test_transport_api_tcp_peer2.conf"); ret = check (); GNUNET_free (cfg_file_p1); GNUNET_free (cfg_file_p2); GNUNET_free (test_name); GNUNET_TRANSPORT_TESTING_done (tth); return ret; }