diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:54:06 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:54:06 +0000 |
commit | 5746309cb4be2073d550ad7a6885e918631dbc38 (patch) | |
tree | 89455bc4aadf977816b38df13f990372cd81d71a /src/testing/test_testing_topology.c | |
parent | 6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff) | |
download | gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip |
indentation
Diffstat (limited to 'src/testing/test_testing_topology.c')
-rw-r--r-- | src/testing/test_testing_topology.c | 208 |
1 files changed, 89 insertions, 119 deletions
diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c index 73b49e469..27ad0a24c 100644 --- a/src/testing/test_testing_topology.c +++ b/src/testing/test_testing_topology.c | |||
@@ -193,9 +193,9 @@ gather_log_data () | |||
193 | 193 | ||
194 | GNUNET_asprintf (&peer_number, "%llu", num_peers); | 194 | GNUNET_asprintf (&peer_number, "%llu", num_peers); |
195 | GNUNET_asprintf (&connect_number, "%llu", expected_connections); | 195 | GNUNET_asprintf (&connect_number, "%llu", expected_connections); |
196 | mem_process = GNUNET_OS_start_process (NULL, NULL, "./memsize.pl", | 196 | mem_process = |
197 | "memsize.pl", "totals.txt", | 197 | GNUNET_OS_start_process (NULL, NULL, "./memsize.pl", "memsize.pl", |
198 | peer_number, connect_number, NULL); | 198 | "totals.txt", peer_number, connect_number, NULL); |
199 | GNUNET_OS_process_wait (mem_process); | 199 | GNUNET_OS_process_wait (mem_process); |
200 | GNUNET_OS_process_close (mem_process); | 200 | GNUNET_OS_process_close (mem_process); |
201 | mem_process = NULL; | 201 | mem_process = NULL; |
@@ -265,15 +265,13 @@ disconnect_cores (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
265 | 265 | ||
266 | /* Disconnect from the respective cores */ | 266 | /* Disconnect from the respective cores */ |
267 | #if VERBOSE > 1 | 267 | #if VERBOSE > 1 |
268 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 268 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from peer 1 `%4s'\n", |
269 | "Disconnecting from peer 1 `%4s'\n", | ||
270 | GNUNET_i2s (&pos->peer1->id)); | 269 | GNUNET_i2s (&pos->peer1->id)); |
271 | #endif | 270 | #endif |
272 | if (pos->peer1handle != NULL) | 271 | if (pos->peer1handle != NULL) |
273 | GNUNET_CORE_disconnect (pos->peer1handle); | 272 | GNUNET_CORE_disconnect (pos->peer1handle); |
274 | #if VERBOSE > 1 | 273 | #if VERBOSE > 1 |
275 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 274 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from peer 2 `%4s'\n", |
276 | "Disconnecting from peer 2 `%4s'\n", | ||
277 | GNUNET_i2s (&pos->peer2->id)); | 275 | GNUNET_i2s (&pos->peer2->id)); |
278 | #endif | 276 | #endif |
279 | if (pos->peer2handle != NULL) | 277 | if (pos->peer2handle != NULL) |
@@ -305,20 +303,18 @@ stats_finished (void *cls, int result) | |||
305 | * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration | 303 | * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration |
306 | */ | 304 | */ |
307 | static int | 305 | static int |
308 | stats_print (void *cls, | 306 | stats_print (void *cls, const struct GNUNET_PeerIdentity *peer, |
309 | const struct GNUNET_PeerIdentity *peer, | 307 | const char *subsystem, const char *name, uint64_t value, |
310 | const char *subsystem, | 308 | int is_persistent) |
311 | const char *name, uint64_t value, int is_persistent) | ||
312 | { | 309 | { |
313 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%s:%s:%s -- %llu\n", | 310 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%s:%s:%s -- %llu\n", GNUNET_i2s (peer), |
314 | GNUNET_i2s (peer), subsystem, name, value); | 311 | subsystem, name, value); |
315 | return GNUNET_OK; | 312 | return GNUNET_OK; |
316 | } | 313 | } |
317 | #endif | 314 | #endif |
318 | 315 | ||
319 | static void | 316 | static void |
320 | topology_cb (void *cls, | 317 | topology_cb (void *cls, const struct GNUNET_PeerIdentity *first, |
321 | const struct GNUNET_PeerIdentity *first, | ||
322 | const struct GNUNET_PeerIdentity *second, const char *emsg) | 318 | const struct GNUNET_PeerIdentity *second, const char *emsg) |
323 | { | 319 | { |
324 | FILE *outfile = cls; | 320 | FILE *outfile = cls; |
@@ -350,8 +346,7 @@ topology_cb (void *cls, | |||
350 | } | 346 | } |
351 | 347 | ||
352 | static int | 348 | static int |
353 | process_mtype (void *cls, | 349 | process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, |
354 | const struct GNUNET_PeerIdentity *peer, | ||
355 | const struct GNUNET_MessageHeader *message, | 350 | const struct GNUNET_MessageHeader *message, |
356 | const struct GNUNET_TRANSPORT_ATS_Information *atsi) | 351 | const struct GNUNET_TRANSPORT_ATS_Information *atsi) |
357 | { | 352 | { |
@@ -370,8 +365,8 @@ process_mtype (void *cls, | |||
370 | fprintf (stdout, "0%%"); | 365 | fprintf (stdout, "0%%"); |
371 | else | 366 | else |
372 | fprintf (stdout, "%d%%", | 367 | fprintf (stdout, "%d%%", |
373 | (int) (((float) total_messages_received / | 368 | (int) (((float) total_messages_received / expected_messages) * |
374 | expected_messages) * 100)); | 369 | 100)); |
375 | 370 | ||
376 | } | 371 | } |
377 | else if (total_messages_received % dotnum == 0) | 372 | else if (total_messages_received % dotnum == 0) |
@@ -502,8 +497,7 @@ static struct GNUNET_CORE_MessageHandler handlers[] = { | |||
502 | }; | 497 | }; |
503 | 498 | ||
504 | static void | 499 | static void |
505 | init_notify_peer2 (void *cls, | 500 | init_notify_peer2 (void *cls, struct GNUNET_CORE_Handle *server, |
506 | struct GNUNET_CORE_Handle *server, | ||
507 | const struct GNUNET_PeerIdentity *my_identity, | 501 | const struct GNUNET_PeerIdentity *my_identity, |
508 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 502 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
509 | *publicKey) | 503 | *publicKey) |
@@ -521,14 +515,11 @@ init_notify_peer2 (void *cls, | |||
521 | GNUNET_i2s (my_identity), | 515 | GNUNET_i2s (my_identity), |
522 | GNUNET_h2s (&pos->peer1->id.hashPubKey)); | 516 | GNUNET_h2s (&pos->peer1->id.hashPubKey)); |
523 | #endif | 517 | #endif |
524 | if (NULL == GNUNET_CORE_notify_transmit_ready (pos->peer1handle, | 518 | if (NULL == |
525 | GNUNET_YES, | 519 | GNUNET_CORE_notify_transmit_ready (pos->peer1handle, GNUNET_YES, 0, |
526 | 0, | 520 | TIMEOUT, &pos->peer2->id, |
527 | TIMEOUT, | 521 | sizeof (struct GNUNET_TestMessage), |
528 | &pos->peer2->id, | 522 | &transmit_ready, pos)) |
529 | sizeof (struct | ||
530 | GNUNET_TestMessage), | ||
531 | &transmit_ready, pos)) | ||
532 | { | 523 | { |
533 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 524 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
534 | "RECEIVED NULL when asking core (1) for transmission to peer `%4s'\n", | 525 | "RECEIVED NULL when asking core (1) for transmission to peer `%4s'\n", |
@@ -550,9 +541,7 @@ init_notify_peer2 (void *cls, | |||
550 | * @param atsi performance data for the connection | 541 | * @param atsi performance data for the connection |
551 | */ | 542 | */ |
552 | static void | 543 | static void |
553 | connect_notify_peers (void *cls, | 544 | connect_notify_peers (void *cls, const struct GNUNET_PeerIdentity *peer, |
554 | const struct | ||
555 | GNUNET_PeerIdentity *peer, | ||
556 | const struct GNUNET_TRANSPORT_ATS_Information *atsi) | 545 | const struct GNUNET_TRANSPORT_ATS_Information *atsi) |
557 | { | 546 | { |
558 | struct TestMessageContext *pos = cls; | 547 | struct TestMessageContext *pos = cls; |
@@ -577,14 +566,11 @@ connect_notify_peers (void *cls, | |||
577 | GNUNET_i2s (&pos->peer2->id), | 566 | GNUNET_i2s (&pos->peer2->id), |
578 | GNUNET_h2s (&pos->peer1->id.hashPubKey)); | 567 | GNUNET_h2s (&pos->peer1->id.hashPubKey)); |
579 | #endif | 568 | #endif |
580 | if (NULL == GNUNET_CORE_notify_transmit_ready (pos->peer1handle, | 569 | if (NULL == |
581 | GNUNET_YES, | 570 | GNUNET_CORE_notify_transmit_ready (pos->peer1handle, GNUNET_YES, 0, |
582 | 0, | 571 | TIMEOUT, &pos->peer2->id, |
583 | TIMEOUT, | 572 | sizeof (struct GNUNET_TestMessage), |
584 | &pos->peer2->id, | 573 | &transmit_ready, pos)) |
585 | sizeof (struct | ||
586 | GNUNET_TestMessage), | ||
587 | &transmit_ready, pos)) | ||
588 | { | 574 | { |
589 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 575 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
590 | "RECEIVED NULL when asking core (1) for transmission to peer `%4s'\n", | 576 | "RECEIVED NULL when asking core (1) for transmission to peer `%4s'\n", |
@@ -599,8 +585,7 @@ connect_notify_peers (void *cls, | |||
599 | } | 585 | } |
600 | 586 | ||
601 | static void | 587 | static void |
602 | init_notify_peer1 (void *cls, | 588 | init_notify_peer1 (void *cls, struct GNUNET_CORE_Handle *server, |
603 | struct GNUNET_CORE_Handle *server, | ||
604 | const struct GNUNET_PeerIdentity *my_identity, | 589 | const struct GNUNET_PeerIdentity *my_identity, |
605 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 590 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
606 | *publicKey) | 591 | *publicKey) |
@@ -618,15 +603,10 @@ init_notify_peer1 (void *cls, | |||
618 | /* | 603 | /* |
619 | * Connect to the receiving peer | 604 | * Connect to the receiving peer |
620 | */ | 605 | */ |
621 | pos->peer2handle = GNUNET_CORE_connect (pos->peer2->cfg, | 606 | pos->peer2handle = |
622 | 1, | 607 | GNUNET_CORE_connect (pos->peer2->cfg, 1, pos, &init_notify_peer2, NULL, |
623 | pos, | 608 | NULL, NULL, NULL, GNUNET_YES, NULL, GNUNET_YES, |
624 | &init_notify_peer2, | 609 | handlers); |
625 | NULL, | ||
626 | NULL, | ||
627 | NULL, NULL, | ||
628 | GNUNET_YES, NULL, GNUNET_YES, | ||
629 | handlers); | ||
630 | 610 | ||
631 | } | 611 | } |
632 | 612 | ||
@@ -646,9 +626,9 @@ send_test_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
646 | 626 | ||
647 | if (die_task == GNUNET_SCHEDULER_NO_TASK) | 627 | if (die_task == GNUNET_SCHEDULER_NO_TASK) |
648 | { | 628 | { |
649 | die_task = GNUNET_SCHEDULER_add_delayed (TEST_TIMEOUT, | 629 | die_task = |
650 | &end_badly, | 630 | GNUNET_SCHEDULER_add_delayed (TEST_TIMEOUT, &end_badly, |
651 | "from send test messages (timeout)"); | 631 | "from send test messages (timeout)"); |
652 | } | 632 | } |
653 | 633 | ||
654 | if (total_server_connections >= MAX_OUTSTANDING_CONNECTIONS) | 634 | if (total_server_connections >= MAX_OUTSTANDING_CONNECTIONS) |
@@ -662,15 +642,10 @@ send_test_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
662 | /* | 642 | /* |
663 | * Connect to the sending peer | 643 | * Connect to the sending peer |
664 | */ | 644 | */ |
665 | pos->peer1handle = GNUNET_CORE_connect (pos->peer1->cfg, | 645 | pos->peer1handle = |
666 | 1, | 646 | GNUNET_CORE_connect (pos->peer1->cfg, 1, pos, &init_notify_peer1, |
667 | pos, | 647 | &connect_notify_peers, NULL, NULL, NULL, GNUNET_NO, |
668 | &init_notify_peer1, | 648 | NULL, GNUNET_NO, no_handlers); |
669 | &connect_notify_peers, NULL, | ||
670 | NULL, | ||
671 | NULL, | ||
672 | GNUNET_NO, NULL, GNUNET_NO, | ||
673 | no_handlers); | ||
674 | 649 | ||
675 | GNUNET_assert (pos->peer1handle != NULL); | 650 | GNUNET_assert (pos->peer1handle != NULL); |
676 | 651 | ||
@@ -688,10 +663,8 @@ send_test_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
688 | 663 | ||
689 | 664 | ||
690 | void | 665 | void |
691 | topology_callback (void *cls, | 666 | topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, |
692 | const struct GNUNET_PeerIdentity *first, | 667 | const struct GNUNET_PeerIdentity *second, uint32_t distance, |
693 | const struct GNUNET_PeerIdentity *second, | ||
694 | uint32_t distance, | ||
695 | const struct GNUNET_CONFIGURATION_Handle *first_cfg, | 668 | const struct GNUNET_CONFIGURATION_Handle *first_cfg, |
696 | const struct GNUNET_CONFIGURATION_Handle *second_cfg, | 669 | const struct GNUNET_CONFIGURATION_Handle *second_cfg, |
697 | struct GNUNET_TESTING_Daemon *first_daemon, | 670 | struct GNUNET_TESTING_Daemon *first_daemon, |
@@ -709,8 +682,8 @@ topology_callback (void *cls, | |||
709 | fprintf (stdout, "0%%"); | 682 | fprintf (stdout, "0%%"); |
710 | else | 683 | else |
711 | fprintf (stdout, "%d%%", | 684 | fprintf (stdout, "%d%%", |
712 | (int) (((float) total_connections / | 685 | (int) (((float) total_connections / expected_connections) * |
713 | expected_connections) * 100)); | 686 | 100)); |
714 | 687 | ||
715 | } | 688 | } |
716 | else if (total_connections % dotnum == 0) | 689 | else if (total_connections % dotnum == 0) |
@@ -833,12 +806,11 @@ connect_topology () | |||
833 | GNUNET_TESTING_connect_topology (pg, connection_topology, | 806 | GNUNET_TESTING_connect_topology (pg, connection_topology, |
834 | connect_topology_option, | 807 | connect_topology_option, |
835 | connect_topology_option_modifier, | 808 | connect_topology_option_modifier, |
836 | connect_timeout, | 809 | connect_timeout, connect_attempts, |
837 | connect_attempts, | ||
838 | &topology_creation_finished, NULL); | 810 | &topology_creation_finished, NULL); |
839 | #if PROGRESS_BARS | 811 | #if PROGRESS_BARS |
840 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 812 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Have %d expected connections\n", |
841 | "Have %d expected connections\n", expected_connections); | 813 | expected_connections); |
842 | #endif | 814 | #endif |
843 | } | 815 | } |
844 | 816 | ||
@@ -851,11 +823,12 @@ connect_topology () | |||
851 | return; | 823 | return; |
852 | } | 824 | } |
853 | 825 | ||
854 | die_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply | 826 | die_task = |
855 | (GNUNET_TIME_UNIT_SECONDS, | 827 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply |
856 | SECONDS_PER_PEER_START * num_peers), | 828 | (GNUNET_TIME_UNIT_SECONDS, |
857 | &end_badly, | 829 | SECONDS_PER_PEER_START * num_peers), |
858 | "from connect topology (timeout)"); | 830 | &end_badly, |
831 | "from connect topology (timeout)"); | ||
859 | modnum = expected_connections / 4; | 832 | modnum = expected_connections / 4; |
860 | dotnum = (expected_connections / 50) + 1; | 833 | dotnum = (expected_connections / 50) + 1; |
861 | if (modnum == 0) | 834 | if (modnum == 0) |
@@ -889,17 +862,17 @@ create_topology () | |||
889 | "from create topology (bad return)"); | 862 | "from create topology (bad return)"); |
890 | } | 863 | } |
891 | GNUNET_SCHEDULER_cancel (die_task); | 864 | GNUNET_SCHEDULER_cancel (die_task); |
892 | die_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply | 865 | die_task = |
893 | (GNUNET_TIME_UNIT_SECONDS, | 866 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply |
894 | SECONDS_PER_PEER_START * num_peers), | 867 | (GNUNET_TIME_UNIT_SECONDS, |
895 | &end_badly, | 868 | SECONDS_PER_PEER_START * num_peers), |
896 | "from continue startup (timeout)"); | 869 | &end_badly, |
870 | "from continue startup (timeout)"); | ||
897 | } | 871 | } |
898 | 872 | ||
899 | 873 | ||
900 | static void | 874 | static void |
901 | peers_started_callback (void *cls, | 875 | peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, |
902 | const struct GNUNET_PeerIdentity *id, | ||
903 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 876 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
904 | struct GNUNET_TESTING_Daemon *d, const char *emsg) | 877 | struct GNUNET_TESTING_Daemon *d, const char *emsg) |
905 | { | 878 | { |
@@ -943,10 +916,10 @@ peers_started_callback (void *cls, | |||
943 | GNUNET_SCHEDULER_cancel (die_task); | 916 | GNUNET_SCHEDULER_cancel (die_task); |
944 | /* Set up task in case topology creation doesn't finish | 917 | /* Set up task in case topology creation doesn't finish |
945 | * within a reasonable amount of time */ | 918 | * within a reasonable amount of time */ |
946 | die_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply | 919 | die_task = |
947 | (GNUNET_TIME_UNIT_MINUTES, 8), | 920 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply |
948 | &end_badly, | 921 | (GNUNET_TIME_UNIT_MINUTES, 8), &end_badly, |
949 | "from peers_started_callback"); | 922 | "from peers_started_callback"); |
950 | #if DELAY_FOR_LOGGING | 923 | #if DELAY_FOR_LOGGING |
951 | fprintf (stdout, "Connecting topology in 10 seconds\n"); | 924 | fprintf (stdout, "Connecting topology in 10 seconds\n"); |
952 | gather_log_data (); | 925 | gather_log_data (); |
@@ -969,8 +942,7 @@ peers_started_callback (void *cls, | |||
969 | * @param emsg non-null on failure | 942 | * @param emsg non-null on failure |
970 | */ | 943 | */ |
971 | void | 944 | void |
972 | hostkey_callback (void *cls, | 945 | hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, |
973 | const struct GNUNET_PeerIdentity *id, | ||
974 | struct GNUNET_TESTING_Daemon *d, const char *emsg) | 946 | struct GNUNET_TESTING_Daemon *d, const char *emsg) |
975 | { | 947 | { |
976 | if (emsg != NULL) | 948 | if (emsg != NULL) |
@@ -981,8 +953,8 @@ hostkey_callback (void *cls, | |||
981 | 953 | ||
982 | #if VERBOSE > 1 | 954 | #if VERBOSE > 1 |
983 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 955 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
984 | "Hostkey (%d/%d) created for peer `%s'\n", | 956 | "Hostkey (%d/%d) created for peer `%s'\n", num_peers - peers_left, |
985 | num_peers - peers_left, num_peers, GNUNET_i2s (id)); | 957 | num_peers, GNUNET_i2s (id)); |
986 | #endif | 958 | #endif |
987 | 959 | ||
988 | #if PROGRESS_BARS | 960 | #if PROGRESS_BARS |
@@ -1012,18 +984,17 @@ hostkey_callback (void *cls, | |||
1012 | GNUNET_SCHEDULER_cancel (die_task); | 984 | GNUNET_SCHEDULER_cancel (die_task); |
1013 | /* Set up task in case topology creation doesn't finish | 985 | /* Set up task in case topology creation doesn't finish |
1014 | * within a reasonable amount of time */ | 986 | * within a reasonable amount of time */ |
1015 | die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 987 | die_task = |
1016 | &end_badly, | 988 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, |
1017 | "from create_topology"); | 989 | "from create_topology"); |
1018 | GNUNET_SCHEDULER_add_now (&create_topology, NULL); | 990 | GNUNET_SCHEDULER_add_now (&create_topology, NULL); |
1019 | ok = 0; | 991 | ok = 0; |
1020 | } | 992 | } |
1021 | } | 993 | } |
1022 | 994 | ||
1023 | static void | 995 | static void |
1024 | run (void *cls, | 996 | run (void *cls, char *const *args, const char *cfgfile, |
1025 | char *const *args, | 997 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
1026 | const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) | ||
1027 | { | 998 | { |
1028 | char *topology_str; | 999 | char *topology_str; |
1029 | char *connect_topology_str; | 1000 | char *connect_topology_str; |
@@ -1056,8 +1027,8 @@ run (void *cls, | |||
1056 | 1027 | ||
1057 | if ((GNUNET_YES == | 1028 | if ((GNUNET_YES == |
1058 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", "topology", | 1029 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", "topology", |
1059 | &topology_str)) | 1030 | &topology_str)) && |
1060 | && (GNUNET_NO == GNUNET_TESTING_topology_get (&topology, topology_str))) | 1031 | (GNUNET_NO == GNUNET_TESTING_topology_get (&topology, topology_str))) |
1061 | { | 1032 | { |
1062 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1033 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1063 | "Invalid topology `%s' given for section %s option %s\n", | 1034 | "Invalid topology `%s' given for section %s option %s\n", |
@@ -1068,10 +1039,10 @@ run (void *cls, | |||
1068 | if ((GNUNET_YES == | 1039 | if ((GNUNET_YES == |
1069 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", | 1040 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", |
1070 | "connect_topology", | 1041 | "connect_topology", |
1071 | &connect_topology_str)) | 1042 | &connect_topology_str)) && |
1072 | && (GNUNET_NO == | 1043 | (GNUNET_NO == |
1073 | GNUNET_TESTING_topology_get (&connection_topology, | 1044 | GNUNET_TESTING_topology_get (&connection_topology, |
1074 | connect_topology_str))) | 1045 | connect_topology_str))) |
1075 | { | 1046 | { |
1076 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1047 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1077 | "Invalid connect topology `%s' given for section %s option %s\n", | 1048 | "Invalid connect topology `%s' given for section %s option %s\n", |
@@ -1081,10 +1052,10 @@ run (void *cls, | |||
1081 | if ((GNUNET_YES == | 1052 | if ((GNUNET_YES == |
1082 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", | 1053 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", |
1083 | "connect_topology_option", | 1054 | "connect_topology_option", |
1084 | &connect_topology_option_str)) | 1055 | &connect_topology_option_str)) && |
1085 | && (GNUNET_NO == | 1056 | (GNUNET_NO == |
1086 | GNUNET_TESTING_topology_option_get (&connect_topology_option, | 1057 | GNUNET_TESTING_topology_option_get (&connect_topology_option, |
1087 | connect_topology_option_str))) | 1058 | connect_topology_option_str))) |
1088 | { | 1059 | { |
1089 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1060 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1090 | "Invalid connect topology option `%s' given for section %s option %s\n", | 1061 | "Invalid connect topology option `%s' given for section %s option %s\n", |
@@ -1120,10 +1091,10 @@ run (void *cls, | |||
1120 | if ((GNUNET_YES == | 1091 | if ((GNUNET_YES == |
1121 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", | 1092 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", |
1122 | "blacklist_topology", | 1093 | "blacklist_topology", |
1123 | &blacklist_topology_str)) | 1094 | &blacklist_topology_str)) && |
1124 | && (GNUNET_NO == | 1095 | (GNUNET_NO == |
1125 | GNUNET_TESTING_topology_get (&blacklist_topology, | 1096 | GNUNET_TESTING_topology_get (&blacklist_topology, |
1126 | blacklist_topology_str))) | 1097 | blacklist_topology_str))) |
1127 | { | 1098 | { |
1128 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1099 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1129 | "Invalid topology `%s' given for section %s option %s\n", | 1100 | "Invalid topology `%s' given for section %s option %s\n", |
@@ -1196,10 +1167,8 @@ run (void *cls, | |||
1196 | "didn't generate all hostkeys within a reasonable amount of time!!!"); | 1167 | "didn't generate all hostkeys within a reasonable amount of time!!!"); |
1197 | 1168 | ||
1198 | GNUNET_assert (num_peers > 0 && num_peers < (unsigned int) -1); | 1169 | GNUNET_assert (num_peers > 0 && num_peers < (unsigned int) -1); |
1199 | pg = GNUNET_TESTING_daemons_start (cfg, | 1170 | pg = GNUNET_TESTING_daemons_start (cfg, peers_left, |
1200 | peers_left, | 1171 | max_outstanding_connections, peers_left, |
1201 | max_outstanding_connections, | ||
1202 | peers_left, | ||
1203 | GNUNET_TIME_relative_multiply | 1172 | GNUNET_TIME_relative_multiply |
1204 | (GNUNET_TIME_UNIT_SECONDS, | 1173 | (GNUNET_TIME_UNIT_SECONDS, |
1205 | SECONDS_PER_PEER_START * num_peers), | 1174 | SECONDS_PER_PEER_START * num_peers), |
@@ -1231,8 +1200,9 @@ check () | |||
1231 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 1200 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
1232 | GNUNET_GETOPT_OPTION_END | 1201 | GNUNET_GETOPT_OPTION_END |
1233 | }; | 1202 | }; |
1234 | ret = GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, | 1203 | ret = |
1235 | argv, binary_name, "nohelp", options, &run, &ok); | 1204 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, |
1205 | binary_name, "nohelp", options, &run, &ok); | ||
1236 | if (ret != GNUNET_OK) | 1206 | if (ret != GNUNET_OK) |
1237 | { | 1207 | { |
1238 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1208 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |