diff options
Diffstat (limited to 'src/testing/test_testing_group.c')
-rw-r--r-- | src/testing/test_testing_group.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/testing/test_testing_group.c b/src/testing/test_testing_group.c index 1f21b64f4..61ef82449 100644 --- a/src/testing/test_testing_group.c +++ b/src/testing/test_testing_group.c | |||
@@ -24,13 +24,14 @@ | |||
24 | #include "platform.h" | 24 | #include "platform.h" |
25 | #include "gnunet_testing_lib.h" | 25 | #include "gnunet_testing_lib.h" |
26 | 26 | ||
27 | #define VERBOSE GNUNET_NO | 27 | #define VERBOSE GNUNET_YES |
28 | 28 | ||
29 | #define NUM_PEERS 4 | ||
29 | 30 | ||
30 | /** | 31 | /** |
31 | * How long until we give up on connecting the peers? | 32 | * How long until we give up on connecting the peers? |
32 | */ | 33 | */ |
33 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) | 34 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 300) |
34 | 35 | ||
35 | 36 | ||
36 | static int ok; | 37 | static int ok; |
@@ -48,10 +49,17 @@ my_cb (void *cls, | |||
48 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 49 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
49 | struct GNUNET_TESTING_Daemon *d, const char *emsg) | 50 | struct GNUNET_TESTING_Daemon *d, const char *emsg) |
50 | { | 51 | { |
51 | GNUNET_assert (id != NULL); | 52 | if (id == NULL) |
53 | { | ||
54 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Start callback called with error (too long starting peers), aborting test!\n"); | ||
55 | GNUNET_TESTING_daemons_stop (pg); | ||
56 | ok = 7; | ||
57 | } | ||
52 | peers_left--; | 58 | peers_left--; |
53 | if (peers_left == 0) | 59 | if (peers_left == 0) |
54 | { | 60 | { |
61 | sleep(2); /* Give other services a chance to initialize before killing */ | ||
62 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers started successfully, ending test!\n"); | ||
55 | GNUNET_TESTING_daemons_stop (pg); | 63 | GNUNET_TESTING_daemons_stop (pg); |
56 | ok = 0; | 64 | ok = 0; |
57 | } | 65 | } |
@@ -69,7 +77,7 @@ run (void *cls, | |||
69 | #if VERBOSE | 77 | #if VERBOSE |
70 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting daemons.\n"); | 78 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting daemons.\n"); |
71 | #endif | 79 | #endif |
72 | peers_left = 8; | 80 | peers_left = NUM_PEERS; |
73 | pg = GNUNET_TESTING_daemons_start (sched, cfg, | 81 | pg = GNUNET_TESTING_daemons_start (sched, cfg, |
74 | peers_left, | 82 | peers_left, |
75 | &my_cb, NULL, NULL, NULL, NULL); | 83 | &my_cb, NULL, NULL, NULL, NULL); |