diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-05-06 18:04:22 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-05-06 18:04:22 +0000 |
commit | 5c748fe953690879274eb47049089dd4e6f85810 (patch) | |
tree | 55b76192ed10fe8c88e82fcb79a7376559fd58ef | |
parent | 98ebd9b7431b176365a8cd7352b43ad306d3e1ad (diff) | |
download | gnunet-5c748fe953690879274eb47049089dd4e6f85810.tar.gz gnunet-5c748fe953690879274eb47049089dd4e6f85810.zip |
-more to remove
-rw-r--r-- | src/testing/test_testing_topology.c | 59 | ||||
-rw-r--r-- | src/testing/test_testing_topology_churn.c | 28 | ||||
-rw-r--r-- | src/testing/testing.c | 9 |
3 files changed, 4 insertions, 92 deletions
diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c index 112838f2f..fe616906e 100644 --- a/src/testing/test_testing_topology.c +++ b/src/testing/test_testing_topology.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include "gnunet_core_service.h" | 26 | #include "gnunet_core_service.h" |
27 | #include "gnunet_os_lib.h" | 27 | #include "gnunet_os_lib.h" |
28 | 28 | ||
29 | #define VERBOSE GNUNET_NO | ||
30 | 29 | ||
31 | #define PROGRESS_BARS GNUNET_YES | 30 | #define PROGRESS_BARS GNUNET_YES |
32 | 31 | ||
@@ -172,17 +171,13 @@ shutdown_callback (void *cls, const char *emsg) | |||
172 | { | 171 | { |
173 | if (emsg != NULL) | 172 | if (emsg != NULL) |
174 | { | 173 | { |
175 | #if VERBOSE | ||
176 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown of peers failed!\n"); | 174 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown of peers failed!\n"); |
177 | #endif | ||
178 | if (ok == 0) | 175 | if (ok == 0) |
179 | ok = 666; | 176 | ok = 666; |
180 | } | 177 | } |
181 | else | 178 | else |
182 | { | 179 | { |
183 | #if VERBOSE | ||
184 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers successfully shut down!\n"); | 180 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers successfully shut down!\n"); |
185 | #endif | ||
186 | } | 181 | } |
187 | } | 182 | } |
188 | 183 | ||
@@ -213,11 +208,8 @@ finish_testing () | |||
213 | struct TestMessageContext *pos; | 208 | struct TestMessageContext *pos; |
214 | struct TestMessageContext *free_pos; | 209 | struct TestMessageContext *free_pos; |
215 | 210 | ||
216 | #if VERBOSE | ||
217 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 211 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
218 | "Called finish testing, stopping daemons.\n"); | 212 | "Called finish testing, stopping daemons.\n"); |
219 | #endif | ||
220 | |||
221 | pos = test_messages; | 213 | pos = test_messages; |
222 | while (pos != NULL) | 214 | while (pos != NULL) |
223 | { | 215 | { |
@@ -239,16 +231,11 @@ finish_testing () | |||
239 | } | 231 | } |
240 | GNUNET_free (free_pos); | 232 | GNUNET_free (free_pos); |
241 | } | 233 | } |
242 | #if VERBOSE | ||
243 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 234 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
244 | "Transmit_ready's scheduled %d, failed %d, transmit_ready's called %d\n", | 235 | "Transmit_ready's scheduled %d, failed %d, transmit_ready's called %d\n", |
245 | transmit_ready_scheduled, transmit_ready_failed, | 236 | transmit_ready_scheduled, transmit_ready_failed, |
246 | transmit_ready_called); | 237 | transmit_ready_called); |
247 | #endif | ||
248 | |||
249 | #if VERBOSE | ||
250 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Calling daemons_stop\n"); | 238 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Calling daemons_stop\n"); |
251 | #endif | ||
252 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); | 239 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); |
253 | 240 | ||
254 | if (dotOutFile != NULL) | 241 | if (dotOutFile != NULL) |
@@ -267,16 +254,12 @@ disconnect_cores (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
267 | struct TestMessageContext *pos = cls; | 254 | struct TestMessageContext *pos = cls; |
268 | 255 | ||
269 | /* Disconnect from the respective cores */ | 256 | /* Disconnect from the respective cores */ |
270 | #if VERBOSE > 1 | ||
271 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from peer 1 `%4s'\n", | 257 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from peer 1 `%4s'\n", |
272 | GNUNET_i2s (&pos->peer1->id)); | 258 | GNUNET_i2s (&pos->peer1->id)); |
273 | #endif | ||
274 | if (pos->peer1handle != NULL) | 259 | if (pos->peer1handle != NULL) |
275 | GNUNET_CORE_disconnect (pos->peer1handle); | 260 | GNUNET_CORE_disconnect (pos->peer1handle); |
276 | #if VERBOSE > 1 | ||
277 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from peer 2 `%4s'\n", | 261 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from peer 2 `%4s'\n", |
278 | GNUNET_i2s (&pos->peer2->id)); | 262 | GNUNET_i2s (&pos->peer2->id)); |
279 | #endif | ||
280 | if (pos->peer2handle != NULL) | 263 | if (pos->peer2handle != NULL) |
281 | GNUNET_CORE_disconnect (pos->peer2handle); | 264 | GNUNET_CORE_disconnect (pos->peer2handle); |
282 | /* Set handles to NULL so test case can be ended properly */ | 265 | /* Set handles to NULL so test case can be ended properly */ |
@@ -382,14 +365,12 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
382 | 365 | ||
383 | total_messages_received++; | 366 | total_messages_received++; |
384 | 367 | ||
385 | #if VERBOSE > 1 | ||
386 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 368 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
387 | "Received message from `%4s', type %d.\n", GNUNET_i2s (peer), | 369 | "Received message from `%4s', type %d.\n", GNUNET_i2s (peer), |
388 | ntohs (message->type)); | 370 | ntohs (message->type)); |
389 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 371 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
390 | "Total messages received %d, expected %d.\n", | 372 | "Total messages received %d, expected %d.\n", |
391 | total_messages_received, expected_messages); | 373 | total_messages_received, expected_messages); |
392 | #endif | ||
393 | 374 | ||
394 | if (total_messages_received == expected_messages) | 375 | if (total_messages_received == expected_messages) |
395 | { | 376 | { |
@@ -444,7 +425,6 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
444 | GNUNET_free (free_pos); | 425 | GNUNET_free (free_pos); |
445 | } | 426 | } |
446 | 427 | ||
447 | #if VERBOSE | ||
448 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 428 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
449 | "Transmit_ready's scheduled %d, failed %d, transmit_ready's called %d\n", | 429 | "Transmit_ready's scheduled %d, failed %d, transmit_ready's called %d\n", |
450 | transmit_ready_scheduled, transmit_ready_failed, | 430 | transmit_ready_scheduled, transmit_ready_failed, |
@@ -452,7 +432,6 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
452 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 432 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
453 | "Total messages received %d, expected %d.\n", | 433 | "Total messages received %d, expected %d.\n", |
454 | total_messages_received, expected_messages); | 434 | total_messages_received, expected_messages); |
455 | #endif | ||
456 | 435 | ||
457 | if (pg != NULL) | 436 | if (pg != NULL) |
458 | { | 437 | { |
@@ -481,12 +460,10 @@ transmit_ready (void *cls, size_t size, void *buf) | |||
481 | m->header.size = htons (sizeof (struct GNUNET_TestMessage)); | 460 | m->header.size = htons (sizeof (struct GNUNET_TestMessage)); |
482 | m->uid = htonl (pos->uid); | 461 | m->uid = htonl (pos->uid); |
483 | transmit_ready_called++; | 462 | transmit_ready_called++; |
484 | #if VERBOSE > 1 | ||
485 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 463 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
486 | "transmit ready for peer %s\ntransmit_ready's scheduled %d, transmit_ready's called %d\n", | 464 | "transmit ready for peer %s\ntransmit_ready's scheduled %d, transmit_ready's called %d\n", |
487 | GNUNET_i2s (&pos->peer1->id), transmit_ready_scheduled, | 465 | GNUNET_i2s (&pos->peer1->id), transmit_ready_scheduled, |
488 | transmit_ready_called); | 466 | transmit_ready_called); |
489 | #endif | ||
490 | return sizeof (struct GNUNET_TestMessage); | 467 | return sizeof (struct GNUNET_TestMessage); |
491 | } | 468 | } |
492 | 469 | ||
@@ -511,12 +488,10 @@ init_notify_peer2 (void *cls, struct GNUNET_CORE_Handle *server, | |||
511 | pos->peer2connected = GNUNET_YES; | 488 | pos->peer2connected = GNUNET_YES; |
512 | if (pos->peer1notified == GNUNET_YES) /* Peer 1 has been notified of connection to peer 2 */ | 489 | if (pos->peer1notified == GNUNET_YES) /* Peer 1 has been notified of connection to peer 2 */ |
513 | { | 490 | { |
514 | #if VERBOSE > 1 | ||
515 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 491 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
516 | "Scheduling message send to peer `%s' from peer `%s' (init_notify_peer2)\n", | 492 | "Scheduling message send to peer `%s' from peer `%s' (init_notify_peer2)\n", |
517 | GNUNET_i2s (my_identity), | 493 | GNUNET_i2s (my_identity), |
518 | GNUNET_h2s (&pos->peer1->id.hashPubKey)); | 494 | GNUNET_h2s (&pos->peer1->id.hashPubKey)); |
519 | #endif | ||
520 | if (NULL == | 495 | if (NULL == |
521 | GNUNET_CORE_notify_transmit_ready (pos->peer1handle, GNUNET_YES, 0, | 496 | GNUNET_CORE_notify_transmit_ready (pos->peer1handle, GNUNET_YES, 0, |
522 | TIMEOUT, &pos->peer2->id, | 497 | TIMEOUT, &pos->peer2->id, |
@@ -553,23 +528,19 @@ connect_notify_peers (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
553 | if (0 == memcmp (peer, &pos->peer2->id, sizeof (struct GNUNET_PeerIdentity))) | 528 | if (0 == memcmp (peer, &pos->peer2->id, sizeof (struct GNUNET_PeerIdentity))) |
554 | { | 529 | { |
555 | pos->peer1notified = GNUNET_YES; | 530 | pos->peer1notified = GNUNET_YES; |
556 | #if VERBOSE > 1 | ||
557 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 531 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
558 | "Peer `%s' notified of connection to peer `%s'\n", | 532 | "Peer `%s' notified of connection to peer `%s'\n", |
559 | GNUNET_i2s (&pos->peer1->id), GNUNET_h2s (&peer->hashPubKey)); | 533 | GNUNET_i2s (&pos->peer1->id), GNUNET_h2s (&peer->hashPubKey)); |
560 | #endif | ||
561 | } | 534 | } |
562 | else | 535 | else |
563 | return; | 536 | return; |
564 | 537 | ||
565 | if (pos->peer2connected == GNUNET_YES) /* Already connected and notified of connection, send message! */ | 538 | if (pos->peer2connected == GNUNET_YES) /* Already connected and notified of connection, send message! */ |
566 | { | 539 | { |
567 | #if VERBOSE > 1 | ||
568 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 540 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
569 | "Scheduling message send to peer `%s' from peer `%s' (init_notify_peer2)\n", | 541 | "Scheduling message send to peer `%s' from peer `%s' (init_notify_peer2)\n", |
570 | GNUNET_i2s (&pos->peer2->id), | 542 | GNUNET_i2s (&pos->peer2->id), |
571 | GNUNET_h2s (&pos->peer1->id.hashPubKey)); | 543 | GNUNET_h2s (&pos->peer1->id.hashPubKey)); |
572 | #endif | ||
573 | if (NULL == | 544 | if (NULL == |
574 | GNUNET_CORE_notify_transmit_ready (pos->peer1handle, GNUNET_YES, 0, | 545 | GNUNET_CORE_notify_transmit_ready (pos->peer1handle, GNUNET_YES, 0, |
575 | TIMEOUT, &pos->peer2->id, | 546 | TIMEOUT, &pos->peer2->id, |
@@ -596,12 +567,9 @@ init_notify_peer1 (void *cls, struct GNUNET_CORE_Handle *server, | |||
596 | 567 | ||
597 | total_server_connections++; | 568 | total_server_connections++; |
598 | 569 | ||
599 | #if VERBOSE > 1 | ||
600 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 570 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
601 | "Core connection to `%4s' established, setting up handles\n", | 571 | "Core connection to `%4s' established, setting up handles\n", |
602 | GNUNET_i2s (my_identity)); | 572 | GNUNET_i2s (my_identity)); |
603 | #endif | ||
604 | |||
605 | /* | 573 | /* |
606 | * Connect to the receiving peer | 574 | * Connect to the receiving peer |
607 | */ | 575 | */ |
@@ -694,10 +662,8 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, | |||
694 | fflush (stdout); | 662 | fflush (stdout); |
695 | #endif | 663 | #endif |
696 | total_connections++; | 664 | total_connections++; |
697 | #if VERBOSE > 1 | ||
698 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "connected peer %s to peer %s\n", | 665 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "connected peer %s to peer %s\n", |
699 | first_daemon->shortname, second_daemon->shortname); | 666 | first_daemon->shortname, second_daemon->shortname); |
700 | #endif | ||
701 | temp_context = GNUNET_malloc (sizeof (struct TestMessageContext)); | 667 | temp_context = GNUNET_malloc (sizeof (struct TestMessageContext)); |
702 | temp_context->peer1 = first_daemon; | 668 | temp_context->peer1 = first_daemon; |
703 | temp_context->peer2 = second_daemon; | 669 | temp_context->peer2 = second_daemon; |
@@ -711,7 +677,6 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, | |||
711 | FPRINTF (dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname, | 677 | FPRINTF (dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname, |
712 | second_daemon->shortname); | 678 | second_daemon->shortname); |
713 | } | 679 | } |
714 | #if VERBOSE | ||
715 | else | 680 | else |
716 | { | 681 | { |
717 | failed_connections++; | 682 | failed_connections++; |
@@ -719,18 +684,15 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, | |||
719 | "Failed to connect peer %s to peer %s with error :\n%s\n", | 684 | "Failed to connect peer %s to peer %s with error :\n%s\n", |
720 | first_daemon->shortname, second_daemon->shortname, emsg); | 685 | first_daemon->shortname, second_daemon->shortname, emsg); |
721 | } | 686 | } |
722 | #endif | ||
723 | 687 | ||
724 | if (total_connections == expected_connections) | 688 | if (total_connections == expected_connections) |
725 | { | 689 | { |
726 | #if PROGRESS_BARS | 690 | #if PROGRESS_BARS |
727 | FPRINTF (stdout, "%s", "100%%]\n"); | 691 | FPRINTF (stdout, "%s", "100%%]\n"); |
728 | #endif | 692 | #endif |
729 | #if VERBOSE | ||
730 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 693 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
731 | "Created %d total connections, which is our target number! Calling send messages.\n", | 694 | "Created %d total connections, which is our target number! Calling send messages.\n", |
732 | total_connections); | 695 | total_connections); |
733 | #endif | ||
734 | modnum = expected_messages / 4; | 696 | modnum = expected_messages / 4; |
735 | dotnum = (expected_messages / 50) + 1; | 697 | dotnum = (expected_messages / 50) + 1; |
736 | if (modnum == 0) | 698 | if (modnum == 0) |
@@ -777,24 +739,20 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, | |||
777 | } | 739 | } |
778 | else | 740 | else |
779 | { | 741 | { |
780 | #if VERBOSE > 1 | ||
781 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 742 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
782 | "Have %d total connections, %d failed connections, Want %d (at least %d)\n", | 743 | "Have %d total connections, %d failed connections, Want %d (at least %d)\n", |
783 | total_connections, failed_connections, expected_connections, | 744 | total_connections, failed_connections, expected_connections, |
784 | expected_connections - | 745 | expected_connections - |
785 | (unsigned int) (fail_percentage * expected_connections)); | 746 | (unsigned int) (fail_percentage * expected_connections)); |
786 | #endif | ||
787 | } | 747 | } |
788 | } | 748 | } |
789 | 749 | ||
790 | static void | 750 | static void |
791 | topology_creation_finished (void *cls, const char *emsg) | 751 | topology_creation_finished (void *cls, const char *emsg) |
792 | { | 752 | { |
793 | #if VERBOSE | ||
794 | if (emsg == NULL) | 753 | if (emsg == NULL) |
795 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 754 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
796 | "All topology connections created successfully!\n"); | 755 | "All topology connections created successfully!\n"); |
797 | #endif | ||
798 | } | 756 | } |
799 | 757 | ||
800 | static void | 758 | static void |
@@ -884,10 +842,8 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, | |||
884 | return; | 842 | return; |
885 | } | 843 | } |
886 | GNUNET_assert (id != NULL); | 844 | GNUNET_assert (id != NULL); |
887 | #if VERBOSE > 1 | ||
888 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Started daemon %llu out of %llu\n", | 845 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Started daemon %llu out of %llu\n", |
889 | (num_peers - peers_left) + 1, num_peers); | 846 | (num_peers - peers_left) + 1, num_peers); |
890 | #endif | ||
891 | #if PROGRESS_BARS | 847 | #if PROGRESS_BARS |
892 | if ((num_peers - peers_left) % modnum == 0) | 848 | if ((num_peers - peers_left) % modnum == 0) |
893 | { | 849 | { |
@@ -910,10 +866,8 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, | |||
910 | #if PROGRESS_BARS | 866 | #if PROGRESS_BARS |
911 | FPRINTF (stdout, "%s", "100%%]\n"); | 867 | FPRINTF (stdout, "%s", "100%%]\n"); |
912 | #endif | 868 | #endif |
913 | #if VERBOSE | ||
914 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 869 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
915 | "All %d daemons started, now connecting peers!\n", num_peers); | 870 | "All %d daemons started, now connecting peers!\n", num_peers); |
916 | #endif | ||
917 | GNUNET_SCHEDULER_cancel (die_task); | 871 | GNUNET_SCHEDULER_cancel (die_task); |
918 | /* Set up task in case topology creation doesn't finish | 872 | /* Set up task in case topology creation doesn't finish |
919 | * within a reasonable amount of time */ | 873 | * within a reasonable amount of time */ |
@@ -952,12 +906,9 @@ hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, | |||
952 | "Hostkey callback received error: %s\n", emsg); | 906 | "Hostkey callback received error: %s\n", emsg); |
953 | } | 907 | } |
954 | 908 | ||
955 | #if VERBOSE > 1 | ||
956 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 909 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
957 | "Hostkey (%d/%d) created for peer `%s'\n", num_peers - peers_left, | 910 | "Hostkey (%d/%d) created for peer `%s'\n", num_peers - peers_left, |
958 | num_peers, GNUNET_i2s (id)); | 911 | num_peers, GNUNET_i2s (id)); |
959 | #endif | ||
960 | |||
961 | #if PROGRESS_BARS | 912 | #if PROGRESS_BARS |
962 | if ((num_peers - peers_left) % modnum == 0) | 913 | if ((num_peers - peers_left) % modnum == 0) |
963 | { | 914 | { |
@@ -1012,11 +963,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
1012 | FPRINTF (dotOutFile, "%s", "strict graph G {\n"); | 963 | FPRINTF (dotOutFile, "%s", "strict graph G {\n"); |
1013 | } | 964 | } |
1014 | 965 | ||
1015 | #if VERBOSE | ||
1016 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 966 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1017 | "Starting daemons based on config file %s\n", cfgfile); | 967 | "Starting daemons based on config file %s\n", cfgfile); |
1018 | #endif | ||
1019 | |||
1020 | if (GNUNET_YES != | 968 | if (GNUNET_YES != |
1021 | GNUNET_CONFIGURATION_get_value_string (cfg, "paths", "servicehome", | 969 | GNUNET_CONFIGURATION_get_value_string (cfg, "paths", "servicehome", |
1022 | &test_directory)) | 970 | &test_directory)) |
@@ -1192,9 +1140,6 @@ check () | |||
1192 | char *const argv[] = { binary_name, | 1140 | char *const argv[] = { binary_name, |
1193 | "-c", | 1141 | "-c", |
1194 | config_file_name, | 1142 | config_file_name, |
1195 | #if VERBOSE | ||
1196 | "-L", "DEBUG", | ||
1197 | #endif | ||
1198 | NULL | 1143 | NULL |
1199 | }; | 1144 | }; |
1200 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 1145 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
@@ -1238,11 +1183,7 @@ main (int argc, char *argv[]) | |||
1238 | GNUNET_asprintf (&dotOutFileName, "topology_%s.dot", topology_string); | 1183 | GNUNET_asprintf (&dotOutFileName, "topology_%s.dot", topology_string); |
1239 | 1184 | ||
1240 | GNUNET_log_setup (our_binary_name, | 1185 | GNUNET_log_setup (our_binary_name, |
1241 | #if VERBOSE | ||
1242 | "DEBUG", | ||
1243 | #else | ||
1244 | "WARNING", | 1186 | "WARNING", |
1245 | #endif | ||
1246 | NULL); | 1187 | NULL); |
1247 | ret = check (); | 1188 | ret = check (); |
1248 | GNUNET_free (topology_string); | 1189 | GNUNET_free (topology_string); |
diff --git a/src/testing/test_testing_topology_churn.c b/src/testing/test_testing_topology_churn.c index 36120893b..9c0bbf27d 100644 --- a/src/testing/test_testing_topology_churn.c +++ b/src/testing/test_testing_topology_churn.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include "gnunet_testing_lib.h" | 25 | #include "gnunet_testing_lib.h" |
26 | #include "gnunet_core_service.h" | 26 | #include "gnunet_core_service.h" |
27 | 27 | ||
28 | #define VERBOSE GNUNET_YES | ||
29 | 28 | ||
30 | /** | 29 | /** |
31 | * How long until we fail the whole testcase? | 30 | * How long until we fail the whole testcase? |
@@ -83,17 +82,13 @@ shutdown_callback (void *cls, const char *emsg) | |||
83 | { | 82 | { |
84 | if (emsg != NULL) | 83 | if (emsg != NULL) |
85 | { | 84 | { |
86 | #if VERBOSE | ||
87 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown of peers failed!\n"); | 85 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown of peers failed!\n"); |
88 | #endif | ||
89 | if (ok == 0) | 86 | if (ok == 0) |
90 | ok = 666; | 87 | ok = 666; |
91 | } | 88 | } |
92 | else | 89 | else |
93 | { | 90 | { |
94 | #if VERBOSE | ||
95 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers successfully shut down!\n"); | 91 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers successfully shut down!\n"); |
96 | #endif | ||
97 | } | 92 | } |
98 | } | 93 | } |
99 | 94 | ||
@@ -104,20 +99,11 @@ finish_testing () | |||
104 | 99 | ||
105 | if (die_task != GNUNET_SCHEDULER_NO_TASK) | 100 | if (die_task != GNUNET_SCHEDULER_NO_TASK) |
106 | GNUNET_SCHEDULER_cancel (die_task); | 101 | GNUNET_SCHEDULER_cancel (die_task); |
107 | |||
108 | #if VERBOSE | ||
109 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 102 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
110 | "Called finish testing, stopping daemons.\n"); | 103 | "Called finish testing, stopping daemons.\n"); |
111 | #endif | ||
112 | |||
113 | #if VERBOSE | ||
114 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Calling daemons_stop\n"); | 104 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Calling daemons_stop\n"); |
115 | #endif | ||
116 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); | 105 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); |
117 | #if VERBOSE | ||
118 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "daemons_stop finished\n"); | 106 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "daemons_stop finished\n"); |
119 | #endif | ||
120 | |||
121 | ok = 0; | 107 | ok = 0; |
122 | } | 108 | } |
123 | 109 | ||
@@ -212,17 +198,13 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, | |||
212 | return; | 198 | return; |
213 | } | 199 | } |
214 | GNUNET_assert (id != NULL); | 200 | GNUNET_assert (id != NULL); |
215 | #if VERBOSE | ||
216 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Started daemon %llu out of %llu\n", | 201 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Started daemon %llu out of %llu\n", |
217 | (num_peers - peers_left) + 1, num_peers); | 202 | (num_peers - peers_left) + 1, num_peers); |
218 | #endif | ||
219 | peers_left--; | 203 | peers_left--; |
220 | if (peers_left == 0) | 204 | if (peers_left == 0) |
221 | { | 205 | { |
222 | #if VERBOSE | ||
223 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 206 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
224 | "All %d daemons started, now testing churn!\n", num_peers); | 207 | "All %d daemons started, now testing churn!\n", num_peers); |
225 | #endif | ||
226 | GNUNET_SCHEDULER_cancel (die_task); | 208 | GNUNET_SCHEDULER_cancel (die_task); |
227 | /* Set up task in case topology creation doesn't finish | 209 | /* Set up task in case topology creation doesn't finish |
228 | * within a reasonable amount of time */ | 210 | * within a reasonable amount of time */ |
@@ -242,11 +224,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
242 | { | 224 | { |
243 | ok = 1; | 225 | ok = 1; |
244 | 226 | ||
245 | #if VERBOSE | ||
246 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 227 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
247 | "Starting daemons based on config file %s\n", cfgfile); | 228 | "Starting daemons based on config file %s\n", cfgfile); |
248 | #endif | ||
249 | |||
250 | if (GNUNET_YES != | 229 | if (GNUNET_YES != |
251 | GNUNET_CONFIGURATION_get_value_string (cfg, "paths", "servicehome", | 230 | GNUNET_CONFIGURATION_get_value_string (cfg, "paths", "servicehome", |
252 | &test_directory)) | 231 | &test_directory)) |
@@ -295,9 +274,6 @@ check () | |||
295 | char *const argv[] = { "test-testing-topology-churn", | 274 | char *const argv[] = { "test-testing-topology-churn", |
296 | "-c", | 275 | "-c", |
297 | "test_testing_data_topology_churn.conf", | 276 | "test_testing_data_topology_churn.conf", |
298 | #if VERBOSE | ||
299 | "-L", "DEBUG", | ||
300 | #endif | ||
301 | NULL | 277 | NULL |
302 | }; | 278 | }; |
303 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 279 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
@@ -323,11 +299,7 @@ main (int argc, char *argv[]) | |||
323 | int ret; | 299 | int ret; |
324 | 300 | ||
325 | GNUNET_log_setup ("test_testing_topology_churn", | 301 | GNUNET_log_setup ("test_testing_topology_churn", |
326 | #if VERBOSE | ||
327 | "DEBUG", | ||
328 | #else | ||
329 | "WARNING", | 302 | "WARNING", |
330 | #endif | ||
331 | NULL); | 303 | NULL); |
332 | ret = check (); | 304 | ret = check (); |
333 | 305 | ||
diff --git a/src/testing/testing.c b/src/testing/testing.c index b35f597bf..d9956cd66 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c | |||
@@ -410,13 +410,12 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
410 | if (NULL == d->hostname) | 410 | if (NULL == d->hostname) |
411 | { | 411 | { |
412 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 412 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
413 | "Starting `%s', with command `%s %s %s %s %s %s'.\n", | 413 | "Starting `%s', with command `%s %s %s %s'.\n", |
414 | "gnunet-arm", "gnunet-arm", "-c", d->cfgfile, "-L", "DEBUG", | 414 | "gnunet-arm", "gnunet-arm", "-c", d->cfgfile, |
415 | "-s"); | 415 | "-s"); |
416 | d->proc_arm_start = | 416 | d->proc_arm_start = |
417 | GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm", "-c", | 417 | GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-arm", "gnunet-arm", "-c", |
418 | d->cfgfile, | 418 | d->cfgfile, |
419 | "-L", "DEBUG", | ||
420 | "-s", "-q", "-T", | 419 | "-s", "-q", "-T", |
421 | GNUNET_TIME_relative_to_string | 420 | GNUNET_TIME_relative_to_string |
422 | (GNUNET_TIME_absolute_get_remaining | 421 | (GNUNET_TIME_absolute_get_remaining |
@@ -430,9 +429,9 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
430 | dst = GNUNET_strdup (d->hostname); | 429 | dst = GNUNET_strdup (d->hostname); |
431 | 430 | ||
432 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 431 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
433 | "Starting `%s', with command `%s %s %s %s %s %s %s %s'.\n", | 432 | "Starting `%s', with command `%s %s %s %s %s %s %s'.\n", |
434 | "gnunet-arm", "ssh", dst, "gnunet-arm", "-c", d->cfgfile, | 433 | "gnunet-arm", "ssh", dst, "gnunet-arm", "-c", d->cfgfile, |
435 | "-L", "DEBUG", "-s", "-q"); | 434 | "-s", "-q"); |
436 | if (d->ssh_port_str == NULL) | 435 | if (d->ssh_port_str == NULL) |
437 | { | 436 | { |
438 | d->proc_arm_start = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh", | 437 | d->proc_arm_start = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh", |