aboutsummaryrefslogtreecommitdiff
path: root/src/gns
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2012-04-10 14:14:41 +0000
committerMartin Schanzenbach <mschanzenbach@posteo.de>2012-04-10 14:14:41 +0000
commit75df1f39d07f5ff36be717a29e2b0c267861a027 (patch)
tree7830474def335995776bfcd70dd59ce093b6231f /src/gns
parent7c01762cffc0b751a93d8cb8927f5cccbb910340 (diff)
downloadgnunet-75df1f39d07f5ff36be717a29e2b0c267861a027.tar.gz
gnunet-75df1f39d07f5ff36be717a29e2b0c267861a027.zip
-performance tests
Diffstat (limited to 'src/gns')
-rw-r--r--src/gns/test_gns_dht_delegated_lookup.c23
-rw-r--r--src/gns/test_gns_max_queries.c24
-rw-r--r--src/gns/test_gns_pseu_shorten.c21
-rw-r--r--src/gns/test_gns_simple_delegated_lookup.c20
-rw-r--r--src/gns/test_gns_simple_get_authority.c20
-rw-r--r--src/gns/test_gns_simple_lookup.c20
-rw-r--r--src/gns/test_gns_simple_mx_lookup.c20
-rw-r--r--src/gns/test_gns_simple_shorten.c20
-rw-r--r--src/gns/test_gns_simple_zkey_lookup.c20
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 @@
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
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 @@
58 */ 58 */
59static char *test_directory; 59static char *test_directory;
60 60
61struct GNUNET_TESTING_Daemon *d1; 61static struct GNUNET_TESTING_PeerGroup *pg;
62
63 62
64/* Task handle to use to schedule test failure */ 63/* Task handle to use to schedule test failure */
65GNUNET_SCHEDULER_TaskIdentifier die_task; 64GNUNET_SCHEDULER_TaskIdentifier die_task;
@@ -145,8 +144,9 @@ on_lookup_result(void *cls, uint32_t rd_count,
145 } 144 }
146 GNUNET_GNS_disconnect(gns_handle); 145 GNUNET_GNS_disconnect(gns_handle);
147 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n"); 146 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n");
148 GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, 147 //GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL,
149 GNUNET_YES, GNUNET_NO); 148 // GNUNET_YES, GNUNET_NO);
149 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
150} 150}
151 151
152 152
@@ -195,9 +195,8 @@ static void
195end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 195end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
196{ 196{
197 197
198 if (d1 != NULL) 198 if (pg != NULL)
199 GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, 199 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
200 GNUNET_YES, GNUNET_NO);
201 GNUNET_SCHEDULER_cancel (die_task); 200 GNUNET_SCHEDULER_cancel (die_task);
202} 201}
203 202
@@ -217,7 +216,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
217 216
218static void 217static void
219do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, 218do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
220 const struct GNUNET_CONFIGURATION_Handle *cfg, 219 const struct GNUNET_CONFIGURATION_Handle *_cfg,
221 struct GNUNET_TESTING_Daemon *d, const char *emsg) 220 struct GNUNET_TESTING_Daemon *d, const char *emsg)
222{ 221{
223 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; 222 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey;
@@ -227,6 +226,8 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
227 char* alice_keyfile; 226 char* alice_keyfile;
228 struct GNUNET_CRYPTO_ShortHashCode bob_hash; 227 struct GNUNET_CRYPTO_ShortHashCode bob_hash;
229 228
229 cfg = _cfg;
230
230 GNUNET_SCHEDULER_cancel (die_task); 231 GNUNET_SCHEDULER_cancel (die_task);
231 232
232 /* put records into namestore */ 233 /* put records into namestore */
@@ -320,8 +321,11 @@ run (void *cls, char *const *args, const char *cfgfile,
320 "didn't start all daemons in reasonable amount of time!!!"); 321 "didn't start all daemons in reasonable amount of time!!!");
321 322
322 /* Start alice */ 323 /* Start alice */
323 d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, 324 //d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0,
324 NULL, NULL, NULL, &do_lookup, NULL); 325 // NULL, NULL, NULL, &do_lookup, NULL);
326 pg = GNUNET_TESTING_daemons_start(cfg, 1, 1, 1, TIMEOUT,
327 NULL, NULL, &do_lookup, NULL,
328 NULL, NULL, NULL);
325} 329}
326 330
327static int 331static 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 @@
64 */ 64 */
65static char *test_directory; 65static char *test_directory;
66 66
67struct GNUNET_TESTING_Daemon *d1; 67static struct GNUNET_TESTING_PeerGroup *pg;
68
69 68
70/* Task handle to use to schedule test failure */ 69/* Task handle to use to schedule test failure */
71GNUNET_SCHEDULER_TaskIdentifier die_task; 70GNUNET_SCHEDULER_TaskIdentifier die_task;
@@ -145,8 +144,7 @@ process_shorten_result(void* cls, const char* sname)
145 } 144 }
146 145
147 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n"); 146 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n");
148 GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, 147 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
149 GNUNET_YES, GNUNET_NO);
150} 148}
151 149
152static void 150static void
@@ -234,9 +232,8 @@ static void
234end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 232end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
235{ 233{
236 234
237 if (d1 != NULL) 235 if (pg != NULL)
238 GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, 236 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
239 GNUNET_YES, GNUNET_NO);
240 GNUNET_SCHEDULER_cancel (die_task); 237 GNUNET_SCHEDULER_cancel (die_task);
241} 238}
242 239
@@ -492,13 +489,14 @@ put_pkey_dht(void *cls, int32_t success, const char *emsg)
492 489
493static void 490static void
494do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, 491do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
495 const struct GNUNET_CONFIGURATION_Handle *cfg, 492 const struct GNUNET_CONFIGURATION_Handle *_cfg,
496 struct GNUNET_TESTING_Daemon *d, const char *emsg) 493 struct GNUNET_TESTING_Daemon *d, const char *emsg)
497{ 494{
498 495
499 496
500 char* our_keyfile; 497 char* our_keyfile;
501 498
499 cfg = _cfg;
502 500
503 GNUNET_SCHEDULER_cancel (die_task); 501 GNUNET_SCHEDULER_cancel (die_task);
504 502
@@ -578,8 +576,11 @@ run (void *cls, char *const *args, const char *cfgfile,
578 "didn't start all daemons in reasonable amount of time!!!"); 576 "didn't start all daemons in reasonable amount of time!!!");
579 577
580 /* Start alice */ 578 /* Start alice */
581 d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, 579 //d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0,
582 NULL, NULL, NULL, &do_lookup, NULL); 580 // NULL, NULL, NULL, &do_lookup, NULL);
581 pg = GNUNET_TESTING_daemons_start(cfg, 1, 1, 1, TIMEOUT,
582 NULL, NULL, &do_lookup, NULL,
583 NULL, NULL, NULL);
583} 584}
584 585
585static int 586static 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 @@
71 */ 71 */
72static char *test_directory; 72static char *test_directory;
73 73
74struct GNUNET_TESTING_Daemon *d1; 74static struct GNUNET_TESTING_PeerGroup *pg;
75
76 75
77/* Task handle to use to schedule test failure */ 76/* Task handle to use to schedule test failure */
78GNUNET_SCHEDULER_TaskIdentifier die_task; 77GNUNET_SCHEDULER_TaskIdentifier die_task;
@@ -143,8 +142,7 @@ on_lookup_result(void *cls, uint32_t rd_count,
143 } 142 }
144 GNUNET_GNS_disconnect(gns_handle); 143 GNUNET_GNS_disconnect(gns_handle);
145 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n"); 144 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n");
146 GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, 145 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
147 GNUNET_YES, GNUNET_NO);
148} 146}
149 147
150 148
@@ -177,9 +175,8 @@ static void
177end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 175end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
178{ 176{
179 177
180 if (d1 != NULL) 178 if (pg != NULL)
181 GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, 179 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
182 GNUNET_YES, GNUNET_NO);
183 GNUNET_SCHEDULER_cancel (die_task); 180 GNUNET_SCHEDULER_cancel (die_task);
184} 181}
185 182
@@ -199,7 +196,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
199 196
200static void 197static void
201do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, 198do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
202 const struct GNUNET_CONFIGURATION_Handle *cfg, 199 const struct GNUNET_CONFIGURATION_Handle *_cfg,
203 struct GNUNET_TESTING_Daemon *d, const char *emsg) 200 struct GNUNET_TESTING_Daemon *d, const char *emsg)
204{ 201{
205 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; 202 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey;
@@ -210,6 +207,8 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
210 struct GNUNET_CRYPTO_RsaSignature *sig; 207 struct GNUNET_CRYPTO_RsaSignature *sig;
211 char* alice_keyfile; 208 char* alice_keyfile;
212 209
210 cfg = _cfg;
211
213 GNUNET_SCHEDULER_cancel (die_task); 212 GNUNET_SCHEDULER_cancel (die_task);
214 213
215 /* put records into namestore */ 214 /* put records into namestore */
@@ -298,8 +297,9 @@ run (void *cls, char *const *args, const char *cfgfile,
298 "didn't start all daemons in reasonable amount of time!!!"); 297 "didn't start all daemons in reasonable amount of time!!!");
299 298
300 /* Start alice */ 299 /* Start alice */
301 d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, 300 pg = GNUNET_TESTING_daemons_start(cfg, 1, 1, 1, TIMEOUT,
302 NULL, NULL, NULL, &do_lookup, NULL); 301 NULL, NULL, &do_lookup, NULL,
302 NULL, NULL, NULL);
303} 303}
304 304
305static int 305static 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 @@
61 */ 61 */
62static char *test_directory; 62static char *test_directory;
63 63
64struct GNUNET_TESTING_Daemon *d1; 64static struct GNUNET_TESTING_PeerGroup *pg;
65
66 65
67/* Task handle to use to schedule test failure */ 66/* Task handle to use to schedule test failure */
68GNUNET_SCHEDULER_TaskIdentifier die_task; 67GNUNET_SCHEDULER_TaskIdentifier die_task;
@@ -125,8 +124,7 @@ process_auth_result(void* cls, const char* aname)
125 } 124 }
126 125
127 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n"); 126 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n");
128 GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, 127 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
129 GNUNET_YES, GNUNET_NO);
130} 128}
131 129
132/** 130/**
@@ -168,9 +166,8 @@ static void
168end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 166end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
169{ 167{
170 168
171 if (d1 != NULL) 169 if (pg != NULL)
172 GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, 170 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
173 GNUNET_YES, GNUNET_NO);
174 GNUNET_SCHEDULER_cancel (die_task); 171 GNUNET_SCHEDULER_cancel (die_task);
175} 172}
176 173
@@ -190,7 +187,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
190 187
191static void 188static void
192do_shorten(void *cls, const struct GNUNET_PeerIdentity *id, 189do_shorten(void *cls, const struct GNUNET_PeerIdentity *id,
193 const struct GNUNET_CONFIGURATION_Handle *cfg, 190 const struct GNUNET_CONFIGURATION_Handle *_cfg,
194 struct GNUNET_TESTING_Daemon *d, const char *emsg) 191 struct GNUNET_TESTING_Daemon *d, const char *emsg)
195{ 192{
196 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded our_pkey; 193 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded our_pkey;
@@ -204,6 +201,8 @@ do_shorten(void *cls, const struct GNUNET_PeerIdentity *id,
204 struct GNUNET_CRYPTO_RsaSignature *sig; 201 struct GNUNET_CRYPTO_RsaSignature *sig;
205 char* our_keyfile; 202 char* our_keyfile;
206 203
204 cfg = _cfg;
205
207 GNUNET_SCHEDULER_cancel (die_task); 206 GNUNET_SCHEDULER_cancel (die_task);
208 207
209 /* put records into namestore */ 208 /* put records into namestore */
@@ -331,8 +330,9 @@ run (void *cls, char *const *args, const char *cfgfile,
331 "didn't start all daemons in reasonable amount of time!!!"); 330 "didn't start all daemons in reasonable amount of time!!!");
332 331
333 /* Start alice */ 332 /* Start alice */
334 d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, 333 pg = GNUNET_TESTING_daemons_start(cfg, 1, 1, 1, TIMEOUT,
335 NULL, NULL, NULL, &do_shorten, NULL); 334 NULL, NULL, &do_shorten, NULL,
335 NULL, NULL, NULL);
336} 336}
337 337
338static int 338static 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 @@
52 */ 52 */
53static char *test_directory; 53static char *test_directory;
54 54
55struct GNUNET_TESTING_Daemon *d1; 55static struct GNUNET_TESTING_PeerGroup *pg;
56
57 56
58/* Task handle to use to schedule test failure */ 57/* Task handle to use to schedule test failure */
59GNUNET_SCHEDULER_TaskIdentifier die_task; 58GNUNET_SCHEDULER_TaskIdentifier die_task;
@@ -125,8 +124,7 @@ on_lookup_result(void *cls, uint32_t rd_count,
125 } 124 }
126 GNUNET_GNS_disconnect(gns_handle); 125 GNUNET_GNS_disconnect(gns_handle);
127 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n"); 126 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n");
128 GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, 127 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
129 GNUNET_YES, GNUNET_NO);
130} 128}
131 129
132 130
@@ -163,9 +161,8 @@ static void
163end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 161end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
164{ 162{
165 163
166 if (d1 != NULL) 164 if (pg != NULL)
167 GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, 165 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
168 GNUNET_YES, GNUNET_NO);
169 GNUNET_SCHEDULER_cancel (die_task); 166 GNUNET_SCHEDULER_cancel (die_task);
170} 167}
171 168
@@ -185,12 +182,14 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
185 182
186static void 183static void
187do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, 184do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
188 const struct GNUNET_CONFIGURATION_Handle *cfg, 185 const struct GNUNET_CONFIGURATION_Handle *_cfg,
189 struct GNUNET_TESTING_Daemon *d, const char *emsg) 186 struct GNUNET_TESTING_Daemon *d, const char *emsg)
190{ 187{
191 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; 188 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey;
192 struct GNUNET_CRYPTO_RsaPrivateKey *alice_key; 189 struct GNUNET_CRYPTO_RsaPrivateKey *alice_key;
193 char* alice_keyfile; 190 char* alice_keyfile;
191
192 cfg = _cfg;
194 193
195 GNUNET_SCHEDULER_cancel (die_task); 194 GNUNET_SCHEDULER_cancel (die_task);
196 195
@@ -260,8 +259,9 @@ run (void *cls, char *const *args, const char *cfgfile,
260 "didn't start all daemons in reasonable amount of time!!!"); 259 "didn't start all daemons in reasonable amount of time!!!");
261 260
262 /* Start alice */ 261 /* Start alice */
263 d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, 262 pg = GNUNET_TESTING_daemons_start(cfg, 1, 1, 1, TIMEOUT,
264 NULL, NULL, NULL, &do_lookup, NULL); 263 NULL, NULL, &do_lookup, NULL,
264 NULL, NULL, NULL);
265} 265}
266 266
267static int 267static 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 @@
59 */ 59 */
60static char *test_directory; 60static char *test_directory;
61 61
62struct GNUNET_TESTING_Daemon *d1; 62static struct GNUNET_TESTING_PeerGroup *pg;
63
64 63
65/* Task handle to use to schedule test failure */ 64/* Task handle to use to schedule test failure */
66GNUNET_SCHEDULER_TaskIdentifier die_task; 65GNUNET_SCHEDULER_TaskIdentifier die_task;
@@ -160,8 +159,7 @@ on_lookup_result(void *cls, uint32_t rd_count,
160 159
161 GNUNET_GNS_disconnect(gns_handle); 160 GNUNET_GNS_disconnect(gns_handle);
162 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n"); 161 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n");
163 GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, 162 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
164 GNUNET_YES, GNUNET_NO);
165} 163}
166 164
167 165
@@ -194,9 +192,8 @@ static void
194end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 192end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
195{ 193{
196 194
197 if (d1 != NULL) 195 if (pg != NULL)
198 GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, 196 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
199 GNUNET_YES, GNUNET_NO);
200 GNUNET_SCHEDULER_cancel (die_task); 197 GNUNET_SCHEDULER_cancel (die_task);
201} 198}
202 199
@@ -216,7 +213,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
216 213
217static void 214static void
218do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, 215do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
219 const struct GNUNET_CONFIGURATION_Handle *cfg, 216 const struct GNUNET_CONFIGURATION_Handle *_cfg,
220 struct GNUNET_TESTING_Daemon *d, const char *emsg) 217 struct GNUNET_TESTING_Daemon *d, const char *emsg)
221{ 218{
222 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; 219 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey;
@@ -227,6 +224,8 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
227 struct GNUNET_CRYPTO_RsaSignature *sig; 224 struct GNUNET_CRYPTO_RsaSignature *sig;
228 char* alice_keyfile; 225 char* alice_keyfile;
229 226
227 cfg = _cfg;
228
230 GNUNET_SCHEDULER_cancel (die_task); 229 GNUNET_SCHEDULER_cancel (die_task);
231 230
232 /* put records into namestore */ 231 /* put records into namestore */
@@ -339,8 +338,9 @@ run (void *cls, char *const *args, const char *cfgfile,
339 "didn't start all daemons in reasonable amount of time!!!"); 338 "didn't start all daemons in reasonable amount of time!!!");
340 339
341 /* Start alice */ 340 /* Start alice */
342 d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, 341 pg = GNUNET_TESTING_daemons_start(cfg, 1, 1, 1, TIMEOUT,
343 NULL, NULL, NULL, &do_lookup, NULL); 342 NULL, NULL, &do_lookup, NULL,
343 NULL, NULL, NULL);
344} 344}
345 345
346static int 346static 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 @@
61 */ 61 */
62static char *test_directory; 62static char *test_directory;
63 63
64struct GNUNET_TESTING_Daemon *d1; 64static struct GNUNET_TESTING_PeerGroup *pg;
65
66 65
67/* Task handle to use to schedule test failure */ 66/* Task handle to use to schedule test failure */
68GNUNET_SCHEDULER_TaskIdentifier die_task; 67GNUNET_SCHEDULER_TaskIdentifier die_task;
@@ -125,8 +124,7 @@ process_shorten_result(void* cls, const char* sname)
125 } 124 }
126 125
127 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n"); 126 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n");
128 GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, 127 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
129 GNUNET_YES, GNUNET_NO);
130} 128}
131 129
132/** 130/**
@@ -168,9 +166,8 @@ static void
168end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 166end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
169{ 167{
170 168
171 if (d1 != NULL) 169 if (pg != NULL)
172 GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, 170 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
173 GNUNET_YES, GNUNET_NO);
174 GNUNET_SCHEDULER_cancel (die_task); 171 GNUNET_SCHEDULER_cancel (die_task);
175} 172}
176 173
@@ -190,7 +187,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
190 187
191static void 188static void
192do_shorten(void *cls, const struct GNUNET_PeerIdentity *id, 189do_shorten(void *cls, const struct GNUNET_PeerIdentity *id,
193 const struct GNUNET_CONFIGURATION_Handle *cfg, 190 const struct GNUNET_CONFIGURATION_Handle *_cfg,
194 struct GNUNET_TESTING_Daemon *d, const char *emsg) 191 struct GNUNET_TESTING_Daemon *d, const char *emsg)
195{ 192{
196 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded our_pkey; 193 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded our_pkey;
@@ -204,6 +201,8 @@ do_shorten(void *cls, const struct GNUNET_PeerIdentity *id,
204 struct GNUNET_CRYPTO_RsaSignature *sig; 201 struct GNUNET_CRYPTO_RsaSignature *sig;
205 char* our_keyfile; 202 char* our_keyfile;
206 203
204 cfg = _cfg;
205
207 GNUNET_SCHEDULER_cancel (die_task); 206 GNUNET_SCHEDULER_cancel (die_task);
208 207
209 /* put records into namestore */ 208 /* put records into namestore */
@@ -331,8 +330,9 @@ run (void *cls, char *const *args, const char *cfgfile,
331 "didn't start all daemons in reasonable amount of time!!!"); 330 "didn't start all daemons in reasonable amount of time!!!");
332 331
333 /* Start alice */ 332 /* Start alice */
334 d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, 333 pg = GNUNET_TESTING_daemons_start(cfg, 1, 1, 1, TIMEOUT,
335 NULL, NULL, NULL, &do_shorten, NULL); 334 NULL, NULL, &do_shorten, NULL,
335 NULL, NULL, NULL);
336} 336}
337 337
338static int 338static 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 @@
57 */ 57 */
58static char *test_directory; 58static char *test_directory;
59 59
60struct GNUNET_TESTING_Daemon *d1; 60static struct GNUNET_TESTING_PeerGroup *pg;
61
62 61
63/* Task handle to use to schedule test failure */ 62/* Task handle to use to schedule test failure */
64GNUNET_SCHEDULER_TaskIdentifier die_task; 63GNUNET_SCHEDULER_TaskIdentifier die_task;
@@ -131,8 +130,7 @@ on_lookup_result(void *cls, uint32_t rd_count,
131 } 130 }
132 GNUNET_GNS_disconnect(gns_handle); 131 GNUNET_GNS_disconnect(gns_handle);
133 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n"); 132 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down peer1!\n");
134 GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, 133 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
135 GNUNET_YES, GNUNET_NO);
136} 134}
137 135
138 136
@@ -181,9 +179,8 @@ static void
181end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 179end_badly_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
182{ 180{
183 181
184 if (d1 != NULL) 182 if (pg != NULL)
185 GNUNET_TESTING_daemon_stop (d1, TIMEOUT, &shutdown_callback, NULL, 183 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
186 GNUNET_YES, GNUNET_NO);
187 GNUNET_SCHEDULER_cancel (die_task); 184 GNUNET_SCHEDULER_cancel (die_task);
188} 185}
189 186
@@ -203,7 +200,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
203 200
204static void 201static void
205do_lookup(void *cls, const struct GNUNET_PeerIdentity *id, 202do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
206 const struct GNUNET_CONFIGURATION_Handle *cfg, 203 const struct GNUNET_CONFIGURATION_Handle *_cfg,
207 struct GNUNET_TESTING_Daemon *d, const char *emsg) 204 struct GNUNET_TESTING_Daemon *d, const char *emsg)
208{ 205{
209 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey; 206 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey;
@@ -213,6 +210,8 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
213 struct GNUNET_CRYPTO_RsaSignature *sig; 210 struct GNUNET_CRYPTO_RsaSignature *sig;
214 char* alice_keyfile; 211 char* alice_keyfile;
215 212
213 cfg = _cfg;
214
216 GNUNET_SCHEDULER_cancel (die_task); 215 GNUNET_SCHEDULER_cancel (die_task);
217 216
218 /* put records into namestore */ 217 /* put records into namestore */
@@ -301,8 +300,9 @@ run (void *cls, char *const *args, const char *cfgfile,
301 "didn't start all daemons in reasonable amount of time!!!"); 300 "didn't start all daemons in reasonable amount of time!!!");
302 301
303 /* Start alice */ 302 /* Start alice */
304 d1 = GNUNET_TESTING_daemon_start(cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, 303 pg = GNUNET_TESTING_daemons_start(cfg, 1, 1, 1, TIMEOUT,
305 NULL, NULL, NULL, &do_lookup, NULL); 304 NULL, NULL, &do_lookup, NULL,
305 NULL, NULL, NULL);
306} 306}
307 307
308static int 308static int