diff options
author | Nathan S. Evans <evans@in.tum.de> | 2011-02-08 11:10:50 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2011-02-08 11:10:50 +0000 |
commit | a6a510bb5d2f182d26ed5e1597a98a3ae195fb5c (patch) | |
tree | 9318ae851d74e1d26a009008cfb1578e1f32cbcf /src/dht | |
parent | dd74b7a28b31929afcf91ac92d21d22db938af93 (diff) | |
download | gnunet-a6a510bb5d2f182d26ed5e1597a98a3ae195fb5c.tar.gz gnunet-a6a510bb5d2f182d26ed5e1597a98a3ae195fb5c.zip |
test case changes required due to testing api change
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/gnunet-dht-driver.c | 2 | ||||
-rw-r--r-- | src/dht/test_dht_multipeer.c | 20 | ||||
-rw-r--r-- | src/dht/test_dht_twopeer.c | 13 | ||||
-rw-r--r-- | src/dht/test_dht_twopeer_path_tracking.c | 21 | ||||
-rw-r--r-- | src/dht/test_dht_twopeer_put_get.c | 20 |
5 files changed, 64 insertions, 12 deletions
diff --git a/src/dht/gnunet-dht-driver.c b/src/dht/gnunet-dht-driver.c index af8812d48..772b96d6e 100644 --- a/src/dht/gnunet-dht-driver.c +++ b/src/dht/gnunet-dht-driver.c | |||
@@ -77,7 +77,7 @@ | |||
77 | 77 | ||
78 | #define DEFAULT_MAX_OUTSTANDING_PUTS 10 | 78 | #define DEFAULT_MAX_OUTSTANDING_PUTS 10 |
79 | 79 | ||
80 | #define DEFAULT_MAX_OUTSTANDING_FIND_PEERS 128 | 80 | #define DEFAULT_MAX_OUTSTANDING_FIND_PEERS 64 |
81 | 81 | ||
82 | #define DEFAULT_FIND_PEER_OFFSET GNUNET_TIME_relative_divide (DEFAULT_FIND_PEER_DELAY, DEFAULT_MAX_OUTSTANDING_FIND_PEERS) | 82 | #define DEFAULT_FIND_PEER_OFFSET GNUNET_TIME_relative_divide (DEFAULT_FIND_PEER_DELAY, DEFAULT_MAX_OUTSTANDING_FIND_PEERS) |
83 | 83 | ||
diff --git a/src/dht/test_dht_multipeer.c b/src/dht/test_dht_multipeer.c index e4d1a7d20..626c1bc30 100644 --- a/src/dht/test_dht_multipeer.c +++ b/src/dht/test_dht_multipeer.c | |||
@@ -682,7 +682,13 @@ peers_started_callback (void *cls, | |||
682 | expected_connections = -1; | 682 | expected_connections = -1; |
683 | if ((pg != NULL) && (peers_left == 0)) | 683 | if ((pg != NULL) && (peers_left == 0)) |
684 | { | 684 | { |
685 | expected_connections = GNUNET_TESTING_connect_topology (pg, connection_topology, connect_topology_option, connect_topology_option_modifier, NULL, NULL); | 685 | expected_connections = GNUNET_TESTING_connect_topology (pg, |
686 | connection_topology, | ||
687 | connect_topology_option, | ||
688 | connect_topology_option_modifier, | ||
689 | TIMEOUT, | ||
690 | num_peers, | ||
691 | NULL, NULL); | ||
686 | #if VERBOSE | 692 | #if VERBOSE |
687 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 693 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
688 | "Have %d expected connections\n", expected_connections); | 694 | "Have %d expected connections\n", expected_connections); |
@@ -870,8 +876,16 @@ run (void *cls, | |||
870 | &end_badly, "didn't generate all hostkeys within a reasonable amount of time!!!"); | 876 | &end_badly, "didn't generate all hostkeys within a reasonable amount of time!!!"); |
871 | 877 | ||
872 | pg = GNUNET_TESTING_daemons_start (cfg, | 878 | pg = GNUNET_TESTING_daemons_start (cfg, |
873 | peers_left, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, SECONDS_PER_PEER_START * num_peers), &hostkey_callback, NULL, &peers_started_callback, NULL, | 879 | peers_left, |
874 | &topology_callback, NULL, NULL); | 880 | peers_left, |
881 | GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, SECONDS_PER_PEER_START * num_peers), | ||
882 | &hostkey_callback, | ||
883 | NULL, | ||
884 | &peers_started_callback, | ||
885 | NULL, | ||
886 | &topology_callback, | ||
887 | NULL, | ||
888 | NULL); | ||
875 | 889 | ||
876 | } | 890 | } |
877 | 891 | ||
diff --git a/src/dht/test_dht_twopeer.c b/src/dht/test_dht_twopeer.c index aab3a1231..e85c6101b 100644 --- a/src/dht/test_dht_twopeer.c +++ b/src/dht/test_dht_twopeer.c | |||
@@ -318,7 +318,11 @@ connect_topology (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) | |||
318 | { | 318 | { |
319 | expected_connections = -1; | 319 | expected_connections = -1; |
320 | if ((pg != NULL) && (peers_left == 0)) | 320 | if ((pg != NULL) && (peers_left == 0)) |
321 | expected_connections = GNUNET_TESTING_connect_topology (pg, GNUNET_TESTING_TOPOLOGY_CLIQUE, GNUNET_TESTING_TOPOLOGY_OPTION_ALL, 0.0, NULL, NULL); | 321 | expected_connections = GNUNET_TESTING_connect_topology (pg, |
322 | GNUNET_TESTING_TOPOLOGY_CLIQUE, | ||
323 | GNUNET_TESTING_TOPOLOGY_OPTION_ALL, | ||
324 | 0.0, | ||
325 | TIMEOUT, 12, NULL, NULL); | ||
322 | 326 | ||
323 | GNUNET_SCHEDULER_cancel (die_task); | 327 | GNUNET_SCHEDULER_cancel (die_task); |
324 | if (expected_connections == GNUNET_SYSERR) | 328 | if (expected_connections == GNUNET_SYSERR) |
@@ -409,7 +413,12 @@ run (void *cls, | |||
409 | &end_badly, "didn't start all daemons in reasonable amount of time!!!"); | 413 | &end_badly, "didn't start all daemons in reasonable amount of time!!!"); |
410 | 414 | ||
411 | pg = GNUNET_TESTING_daemons_start (cfg, | 415 | pg = GNUNET_TESTING_daemons_start (cfg, |
412 | num_peers, TIMEOUT, NULL, NULL, &peers_started_callback, NULL, | 416 | num_peers, |
417 | 10, | ||
418 | TIMEOUT, | ||
419 | NULL, NULL, | ||
420 | &peers_started_callback, | ||
421 | NULL, | ||
413 | &topology_callback, NULL, NULL); | 422 | &topology_callback, NULL, NULL); |
414 | 423 | ||
415 | } | 424 | } |
diff --git a/src/dht/test_dht_twopeer_path_tracking.c b/src/dht/test_dht_twopeer_path_tracking.c index ab4bc81e0..f8ce26da6 100644 --- a/src/dht/test_dht_twopeer_path_tracking.c +++ b/src/dht/test_dht_twopeer_path_tracking.c | |||
@@ -410,7 +410,14 @@ peers_started_callback (void *cls, | |||
410 | if ((pg != NULL)) /* Sanity check */ | 410 | if ((pg != NULL)) /* Sanity check */ |
411 | { | 411 | { |
412 | /* Connect peers in a "straight line" topology, return the number of expected connections */ | 412 | /* Connect peers in a "straight line" topology, return the number of expected connections */ |
413 | expected_connections = GNUNET_TESTING_connect_topology (pg, GNUNET_TESTING_TOPOLOGY_LINE, GNUNET_TESTING_TOPOLOGY_OPTION_ALL, 0.0, NULL, NULL); | 413 | expected_connections = GNUNET_TESTING_connect_topology (pg, |
414 | GNUNET_TESTING_TOPOLOGY_LINE, | ||
415 | GNUNET_TESTING_TOPOLOGY_OPTION_ALL, | ||
416 | 0.0, | ||
417 | TIMEOUT, | ||
418 | 2, | ||
419 | NULL, | ||
420 | NULL); | ||
414 | } | 421 | } |
415 | 422 | ||
416 | /* Cancel current timeout fail task */ | 423 | /* Cancel current timeout fail task */ |
@@ -454,8 +461,16 @@ run (void *cls, | |||
454 | /* Start num_peers peers, call peers_started_callback on peer start, topology_callback on peer connect */ | 461 | /* Start num_peers peers, call peers_started_callback on peer start, topology_callback on peer connect */ |
455 | /* Read the API documentation for other parameters! */ | 462 | /* Read the API documentation for other parameters! */ |
456 | pg = GNUNET_TESTING_daemons_start (cfg, | 463 | pg = GNUNET_TESTING_daemons_start (cfg, |
457 | num_peers, TIMEOUT, NULL, NULL, &peers_started_callback, NULL, | 464 | num_peers, |
458 | &topology_callback, NULL, NULL); | 465 | num_peers, |
466 | TIMEOUT, | ||
467 | NULL, | ||
468 | NULL, | ||
469 | &peers_started_callback, | ||
470 | NULL, | ||
471 | &topology_callback, | ||
472 | NULL, | ||
473 | NULL); | ||
459 | 474 | ||
460 | } | 475 | } |
461 | 476 | ||
diff --git a/src/dht/test_dht_twopeer_put_get.c b/src/dht/test_dht_twopeer_put_get.c index 2427edef9..187b99479 100644 --- a/src/dht/test_dht_twopeer_put_get.c +++ b/src/dht/test_dht_twopeer_put_get.c | |||
@@ -488,7 +488,13 @@ peers_started_callback (void *cls, | |||
488 | if ((pg != NULL)) /* Sanity check */ | 488 | if ((pg != NULL)) /* Sanity check */ |
489 | { | 489 | { |
490 | /* Connect peers in a "straight line" topology, return the number of expected connections */ | 490 | /* Connect peers in a "straight line" topology, return the number of expected connections */ |
491 | expected_connections = GNUNET_TESTING_connect_topology (pg, GNUNET_TESTING_TOPOLOGY_LINE, GNUNET_TESTING_TOPOLOGY_OPTION_ALL, 0.0, NULL, NULL); | 491 | expected_connections = GNUNET_TESTING_connect_topology (pg, |
492 | GNUNET_TESTING_TOPOLOGY_LINE, | ||
493 | GNUNET_TESTING_TOPOLOGY_OPTION_ALL, | ||
494 | 0.0, | ||
495 | TIMEOUT, | ||
496 | 12, | ||
497 | NULL, NULL); | ||
492 | } | 498 | } |
493 | 499 | ||
494 | /* Cancel current timeout fail task */ | 500 | /* Cancel current timeout fail task */ |
@@ -532,8 +538,16 @@ run (void *cls, | |||
532 | /* Start num_peers peers, call peers_started_callback on peer start, topology_callback on peer connect */ | 538 | /* Start num_peers peers, call peers_started_callback on peer start, topology_callback on peer connect */ |
533 | /* Read the API documentation for other parameters! */ | 539 | /* Read the API documentation for other parameters! */ |
534 | pg = GNUNET_TESTING_daemons_start (cfg, | 540 | pg = GNUNET_TESTING_daemons_start (cfg, |
535 | num_peers, TIMEOUT, NULL, NULL, &peers_started_callback, NULL, | 541 | num_peers, |
536 | &topology_callback, NULL, NULL); | 542 | 2, |
543 | TIMEOUT, | ||
544 | NULL, | ||
545 | NULL, | ||
546 | &peers_started_callback, | ||
547 | NULL, | ||
548 | &topology_callback, | ||
549 | NULL, | ||
550 | NULL); | ||
537 | 551 | ||
538 | } | 552 | } |
539 | 553 | ||