aboutsummaryrefslogtreecommitdiff
path: root/src/testing/test_testing_connect.c
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-05-09 15:55:32 +0000
committerNathan S. Evans <evans@in.tum.de>2010-05-09 15:55:32 +0000
commitb94fa4e20a07cddbd1a4fbff283c0d7f6f4a88f9 (patch)
tree2696fdc5962ba6b38e6169b8cf23cee07772077a /src/testing/test_testing_connect.c
parentca3d4f99562556e22eeac7f7f198ff12941a9e1e (diff)
downloadgnunet-b94fa4e20a07cddbd1a4fbff283c0d7f6f4a88f9.tar.gz
gnunet-b94fa4e20a07cddbd1a4fbff283c0d7f6f4a88f9.zip
changes to testing... create hostkey using peerinfo before starting peers, better topology creation and more options therein, changes to order of starting peers, connecting peers... new order is hostkey create, topology create, blacklist create, start peers, connect peers
Diffstat (limited to 'src/testing/test_testing_connect.c')
-rw-r--r--src/testing/test_testing_connect.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/testing/test_testing_connect.c b/src/testing/test_testing_connect.c
index 60721298e..a55207cec 100644
--- a/src/testing/test_testing_connect.c
+++ b/src/testing/test_testing_connect.c
@@ -49,26 +49,34 @@ static struct GNUNET_SCHEDULER_Handle *sched;
49static void 49static void
50end2_cb (void *cls, const char *emsg) 50end2_cb (void *cls, const char *emsg)
51{ 51{
52 GNUNET_assert (emsg == NULL); 52
53 if (emsg != NULL)
54 {
55 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Ending with error: %s\n", emsg);
56 ok = 1;
57 }
58 else
59 {
53#if VERBOSE 60#if VERBOSE
54 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 61 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
55 "Both daemons terminated, will now exit.\n"); 62 "Both daemons terminated, will now exit.\n");
56#endif 63#endif
57 ok = 0; 64 ok = 0;
65 }
58} 66}
59 67
60static void 68static void
61end1_cb (void *cls, const char *emsg) 69end1_cb (void *cls, const char *emsg)
62{ 70{
63 GNUNET_assert (emsg == NULL); 71 GNUNET_assert (emsg == NULL);
64 GNUNET_TESTING_daemon_stop (d2, &end2_cb, NULL); 72 GNUNET_TESTING_daemon_stop (d2, &end2_cb, NULL, GNUNET_YES);
65 d2 = NULL; 73 d2 = NULL;
66} 74}
67 75
68static void 76static void
69finish_testing(void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) 77finish_testing(void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc)
70{ 78{
71 GNUNET_TESTING_daemon_stop (d1, &end1_cb, NULL); 79 GNUNET_TESTING_daemon_stop (d1, &end1_cb, NULL, GNUNET_YES);
72 d1 = NULL; 80 d1 = NULL;
73} 81}
74 82
@@ -113,7 +121,7 @@ my_cb1 (void *cls,
113 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 121 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
114 "Daemon `%s' started.\n", GNUNET_i2s (id)); 122 "Daemon `%s' started.\n", GNUNET_i2s (id));
115#endif 123#endif
116 d2 = GNUNET_TESTING_daemon_start (sched, c2, NULL, &my_cb2, NULL); 124 d2 = GNUNET_TESTING_daemon_start (sched, c2, NULL, NULL, NULL, &my_cb2, NULL);
117 GNUNET_assert (d2 != NULL); 125 GNUNET_assert (d2 != NULL);
118 126
119} 127}
@@ -134,7 +142,7 @@ run (void *cls,
134 GNUNET_CONFIGURATION_parse (c1, "test_testing_connect_peer1.conf"); 142 GNUNET_CONFIGURATION_parse (c1, "test_testing_connect_peer1.conf");
135 c2 = GNUNET_CONFIGURATION_create (); 143 c2 = GNUNET_CONFIGURATION_create ();
136 GNUNET_CONFIGURATION_parse (c2, "test_testing_connect_peer2.conf"); 144 GNUNET_CONFIGURATION_parse (c2, "test_testing_connect_peer2.conf");
137 d1 = GNUNET_TESTING_daemon_start (sched, c1, NULL, &my_cb1, NULL); 145 d1 = GNUNET_TESTING_daemon_start (sched, c1, NULL, NULL, NULL, &my_cb1, NULL);
138 GNUNET_assert (d1 != NULL); 146 GNUNET_assert (d1 != NULL);
139} 147}
140 148