From 75df1f39d07f5ff36be717a29e2b0c267861a027 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Tue, 10 Apr 2012 14:14:41 +0000 Subject: [PATCH] -performance tests --- src/gns/test_gns_dht_delegated_lookup.c | 23 ++++++++++++--------- src/gns/test_gns_max_queries.c | 24 +++++++++++++--------- src/gns/test_gns_pseu_shorten.c | 21 ++++++++++--------- src/gns/test_gns_simple_delegated_lookup.c | 20 +++++++++--------- src/gns/test_gns_simple_get_authority.c | 20 +++++++++--------- src/gns/test_gns_simple_lookup.c | 20 +++++++++--------- src/gns/test_gns_simple_mx_lookup.c | 20 +++++++++--------- src/gns/test_gns_simple_shorten.c | 20 +++++++++--------- src/gns/test_gns_simple_zkey_lookup.c | 20 +++++++++--------- 9 files changed, 98 insertions(+), 90 deletions(-) diff --git a/src/gns/test_gns_dht_delegated_lookup.c b/src/gns/test_gns_dht_delegated_lookup.c index 2835af6f8..b27c5ec33 100644 --- a/src/gns/test_gns_dht_delegated_lookup.c +++ b/src/gns/test_gns_dht_delegated_lookup.c @@ -60,8 +60,7 @@ */ static char *test_directory; -struct GNUNET_TESTING_Daemon *d1; - +static struct GNUNET_TESTING_PeerGroup *pg; /* Task handle to use to schedule test failure */ GNUNET_SCHEDULER_TaskIdentifier die_task; @@ -140,8 +139,9 @@ on_lookup_result(void *cls, uint32_t rd_count, } GNUNET_GNS_disconnect(gns_handle); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n"); - GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, - GNUNET_YES, GNUNET_NO); + //GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, + // GNUNET_YES, GNUNET_NO); + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); } @@ -174,9 +174,9 @@ static void end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - if (d1 != NULL) - GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, - GNUNET_YES, GNUNET_NO); + if (pg != NULL) { + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); + } GNUNET_SCHEDULER_cancel (die_task); } @@ -266,7 +266,7 @@ put_dht(void *cls, int32_t success, const char *emsg) static void do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, - const struct GNUNET_CONFIGURATION_Handle *cfg, + const struct GNUNET_CONFIGURATION_Handle *_cfg, struct GNUNET_TESTING_Daemon *d, const char *emsg) { @@ -274,6 +274,7 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, char* alice_keyfile; struct GNUNET_CRYPTO_ShortHashCode bob_hash; + cfg = _cfg; GNUNET_SCHEDULER_cancel (die_task); @@ -351,8 +352,10 @@ run (void *cls, char *const *args, const char *cfgfile, "didn't start all daemons in reasonable amount of time!!!"); /* Start alice */ - d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, - NULL, NULL, NULL, &do_lookup, NULL); + //d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, + // NULL, NULL, NULL, &do_lookup, NULL); + pg = GNUNET_TESTING_daemons_start(cfg, 1, 1, 1, TIMEOUT, + NULL, NULL, &do_lookup, NULL, NULL, NULL, NULL); } static int diff --git a/src/gns/test_gns_max_queries.c b/src/gns/test_gns_max_queries.c index e94c57f05..8bc0bf54e 100644 --- a/src/gns/test_gns_max_queries.c +++ b/src/gns/test_gns_max_queries.c @@ -58,8 +58,7 @@ */ static char *test_directory; -struct GNUNET_TESTING_Daemon *d1; - +static struct GNUNET_TESTING_PeerGroup *pg; /* Task handle to use to schedule test failure */ GNUNET_SCHEDULER_TaskIdentifier die_task; @@ -145,8 +144,9 @@ on_lookup_result(void *cls, uint32_t rd_count, } GNUNET_GNS_disconnect(gns_handle); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n"); - GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, - GNUNET_YES, GNUNET_NO); + //GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, + // GNUNET_YES, GNUNET_NO); + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); } @@ -195,9 +195,8 @@ static void end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - if (d1 != NULL) - GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, - GNUNET_YES, GNUNET_NO); + if (pg != NULL) + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); GNUNET_SCHEDULER_cancel (die_task); } @@ -217,7 +216,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, - const struct GNUNET_CONFIGURATION_Handle *cfg, + const struct GNUNET_CONFIGURATION_Handle *_cfg, struct GNUNET_TESTING_Daemon *d, const char *emsg) { struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; @@ -227,6 +226,8 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, char* alice_keyfile; struct GNUNET_CRYPTO_ShortHashCode bob_hash; + cfg = _cfg; + GNUNET_SCHEDULER_cancel (die_task); /* put records into namestore */ @@ -320,8 +321,11 @@ run (void *cls, char *const *args, const char *cfgfile, "didn't start all daemons in reasonable amount of time!!!"); /* Start alice */ - d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, - NULL, NULL, NULL, &do_lookup, NULL); + //d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, + // NULL, NULL, NULL, &do_lookup, NULL); + pg = GNUNET_TESTING_daemons_start(cfg, 1, 1, 1, TIMEOUT, + NULL, NULL, &do_lookup, NULL, + NULL, NULL, NULL); } static int diff --git a/src/gns/test_gns_pseu_shorten.c b/src/gns/test_gns_pseu_shorten.c index 0d6c0a76b..7a73884d1 100644 --- a/src/gns/test_gns_pseu_shorten.c +++ b/src/gns/test_gns_pseu_shorten.c @@ -64,8 +64,7 @@ */ static char *test_directory; -struct GNUNET_TESTING_Daemon *d1; - +static struct GNUNET_TESTING_PeerGroup *pg; /* Task handle to use to schedule test failure */ GNUNET_SCHEDULER_TaskIdentifier die_task; @@ -145,8 +144,7 @@ process_shorten_result(void* cls, const char* sname) } GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n"); - GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, - GNUNET_YES, GNUNET_NO); + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); } static void @@ -234,9 +232,8 @@ static void end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - if (d1 != NULL) - GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, - GNUNET_YES, GNUNET_NO); + if (pg != NULL) + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); GNUNET_SCHEDULER_cancel (die_task); } @@ -492,13 +489,14 @@ put_pkey_dht(void *cls, int32_t success, const char *emsg) static void do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, - const struct GNUNET_CONFIGURATION_Handle *cfg, + const struct GNUNET_CONFIGURATION_Handle *_cfg, struct GNUNET_TESTING_Daemon *d, const char *emsg) { char* our_keyfile; + cfg = _cfg; GNUNET_SCHEDULER_cancel (die_task); @@ -578,8 +576,11 @@ run (void *cls, char *const *args, const char *cfgfile, "didn't start all daemons in reasonable amount of time!!!"); /* Start alice */ - d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, - NULL, NULL, NULL, &do_lookup, NULL); + //d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, + // NULL, NULL, NULL, &do_lookup, NULL); + pg = GNUNET_TESTING_daemons_start(cfg, 1, 1, 1, TIMEOUT, + NULL, NULL, &do_lookup, NULL, + NULL, NULL, NULL); } static int diff --git a/src/gns/test_gns_simple_delegated_lookup.c b/src/gns/test_gns_simple_delegated_lookup.c index 876b93eab..a91870681 100644 --- a/src/gns/test_gns_simple_delegated_lookup.c +++ b/src/gns/test_gns_simple_delegated_lookup.c @@ -71,8 +71,7 @@ */ static char *test_directory; -struct GNUNET_TESTING_Daemon *d1; - +static struct GNUNET_TESTING_PeerGroup *pg; /* Task handle to use to schedule test failure */ GNUNET_SCHEDULER_TaskIdentifier die_task; @@ -143,8 +142,7 @@ on_lookup_result(void *cls, uint32_t rd_count, } GNUNET_GNS_disconnect(gns_handle); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n"); - GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, - GNUNET_YES, GNUNET_NO); + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); } @@ -177,9 +175,8 @@ static void end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - if (d1 != NULL) - GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, - GNUNET_YES, GNUNET_NO); + if (pg != NULL) + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); GNUNET_SCHEDULER_cancel (die_task); } @@ -199,7 +196,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, - const struct GNUNET_CONFIGURATION_Handle *cfg, + const struct GNUNET_CONFIGURATION_Handle *_cfg, struct GNUNET_TESTING_Daemon *d, const char *emsg) { struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; @@ -210,6 +207,8 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, struct GNUNET_CRYPTO_RsaSignature *sig; char* alice_keyfile; + cfg = _cfg; + GNUNET_SCHEDULER_cancel (die_task); /* put records into namestore */ @@ -298,8 +297,9 @@ run (void *cls, char *const *args, const char *cfgfile, "didn't start all daemons in reasonable amount of time!!!"); /* Start alice */ - d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, - NULL, NULL, NULL, &do_lookup, NULL); + pg = GNUNET_TESTING_daemons_start(cfg, 1, 1, 1, TIMEOUT, + NULL, NULL, &do_lookup, NULL, + NULL, NULL, NULL); } static int diff --git a/src/gns/test_gns_simple_get_authority.c b/src/gns/test_gns_simple_get_authority.c index 39268f4c5..f274d2cd4 100644 --- a/src/gns/test_gns_simple_get_authority.c +++ b/src/gns/test_gns_simple_get_authority.c @@ -61,8 +61,7 @@ */ static char *test_directory; -struct GNUNET_TESTING_Daemon *d1; - +static struct GNUNET_TESTING_PeerGroup *pg; /* Task handle to use to schedule test failure */ GNUNET_SCHEDULER_TaskIdentifier die_task; @@ -125,8 +124,7 @@ process_auth_result(void* cls, const char* aname) } GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n"); - GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, - GNUNET_YES, GNUNET_NO); + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); } /** @@ -168,9 +166,8 @@ static void end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - if (d1 != NULL) - GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, - GNUNET_YES, GNUNET_NO); + if (pg != NULL) + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); GNUNET_SCHEDULER_cancel (die_task); } @@ -190,7 +187,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void do_shorten(void *cls, const struct GNUNET_PeerIdentity *id, - const struct GNUNET_CONFIGURATION_Handle *cfg, + const struct GNUNET_CONFIGURATION_Handle *_cfg, struct GNUNET_TESTING_Daemon *d, const char *emsg) { struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded our_pkey; @@ -204,6 +201,8 @@ do_shorten(void *cls, const struct GNUNET_PeerIdentity *id, struct GNUNET_CRYPTO_RsaSignature *sig; char* our_keyfile; + cfg = _cfg; + GNUNET_SCHEDULER_cancel (die_task); /* put records into namestore */ @@ -331,8 +330,9 @@ run (void *cls, char *const *args, const char *cfgfile, "didn't start all daemons in reasonable amount of time!!!"); /* Start alice */ - d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, - NULL, NULL, NULL, &do_shorten, NULL); + pg = GNUNET_TESTING_daemons_start(cfg, 1, 1, 1, TIMEOUT, + NULL, NULL, &do_shorten, NULL, + NULL, NULL, NULL); } static int diff --git a/src/gns/test_gns_simple_lookup.c b/src/gns/test_gns_simple_lookup.c index c2843abaa..12d7a68ac 100644 --- a/src/gns/test_gns_simple_lookup.c +++ b/src/gns/test_gns_simple_lookup.c @@ -52,8 +52,7 @@ */ static char *test_directory; -struct GNUNET_TESTING_Daemon *d1; - +static struct GNUNET_TESTING_PeerGroup *pg; /* Task handle to use to schedule test failure */ GNUNET_SCHEDULER_TaskIdentifier die_task; @@ -125,8 +124,7 @@ on_lookup_result(void *cls, uint32_t rd_count, } GNUNET_GNS_disconnect(gns_handle); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n"); - GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, - GNUNET_YES, GNUNET_NO); + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); } @@ -163,9 +161,8 @@ static void end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - if (d1 != NULL) - GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, - GNUNET_YES, GNUNET_NO); + if (pg != NULL) + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); GNUNET_SCHEDULER_cancel (die_task); } @@ -185,12 +182,14 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, - const struct GNUNET_CONFIGURATION_Handle *cfg, + const struct GNUNET_CONFIGURATION_Handle *_cfg, struct GNUNET_TESTING_Daemon *d, const char *emsg) { struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; struct GNUNET_CRYPTO_RsaPrivateKey *alice_key; char* alice_keyfile; + + cfg = _cfg; GNUNET_SCHEDULER_cancel (die_task); @@ -260,8 +259,9 @@ run (void *cls, char *const *args, const char *cfgfile, "didn't start all daemons in reasonable amount of time!!!"); /* Start alice */ - d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, - NULL, NULL, NULL, &do_lookup, NULL); + pg = GNUNET_TESTING_daemons_start(cfg, 1, 1, 1, TIMEOUT, + NULL, NULL, &do_lookup, NULL, + NULL, NULL, NULL); } static int diff --git a/src/gns/test_gns_simple_mx_lookup.c b/src/gns/test_gns_simple_mx_lookup.c index 860688945..ffd97f07b 100644 --- a/src/gns/test_gns_simple_mx_lookup.c +++ b/src/gns/test_gns_simple_mx_lookup.c @@ -59,8 +59,7 @@ */ static char *test_directory; -struct GNUNET_TESTING_Daemon *d1; - +static struct GNUNET_TESTING_PeerGroup *pg; /* Task handle to use to schedule test failure */ GNUNET_SCHEDULER_TaskIdentifier die_task; @@ -160,8 +159,7 @@ on_lookup_result(void *cls, uint32_t rd_count, GNUNET_GNS_disconnect(gns_handle); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n"); - GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, - GNUNET_YES, GNUNET_NO); + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); } @@ -194,9 +192,8 @@ static void end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - if (d1 != NULL) - GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, - GNUNET_YES, GNUNET_NO); + if (pg != NULL) + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); GNUNET_SCHEDULER_cancel (die_task); } @@ -216,7 +213,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, - const struct GNUNET_CONFIGURATION_Handle *cfg, + const struct GNUNET_CONFIGURATION_Handle *_cfg, struct GNUNET_TESTING_Daemon *d, const char *emsg) { struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; @@ -227,6 +224,8 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, struct GNUNET_CRYPTO_RsaSignature *sig; char* alice_keyfile; + cfg = _cfg; + GNUNET_SCHEDULER_cancel (die_task); /* put records into namestore */ @@ -339,8 +338,9 @@ run (void *cls, char *const *args, const char *cfgfile, "didn't start all daemons in reasonable amount of time!!!"); /* Start alice */ - d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, - NULL, NULL, NULL, &do_lookup, NULL); + pg = GNUNET_TESTING_daemons_start(cfg, 1, 1, 1, TIMEOUT, + NULL, NULL, &do_lookup, NULL, + NULL, NULL, NULL); } static int diff --git a/src/gns/test_gns_simple_shorten.c b/src/gns/test_gns_simple_shorten.c index e2f20b771..be6fc27b0 100644 --- a/src/gns/test_gns_simple_shorten.c +++ b/src/gns/test_gns_simple_shorten.c @@ -61,8 +61,7 @@ */ static char *test_directory; -struct GNUNET_TESTING_Daemon *d1; - +static struct GNUNET_TESTING_PeerGroup *pg; /* Task handle to use to schedule test failure */ GNUNET_SCHEDULER_TaskIdentifier die_task; @@ -125,8 +124,7 @@ process_shorten_result(void* cls, const char* sname) } GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n"); - GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, - GNUNET_YES, GNUNET_NO); + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); } /** @@ -168,9 +166,8 @@ static void end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - if (d1 != NULL) - GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, - GNUNET_YES, GNUNET_NO); + if (pg != NULL) + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); GNUNET_SCHEDULER_cancel (die_task); } @@ -190,7 +187,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void do_shorten(void *cls, const struct GNUNET_PeerIdentity *id, - const struct GNUNET_CONFIGURATION_Handle *cfg, + const struct GNUNET_CONFIGURATION_Handle *_cfg, struct GNUNET_TESTING_Daemon *d, const char *emsg) { struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded our_pkey; @@ -204,6 +201,8 @@ do_shorten(void *cls, const struct GNUNET_PeerIdentity *id, struct GNUNET_CRYPTO_RsaSignature *sig; char* our_keyfile; + cfg = _cfg; + GNUNET_SCHEDULER_cancel (die_task); /* put records into namestore */ @@ -331,8 +330,9 @@ run (void *cls, char *const *args, const char *cfgfile, "didn't start all daemons in reasonable amount of time!!!"); /* Start alice */ - d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, - NULL, NULL, NULL, &do_shorten, NULL); + pg = GNUNET_TESTING_daemons_start(cfg, 1, 1, 1, TIMEOUT, + NULL, NULL, &do_shorten, NULL, + NULL, NULL, NULL); } static int diff --git a/src/gns/test_gns_simple_zkey_lookup.c b/src/gns/test_gns_simple_zkey_lookup.c index 7402f9d58..32298cba5 100644 --- a/src/gns/test_gns_simple_zkey_lookup.c +++ b/src/gns/test_gns_simple_zkey_lookup.c @@ -57,8 +57,7 @@ */ static char *test_directory; -struct GNUNET_TESTING_Daemon *d1; - +static struct GNUNET_TESTING_PeerGroup *pg; /* Task handle to use to schedule test failure */ GNUNET_SCHEDULER_TaskIdentifier die_task; @@ -131,8 +130,7 @@ on_lookup_result(void *cls, uint32_t rd_count, } GNUNET_GNS_disconnect(gns_handle); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n"); - GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, - GNUNET_YES, GNUNET_NO); + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); } @@ -181,9 +179,8 @@ static void end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - if (d1 != NULL) - GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, - GNUNET_YES, GNUNET_NO); + if (pg != NULL) + GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); GNUNET_SCHEDULER_cancel (die_task); } @@ -203,7 +200,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, - const struct GNUNET_CONFIGURATION_Handle *cfg, + const struct GNUNET_CONFIGURATION_Handle *_cfg, struct GNUNET_TESTING_Daemon *d, const char *emsg) { struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; @@ -213,6 +210,8 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, struct GNUNET_CRYPTO_RsaSignature *sig; char* alice_keyfile; + cfg = _cfg; + GNUNET_SCHEDULER_cancel (die_task); /* put records into namestore */ @@ -301,8 +300,9 @@ run (void *cls, char *const *args, const char *cfgfile, "didn't start all daemons in reasonable amount of time!!!"); /* Start alice */ - d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, - NULL, NULL, NULL, &do_lookup, NULL); + pg = GNUNET_TESTING_daemons_start(cfg, 1, 1, 1, TIMEOUT, + NULL, NULL, &do_lookup, NULL, + NULL, NULL, NULL); } static int -- 2.25.1