aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing.c')
-rw-r--r--src/testing/testing.c63
1 files changed, 27 insertions, 36 deletions
diff --git a/src/testing/testing.c b/src/testing/testing.c
index c107ec593..3a712f071 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -164,8 +164,8 @@ process_hello (void *cls, const struct GNUNET_MessageHeader *message)
164#endif 164#endif
165} 165}
166 166
167static void start_fsm (void *cls, 167static void
168 const struct GNUNET_SCHEDULER_TaskContext *tc); 168start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
169 169
170#if WAIT_FOR_HELLO 170#if WAIT_FOR_HELLO
171/** 171/**
@@ -195,10 +195,9 @@ testing_init (void *cls, struct GNUNET_CORE_Handle *server,
195 d->server = NULL; 195 d->server = NULL;
196 if (GNUNET_YES == d->dead) 196 if (GNUNET_YES == d->dead)
197 GNUNET_TESTING_daemon_stop (d, 197 GNUNET_TESTING_daemon_stop (d,
198 GNUNET_TIME_absolute_get_remaining (d-> 198 GNUNET_TIME_absolute_get_remaining
199 max_timeout), 199 (d->max_timeout), d->dead_cb, d->dead_cb_cls,
200 d->dead_cb, d->dead_cb_cls, GNUNET_YES, 200 GNUNET_YES, GNUNET_NO);
201 GNUNET_NO);
202 else if (NULL != d->cb) 201 else if (NULL != d->cb)
203 d->cb (d->cb_cls, NULL, d->cfg, d, 202 d->cb (d->cb_cls, NULL, d->cfg, d,
204 _("Failed to connect to core service\n")); 203 _("Failed to connect to core service\n"));
@@ -233,10 +232,9 @@ testing_init (void *cls, struct GNUNET_CORE_Handle *server,
233 { 232 {
234 if (GNUNET_YES == d->dead) 233 if (GNUNET_YES == d->dead)
235 GNUNET_TESTING_daemon_stop (d, 234 GNUNET_TESTING_daemon_stop (d,
236 GNUNET_TIME_absolute_get_remaining (d-> 235 GNUNET_TIME_absolute_get_remaining
237 max_timeout), 236 (d->max_timeout), d->dead_cb, d->dead_cb_cls,
238 d->dead_cb, d->dead_cb_cls, GNUNET_YES, 237 GNUNET_YES, GNUNET_NO);
239 GNUNET_NO);
240 else if (NULL != d->cb) 238 else if (NULL != d->cb)
241 d->cb (d->cb_cls, &d->id, d->cfg, d, 239 d->cb (d->cb_cls, &d->id, d->cfg, d,
242 _("Failed to connect to transport service!\n")); 240 _("Failed to connect to transport service!\n"));
@@ -349,8 +347,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
349 if (NULL != cb) 347 if (NULL != cb)
350 cb (d->cb_cls, NULL, d->cfg, d, 348 cb (d->cb_cls, NULL, d->cfg, d,
351 (NULL == 349 (NULL ==
352 d-> 350 d->hostname) ?
353 hostname) ?
354 _("Failed to create pipe for `gnunet-peerinfo' process.\n") : 351 _("Failed to create pipe for `gnunet-peerinfo' process.\n") :
355 _("Failed to create pipe for `ssh' process.\n")); 352 _("Failed to create pipe for `ssh' process.\n"));
356 return; 353 return;
@@ -415,9 +412,8 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
415 if (NULL != cb) 412 if (NULL != cb)
416 cb (d->cb_cls, NULL, d->cfg, d, 413 cb (d->cb_cls, NULL, d->cfg, d,
417 (NULL == 414 (NULL ==
418 d-> 415 d->hostname) ? _("Failed to start `gnunet-peerinfo' process.\n")
419 hostname) ? _("Failed to start `gnunet-peerinfo' process.\n") : 416 : _("Failed to start `ssh' process.\n"));
420 _("Failed to start `ssh' process.\n"));
421 GNUNET_DISK_pipe_close (d->pipe_stdout); 417 GNUNET_DISK_pipe_close (d->pipe_stdout);
422 return; 418 return;
423 } 419 }
@@ -429,9 +425,9 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
429 d->task = 425 d->task =
430 GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_absolute_get_remaining 426 GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_absolute_get_remaining
431 (d->max_timeout), 427 (d->max_timeout),
432 GNUNET_DISK_pipe_handle (d-> 428 GNUNET_DISK_pipe_handle
433 pipe_stdout, 429 (d->pipe_stdout,
434 GNUNET_DISK_PIPE_END_READ), 430 GNUNET_DISK_PIPE_END_READ),
435 &start_fsm, d); 431 &start_fsm, d);
436 } 432 }
437 else /* Already have a hostkey! */ 433 else /* Already have a hostkey! */
@@ -464,9 +460,9 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
464 d->task = 460 d->task =
465 GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_absolute_get_remaining 461 GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_absolute_get_remaining
466 (d->max_timeout), 462 (d->max_timeout),
467 GNUNET_DISK_pipe_handle (d-> 463 GNUNET_DISK_pipe_handle
468 pipe_stdout, 464 (d->pipe_stdout,
469 GNUNET_DISK_PIPE_END_READ), 465 GNUNET_DISK_PIPE_END_READ),
470 &start_fsm, d); 466 &start_fsm, d);
471 return; 467 return;
472 } 468 }
@@ -614,8 +610,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
614 if (NULL != cb) 610 if (NULL != cb)
615 cb (d->cb_cls, NULL, d->cfg, d, 611 cb (d->cb_cls, NULL, d->cfg, d,
616 (NULL == 612 (NULL ==
617 d-> 613 d->hostname) ? _("Failed to start `gnunet-arm' process.\n") :
618 hostname) ? _("Failed to start `gnunet-arm' process.\n") :
619 _("Failed to start `ssh' process.\n")); 614 _("Failed to start `ssh' process.\n"));
620 return; 615 return;
621 } 616 }
@@ -639,8 +634,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
639 if (NULL != cb) 634 if (NULL != cb)
640 cb (d->cb_cls, NULL, d->cfg, d, 635 cb (d->cb_cls, NULL, d->cfg, d,
641 (NULL == 636 (NULL ==
642 d-> 637 d->hostname) ? _("`gnunet-arm' does not seem to terminate.\n") :
643 hostname) ? _("`gnunet-arm' does not seem to terminate.\n") :
644 _("`ssh' does not seem to terminate.\n")); 638 _("`ssh' does not seem to terminate.\n"));
645 GNUNET_CONFIGURATION_destroy (d->cfg); 639 GNUNET_CONFIGURATION_destroy (d->cfg);
646 GNUNET_free (d->cfgfile); 640 GNUNET_free (d->cfgfile);
@@ -698,10 +692,9 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
698 { 692 {
699 if (GNUNET_YES == d->dead) 693 if (GNUNET_YES == d->dead)
700 GNUNET_TESTING_daemon_stop (d, 694 GNUNET_TESTING_daemon_stop (d,
701 GNUNET_TIME_absolute_get_remaining (d-> 695 GNUNET_TIME_absolute_get_remaining
702 max_timeout), 696 (d->max_timeout), d->dead_cb,
703 d->dead_cb, d->dead_cb_cls, GNUNET_YES, 697 d->dead_cb_cls, GNUNET_YES, GNUNET_NO);
704 GNUNET_NO);
705 else if (NULL != d->cb) 698 else if (NULL != d->cb)
706 d->cb (d->cb_cls, &d->id, d->cfg, d, 699 d->cb (d->cb_cls, &d->id, d->cfg, d,
707 _("Failed to connect to transport service!\n")); 700 _("Failed to connect to transport service!\n"));
@@ -763,8 +756,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
763 if (NULL != cb) 756 if (NULL != cb)
764 cb (d->cb_cls, NULL, d->cfg, d, 757 cb (d->cb_cls, NULL, d->cfg, d,
765 (NULL == 758 (NULL ==
766 d-> 759 d->hostname) ? _("`gnunet-arm' does not seem to terminate.\n") :
767 hostname) ? _("`gnunet-arm' does not seem to terminate.\n") :
768 _("`ssh' does not seem to terminate.\n")); 760 _("`ssh' does not seem to terminate.\n"));
769 return; 761 return;
770 } 762 }
@@ -782,8 +774,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
782 if (NULL != cb) 774 if (NULL != cb)
783 cb (d->cb_cls, NULL, d->cfg, d, 775 cb (d->cb_cls, NULL, d->cfg, d,
784 (NULL == 776 (NULL ==
785 d-> 777 d->hostname) ?
786 hostname) ?
787 _ 778 _
788 ("`gnunet-arm' terminated with non-zero exit status (or timed out)!\n") 779 ("`gnunet-arm' terminated with non-zero exit status (or timed out)!\n")
789 : _("`ssh' does not seem to terminate.\n")); 780 : _("`ssh' does not seem to terminate.\n"));
@@ -1946,9 +1937,9 @@ struct ConnectContext
1946 1937
1947 1938
1948/** Forward declaration **/ 1939/** Forward declaration **/
1949static void reattempt_daemons_connect (void *cls, 1940static void
1950 const struct GNUNET_SCHEDULER_TaskContext 1941reattempt_daemons_connect (void *cls,
1951 *tc); 1942 const struct GNUNET_SCHEDULER_TaskContext *tc);
1952 1943
1953 1944
1954/** 1945/**