aboutsummaryrefslogtreecommitdiff
path: root/src/gns/test_gns_dht_delegated_lookup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gns/test_gns_dht_delegated_lookup.c')
-rw-r--r--src/gns/test_gns_dht_delegated_lookup.c23
1 files changed, 13 insertions, 10 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 @@
60 */ 60 */
61static char *test_directory; 61static char *test_directory;
62 62
63struct GNUNET_TESTING_Daemon *d1; 63static struct GNUNET_TESTING_PeerGroup *pg;
64
65 64
66/* Task handle to use to schedule test failure */ 65/* Task handle to use to schedule test failure */
67GNUNET_SCHEDULER_TaskIdentifier die_task; 66GNUNET_SCHEDULER_TaskIdentifier die_task;
@@ -140,8 +139,9 @@ on_lookup_result(void *cls, uint32_t rd_count,
140 } 139 }
141 GNUNET_GNS_disconnect(gns_handle); 140 GNUNET_GNS_disconnect(gns_handle);
142 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n"); 141 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n");
143 GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, 142 //GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL,
144 GNUNET_YES, GNUNET_NO); 143 // GNUNET_YES, GNUNET_NO);
144 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
145} 145}
146 146
147 147
@@ -174,9 +174,9 @@ static void
174end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 174end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
175{ 175{
176 176
177 if (d1 != NULL) 177 if (pg != NULL) {
178 GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, 178 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
179 GNUNET_YES, GNUNET_NO); 179 }
180 GNUNET_SCHEDULER_cancel (die_task); 180 GNUNET_SCHEDULER_cancel (die_task);
181} 181}
182 182
@@ -266,7 +266,7 @@ put_dht(void *cls, int32_t success, const char *emsg)
266 266
267static void 267static void
268do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, 268do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
269 const struct GNUNET_CONFIGURATION_Handle *cfg, 269 const struct GNUNET_CONFIGURATION_Handle *_cfg,
270 struct GNUNET_TESTING_Daemon *d, const char *emsg) 270 struct GNUNET_TESTING_Daemon *d, const char *emsg)
271{ 271{
272 272
@@ -274,6 +274,7 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
274 char* alice_keyfile; 274 char* alice_keyfile;
275 struct GNUNET_CRYPTO_ShortHashCode bob_hash; 275 struct GNUNET_CRYPTO_ShortHashCode bob_hash;
276 276
277 cfg = _cfg;
277 278
278 GNUNET_SCHEDULER_cancel (die_task); 279 GNUNET_SCHEDULER_cancel (die_task);
279 280
@@ -351,8 +352,10 @@ run (void *cls, char *const *args, const char *cfgfile,
351 "didn't start all daemons in reasonable amount of time!!!"); 352 "didn't start all daemons in reasonable amount of time!!!");
352 353
353 /* Start alice */ 354 /* Start alice */
354 d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, 355 //d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0,
355 NULL, NULL, NULL, &do_lookup, NULL); 356 // NULL, NULL, NULL, &do_lookup, NULL);
357 pg = GNUNET_TESTING_daemons_start(cfg, 1, 1, 1, TIMEOUT,
358 NULL, NULL, &do_lookup, NULL, NULL, NULL, NULL);
356} 359}
357 360
358static int 361static int