diff options
-rw-r--r-- | src/testing/testing.c | 16 | ||||
-rw-r--r-- | src/testing/testing_group.c | 473 |
2 files changed, 446 insertions, 43 deletions
diff --git a/src/testing/testing.c b/src/testing/testing.c index bddd0f30c..c9597cd2e 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c | |||
@@ -40,7 +40,7 @@ | |||
40 | #include "gnunet_testing_lib.h" | 40 | #include "gnunet_testing_lib.h" |
41 | #include "gnunet_transport_service.h" | 41 | #include "gnunet_transport_service.h" |
42 | 42 | ||
43 | #define DEBUG_TESTING GNUNET_NO | 43 | #define DEBUG_TESTING GNUNET_YES |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * How long do we wait after starting gnunet-service-arm | 46 | * How long do we wait after starting gnunet-service-arm |
@@ -800,13 +800,13 @@ connect_notify (void *cls, const struct GNUNET_PeerIdentity * peer, struct GNUNE | |||
800 | 800 | ||
801 | #if DEBUG_TESTING | 801 | #if DEBUG_TESTING |
802 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 802 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
803 | "Core notified us about connection to a peer\n\n\n"); | 803 | "Core notified us about connection to a peer\n"); |
804 | #endif | 804 | #endif |
805 | if (memcmp(&ctx->d2->id, peer, sizeof(struct GNUNET_PeerIdentity)) == 0) | 805 | if (memcmp(&ctx->d2->id, peer, sizeof(struct GNUNET_PeerIdentity)) == 0) |
806 | { | 806 | { |
807 | #if DEBUG_TESTING | 807 | #if DEBUG_TESTING |
808 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 808 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
809 | "Core notified us about connection to peer %s\n\n\n", GNUNET_i2s(peer)); | 809 | "Core notified us about connection to peer %s\n", GNUNET_i2s(peer)); |
810 | #endif | 810 | #endif |
811 | /* | 811 | /* |
812 | * If we disconnect here, then the hello may never get sent (if it was delayed!) | 812 | * If we disconnect here, then the hello may never get sent (if it was delayed!) |
@@ -825,10 +825,12 @@ send_hello(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
825 | { | 825 | { |
826 | struct ConnectContext *ctx = cls; | 826 | struct ConnectContext *ctx = cls; |
827 | 827 | ||
828 | GNUNET_assert (ctx->hello != NULL); | 828 | if (ctx->hello != NULL) |
829 | GNUNET_TRANSPORT_offer_hello (ctx->d2th, ctx->hello); | 829 | { |
830 | GNUNET_TRANSPORT_offer_hello (ctx->d2th, ctx->hello); | ||
831 | ctx->timeout_hello = GNUNET_TIME_relative_add(ctx->timeout_hello, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 200)); | ||
832 | } | ||
830 | 833 | ||
831 | ctx->timeout_hello = GNUNET_TIME_relative_multiply(ctx->timeout_hello, 2); | ||
832 | ctx->hello_send_task = GNUNET_SCHEDULER_add_delayed(ctx->d1->sched, ctx->timeout_hello, &send_hello, ctx); | 834 | ctx->hello_send_task = GNUNET_SCHEDULER_add_delayed(ctx->d1->sched, ctx->timeout_hello, &send_hello, ctx); |
833 | } | 835 | } |
834 | 836 | ||
@@ -904,7 +906,7 @@ GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, | |||
904 | ctx->timeout = GNUNET_TIME_relative_to_absolute (timeout); | 906 | ctx->timeout = GNUNET_TIME_relative_to_absolute (timeout); |
905 | ctx->cb = cb; | 907 | ctx->cb = cb; |
906 | ctx->cb_cls = cb_cls; | 908 | ctx->cb_cls = cb_cls; |
907 | ctx->timeout_hello = GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 800); | 909 | ctx->timeout_hello = GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 400); |
908 | ctx->connected = GNUNET_NO; | 910 | ctx->connected = GNUNET_NO; |
909 | #if DEBUG_TESTING | 911 | #if DEBUG_TESTING |
910 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 912 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index fd1338e1e..467fab053 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c | |||
@@ -44,7 +44,7 @@ | |||
44 | */ | 44 | */ |
45 | #define HIGH_PORT 32000 | 45 | #define HIGH_PORT 32000 |
46 | 46 | ||
47 | #define CONNECT_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) | 47 | #define CONNECT_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 180) |
48 | 48 | ||
49 | struct PeerConnection | 49 | struct PeerConnection |
50 | { | 50 | { |
@@ -295,6 +295,401 @@ add_connections(struct GNUNET_TESTING_PeerGroup *pg, unsigned int first, unsigne | |||
295 | return added; | 295 | return added; |
296 | } | 296 | } |
297 | 297 | ||
298 | int | ||
299 | create_small_world_ring(struct GNUNET_TESTING_PeerGroup *pg) | ||
300 | { | ||
301 | unsigned int i, j; | ||
302 | int nodeToConnect; | ||
303 | unsigned int natLog; | ||
304 | unsigned int randomPeer; | ||
305 | double random, logNModifier, percentage; | ||
306 | unsigned int smallWorldConnections; | ||
307 | int connsPerPeer; | ||
308 | char *p_string; | ||
309 | int max; | ||
310 | int min; | ||
311 | unsigned int useAnd; | ||
312 | int connect_attempts; | ||
313 | struct GNUNET_TIME_Absolute time; | ||
314 | |||
315 | GNUNET_CONFIGURATION_get_value_string(pg->cfg, "TESTING", "LOGNMODIFIER", &p_string); | ||
316 | if (p_string != NULL) | ||
317 | logNModifier = atof(p_string); | ||
318 | else | ||
319 | logNModifier = 0.5; /* FIXME: default modifier? */ | ||
320 | |||
321 | GNUNET_free_non_null(p_string); | ||
322 | |||
323 | GNUNET_CONFIGURATION_get_value_string(pg->cfg, "TESTING", "PERCENTAGE", &p_string); | ||
324 | if (p_string != NULL) | ||
325 | percentage = atof(p_string); | ||
326 | else | ||
327 | percentage = 0.5; /* FIXME: default percentage? */ | ||
328 | |||
329 | GNUNET_free_non_null(p_string); | ||
330 | |||
331 | natLog = log (pg->total); | ||
332 | connsPerPeer = ceil (natLog * logNModifier); | ||
333 | |||
334 | if (connsPerPeer % 2 == 1) | ||
335 | connsPerPeer += 1; | ||
336 | |||
337 | time = GNUNET_TIME_absolute_get (); | ||
338 | srand ((unsigned int) time.value); | ||
339 | smallWorldConnections = 0; | ||
340 | connect_attempts = 0; | ||
341 | for (i = 0; i < pg->total; i++) | ||
342 | { | ||
343 | useAnd = 0; | ||
344 | max = i + connsPerPeer / 2; | ||
345 | min = i - connsPerPeer / 2; | ||
346 | |||
347 | if (max > pg->total - 1) | ||
348 | { | ||
349 | max = max - pg->total; | ||
350 | useAnd = 1; | ||
351 | } | ||
352 | |||
353 | if (min < 0) | ||
354 | { | ||
355 | min = pg->total - 1 + min; | ||
356 | useAnd = 1; | ||
357 | } | ||
358 | |||
359 | for (j = 0; j < connsPerPeer / 2; j++) | ||
360 | { | ||
361 | random = ((double) rand () / RAND_MAX); | ||
362 | if (random < percentage) | ||
363 | { | ||
364 | /* Connect to uniformly selected random peer */ | ||
365 | randomPeer = | ||
366 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, | ||
367 | pg->total); | ||
368 | while ((((randomPeer < max) && (randomPeer > min)) | ||
369 | && (useAnd == 0)) || (((randomPeer > min) | ||
370 | || (randomPeer < max)) | ||
371 | && (useAnd == 1))) | ||
372 | { | ||
373 | randomPeer = | ||
374 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, | ||
375 | pg->total); | ||
376 | } | ||
377 | smallWorldConnections += | ||
378 | add_connections (pg, i, randomPeer); | ||
379 | } | ||
380 | else | ||
381 | { | ||
382 | nodeToConnect = i + j + 1; | ||
383 | if (nodeToConnect > pg->total - 1) | ||
384 | { | ||
385 | nodeToConnect = nodeToConnect - pg->total; | ||
386 | } | ||
387 | connect_attempts += | ||
388 | add_connections (pg, i, nodeToConnect); | ||
389 | } | ||
390 | } | ||
391 | |||
392 | } | ||
393 | |||
394 | connect_attempts += smallWorldConnections; | ||
395 | |||
396 | return GNUNET_OK; | ||
397 | } | ||
398 | |||
399 | |||
400 | static int | ||
401 | create_nated_internet (struct GNUNET_TESTING_PeerGroup *pg) | ||
402 | { | ||
403 | unsigned int outer_count, inner_count; | ||
404 | unsigned int cutoff; | ||
405 | int connect_attempts; | ||
406 | double nat_percentage; | ||
407 | char *p_string; | ||
408 | |||
409 | GNUNET_CONFIGURATION_get_value_string(pg->cfg, "TESTING", "NATPERCENTAGE", &p_string); | ||
410 | if (p_string != NULL) | ||
411 | nat_percentage = atof(p_string); | ||
412 | else | ||
413 | nat_percentage = 0.0; /* FIXME: default modifier? */ | ||
414 | |||
415 | GNUNET_free_non_null(p_string); | ||
416 | |||
417 | cutoff = (unsigned int) (nat_percentage * pg->total); | ||
418 | |||
419 | connect_attempts = 0; | ||
420 | |||
421 | for (outer_count = 0; outer_count < pg->total - 1; outer_count++) | ||
422 | { | ||
423 | for (inner_count = outer_count + 1; inner_count < pg->total; | ||
424 | inner_count++) | ||
425 | { | ||
426 | if ((outer_count > cutoff) || (inner_count > cutoff)) | ||
427 | { | ||
428 | #if VERBOSE_TESTING | ||
429 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
430 | "Connecting peer %d to peer %d\n", | ||
431 | outer_count, inner_count); | ||
432 | #endif | ||
433 | connect_attempts += add_connections(pg, outer_count, inner_count); | ||
434 | } | ||
435 | } | ||
436 | } | ||
437 | |||
438 | return connect_attempts; | ||
439 | |||
440 | } | ||
441 | |||
442 | |||
443 | |||
444 | static int | ||
445 | create_small_world (struct GNUNET_TESTING_PeerGroup *pg) | ||
446 | { | ||
447 | unsigned int i, j, k; | ||
448 | unsigned int square; | ||
449 | unsigned int rows; | ||
450 | unsigned int cols; | ||
451 | unsigned int toggle = 1; | ||
452 | unsigned int nodeToConnect; | ||
453 | unsigned int natLog; | ||
454 | unsigned int node1Row; | ||
455 | unsigned int node1Col; | ||
456 | unsigned int node2Row; | ||
457 | unsigned int node2Col; | ||
458 | unsigned int distance; | ||
459 | double probability, random, percentage; | ||
460 | unsigned int smallWorldConnections; | ||
461 | char *p_string; | ||
462 | int connect_attempts; | ||
463 | square = floor (sqrt (pg->total)); | ||
464 | rows = square; | ||
465 | cols = square; | ||
466 | |||
467 | GNUNET_CONFIGURATION_get_value_string(pg->cfg, "TESTING", "PERCENTAGE", &p_string); | ||
468 | if (p_string != NULL) | ||
469 | percentage = atof(p_string); | ||
470 | else | ||
471 | percentage = 0.5; /* FIXME: default percentage? */ | ||
472 | |||
473 | GNUNET_free_non_null(p_string); | ||
474 | |||
475 | GNUNET_CONFIGURATION_get_value_string(pg->cfg, "TESTING", "PROBABILITY", &p_string); | ||
476 | if (p_string != NULL) | ||
477 | probability = atof(p_string); | ||
478 | else | ||
479 | probability = 0.5; /* FIXME: default probability? */ | ||
480 | |||
481 | GNUNET_free_non_null(p_string); | ||
482 | |||
483 | if (square * square != pg->total) | ||
484 | { | ||
485 | while (rows * cols < pg->total) | ||
486 | { | ||
487 | if (toggle % 2 == 0) | ||
488 | rows++; | ||
489 | else | ||
490 | cols++; | ||
491 | |||
492 | toggle++; | ||
493 | } | ||
494 | } | ||
495 | #if VERBOSE_TESTING | ||
496 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
497 | _("Connecting nodes in 2d torus topology: %u rows %u columns\n"), | ||
498 | rows, cols); | ||
499 | #endif | ||
500 | |||
501 | connect_attempts = 0; | ||
502 | /* Rows and columns are all sorted out, now iterate over all nodes and connect each | ||
503 | * to the node to its right and above. Once this is over, we'll have our torus! | ||
504 | * Special case for the last node (if the rows and columns are not equal), connect | ||
505 | * to the first in the row to maintain topology. | ||
506 | */ | ||
507 | for (i = 0; i < pg->total; i++) | ||
508 | { | ||
509 | /* First connect to the node to the right */ | ||
510 | if (((i + 1) % cols != 0) && (i + 1 != pg->total)) | ||
511 | nodeToConnect = i + 1; | ||
512 | else if (i + 1 == pg->total) | ||
513 | nodeToConnect = rows * cols - cols; | ||
514 | else | ||
515 | nodeToConnect = i - cols + 1; | ||
516 | |||
517 | connect_attempts += add_connections (pg, i, nodeToConnect); | ||
518 | |||
519 | if (i < cols) | ||
520 | nodeToConnect = (rows * cols) - cols + i; | ||
521 | else | ||
522 | nodeToConnect = i - cols; | ||
523 | |||
524 | if (nodeToConnect < pg->total) | ||
525 | connect_attempts += add_connections (pg, i, nodeToConnect); | ||
526 | } | ||
527 | natLog = log (pg->total); | ||
528 | #if VERBOSE_TESTING | ||
529 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
530 | _("natural log of %d is %d, will run %d iterations\n"), | ||
531 | pg->total, natLog, (int) (natLog * percentage)); | ||
532 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Total connections added thus far: %u!\n"), connect_attempts); | ||
533 | #endif | ||
534 | smallWorldConnections = 0; | ||
535 | for (i = 0; i < (int) (natLog * percentage); i++) | ||
536 | { | ||
537 | for (j = 0; j < pg->total; j++) | ||
538 | { | ||
539 | /* Determine the row and column of node at position j on the 2d torus */ | ||
540 | node1Row = j / cols; | ||
541 | node1Col = j - (node1Row * cols); | ||
542 | for (k = 0; k < pg->total; k++) | ||
543 | { | ||
544 | /* Determine the row and column of node at position k on the 2d torus */ | ||
545 | node2Row = k / cols; | ||
546 | node2Col = k - (node2Row * cols); | ||
547 | /* Simple Cartesian distance */ | ||
548 | distance = abs (node1Row - node2Row) + abs (node1Col - node2Col); | ||
549 | if (distance > 1) | ||
550 | { | ||
551 | /* Calculate probability as 1 over the square of the distance */ | ||
552 | probability = 1.0 / (distance * distance); | ||
553 | /* Choose a random, divide by RAND_MAX to get a number between 0 and 1 */ | ||
554 | random = ((double) rand () / RAND_MAX); | ||
555 | /* If random < probability, then connect the two nodes */ | ||
556 | if (random < probability) | ||
557 | smallWorldConnections += add_connections (pg, j, k); | ||
558 | |||
559 | } | ||
560 | } | ||
561 | } | ||
562 | } | ||
563 | connect_attempts += smallWorldConnections; | ||
564 | #if VERBOSE_TESTING | ||
565 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
566 | _("Total connections added for small world: %d!\n"), | ||
567 | smallWorldConnections); | ||
568 | #endif | ||
569 | return GNUNET_OK; | ||
570 | } | ||
571 | |||
572 | |||
573 | |||
574 | static int | ||
575 | create_erdos_renyi (struct GNUNET_TESTING_PeerGroup *pg) | ||
576 | { | ||
577 | double temp_rand; | ||
578 | unsigned int outer_count; | ||
579 | unsigned int inner_count; | ||
580 | int connect_attempts; | ||
581 | double probability; | ||
582 | char *p_string; | ||
583 | connect_attempts = 0; | ||
584 | |||
585 | probability = GNUNET_CONFIGURATION_get_value_string(pg->cfg, "TESTING", "PROBABILITY", &p_string); | ||
586 | if (p_string != NULL) | ||
587 | { | ||
588 | probability = atof(p_string); | ||
589 | } | ||
590 | else | ||
591 | { | ||
592 | probability = 0.0; /* FIXME: default probability? */ | ||
593 | } | ||
594 | for (outer_count = 0; outer_count < pg->total - 1; outer_count++) | ||
595 | { | ||
596 | for (inner_count = outer_count + 1; inner_count < pg->total; | ||
597 | inner_count++) | ||
598 | { | ||
599 | temp_rand = ((double) RANDOM () / RAND_MAX); | ||
600 | #if VERBOSE_TESTING | ||
601 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
602 | _("rand is %f probability is %f\n"), temp_rand, | ||
603 | probability); | ||
604 | #endif | ||
605 | if (temp_rand < probability) | ||
606 | { | ||
607 | connect_attempts += add_connections (pg, outer_count, inner_count); | ||
608 | } | ||
609 | } | ||
610 | } | ||
611 | |||
612 | return connect_attempts; | ||
613 | } | ||
614 | |||
615 | static int | ||
616 | create_2d_torus (struct GNUNET_TESTING_PeerGroup *pg) | ||
617 | { | ||
618 | unsigned int i; | ||
619 | unsigned int square; | ||
620 | unsigned int rows; | ||
621 | unsigned int cols; | ||
622 | unsigned int toggle = 1; | ||
623 | unsigned int nodeToConnect; | ||
624 | int connect_attempts; | ||
625 | |||
626 | connect_attempts = 0; | ||
627 | |||
628 | square = floor (sqrt (pg->total)); | ||
629 | rows = square; | ||
630 | cols = square; | ||
631 | |||
632 | if (square * square != pg->total) | ||
633 | { | ||
634 | while (rows * cols < pg->total) | ||
635 | { | ||
636 | if (toggle % 2 == 0) | ||
637 | rows++; | ||
638 | else | ||
639 | cols++; | ||
640 | |||
641 | toggle++; | ||
642 | } | ||
643 | } | ||
644 | #if VERBOSE_TESTING | ||
645 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
646 | _("Connecting nodes in 2d torus topology: %u rows %u columns\n"), | ||
647 | rows, cols); | ||
648 | #endif | ||
649 | /* Rows and columns are all sorted out, now iterate over all nodes and connect each | ||
650 | * to the node to its right and above. Once this is over, we'll have our torus! | ||
651 | * Special case for the last node (if the rows and columns are not equal), connect | ||
652 | * to the first in the row to maintain topology. | ||
653 | */ | ||
654 | for (i = 0; i < pg->total; i++) | ||
655 | { | ||
656 | /* First connect to the node to the right */ | ||
657 | if (((i + 1) % cols != 0) && (i + 1 != pg->total)) | ||
658 | nodeToConnect = i + 1; | ||
659 | else if (i + 1 == pg->total) | ||
660 | nodeToConnect = rows * cols - cols; | ||
661 | else | ||
662 | nodeToConnect = i - cols + 1; | ||
663 | #if VERBOSE_TESTING | ||
664 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
665 | "Connecting peer %d to peer %d\n", | ||
666 | i, nodeToConnect); | ||
667 | #endif | ||
668 | connect_attempts += add_connections(pg, i, nodeToConnect); | ||
669 | |||
670 | /* Second connect to the node immediately above */ | ||
671 | if (i < cols) | ||
672 | nodeToConnect = (rows * cols) - cols + i; | ||
673 | else | ||
674 | nodeToConnect = i - cols; | ||
675 | |||
676 | if (nodeToConnect < pg->total) | ||
677 | { | ||
678 | #if VERBOSE_TESTING | ||
679 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
680 | "Connecting peer %d to peer %d\n", | ||
681 | i, nodeToConnect); | ||
682 | #endif | ||
683 | connect_attempts += add_connections(pg, i, nodeToConnect); | ||
684 | } | ||
685 | |||
686 | } | ||
687 | |||
688 | return connect_attempts; | ||
689 | } | ||
690 | |||
691 | |||
692 | |||
298 | static int | 693 | static int |
299 | create_clique (struct GNUNET_TESTING_PeerGroup *pg) | 694 | create_clique (struct GNUNET_TESTING_PeerGroup *pg) |
300 | { | 695 | { |
@@ -315,11 +710,6 @@ create_clique (struct GNUNET_TESTING_PeerGroup *pg) | |||
315 | outer_count, inner_count); | 710 | outer_count, inner_count); |
316 | #endif | 711 | #endif |
317 | connect_attempts += add_connections(pg, outer_count, inner_count); | 712 | connect_attempts += add_connections(pg, outer_count, inner_count); |
318 | /*GNUNET_TESTING_daemons_connect (pg->peers[outer_count].daemon, | ||
319 | pg->peers[inner_count].daemon, | ||
320 | CONNECT_TIMEOUT, | ||
321 | pg->notify_connection, | ||
322 | pg->notify_connection_cls);*/ | ||
323 | } | 713 | } |
324 | } | 714 | } |
325 | 715 | ||
@@ -327,6 +717,32 @@ create_clique (struct GNUNET_TESTING_PeerGroup *pg) | |||
327 | } | 717 | } |
328 | 718 | ||
329 | 719 | ||
720 | static int | ||
721 | create_ring (struct GNUNET_TESTING_PeerGroup *pg) | ||
722 | { | ||
723 | unsigned int count; | ||
724 | int connect_attempts; | ||
725 | |||
726 | connect_attempts = 0; | ||
727 | |||
728 | /* Connect each peer to the next highest numbered peer */ | ||
729 | for (count = 0; count < pg->total - 1; count++) | ||
730 | { | ||
731 | #if VERBOSE_TESTING | ||
732 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
733 | "Connecting peer %d to peer %d\n", | ||
734 | count, count + 1); | ||
735 | #endif | ||
736 | connect_attempts += add_connections(pg, count, count + 1); | ||
737 | } | ||
738 | |||
739 | /* Connect the last peer to the first peer */ | ||
740 | connect_attempts += add_connections(pg, pg->total - 1, 0); | ||
741 | |||
742 | return connect_attempts; | ||
743 | } | ||
744 | |||
745 | |||
330 | /* | 746 | /* |
331 | * Create the friend files based on the PeerConnection's | 747 | * Create the friend files based on the PeerConnection's |
332 | * of each peer in the peer group, and copy the files | 748 | * of each peer in the peer group, and copy the files |
@@ -460,65 +876,50 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg) | |||
460 | #if VERBOSE_TESTING | 876 | #if VERBOSE_TESTING |
461 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 877 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
462 | _("Creating clique topology (may take a bit!)\n")); | 878 | _("Creating clique topology (may take a bit!)\n")); |
879 | #endif | ||
463 | ret = create_clique (pg); | 880 | ret = create_clique (pg); |
464 | break; | 881 | break; |
882 | case GNUNET_TESTING_TOPOLOGY_SMALL_WORLD_RING: | ||
883 | #if VERBOSE_TESTING | ||
884 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
885 | _("Creating small world (ring) topology (may take a bit!)\n")); | ||
886 | #endif | ||
887 | ret = create_small_world_ring (pg); | ||
888 | break; | ||
465 | case GNUNET_TESTING_TOPOLOGY_SMALL_WORLD: | 889 | case GNUNET_TESTING_TOPOLOGY_SMALL_WORLD: |
890 | #if VERBOSE_TESTING | ||
466 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 891 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
467 | _("Creating small world topology (may take a bit!)\n")); | 892 | _("Creating small world (2d-torus) topology (may take a bit!)\n")); |
468 | #endif | 893 | #endif |
469 | ret = GNUNET_SYSERR; | 894 | ret = create_small_world (pg); |
470 | /* ret = | ||
471 | GNUNET_REMOTE_connect_small_world_ring (&totalConnections, | ||
472 | number_of_daemons, | ||
473 | list_as_array, dotOutFile, | ||
474 | percentage, logNModifier); | ||
475 | */ | ||
476 | break; | 895 | break; |
477 | case GNUNET_TESTING_TOPOLOGY_RING: | 896 | case GNUNET_TESTING_TOPOLOGY_RING: |
478 | #if VERBOSE_TESTING | 897 | #if VERBOSE_TESTING |
479 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 898 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
480 | _("Creating ring topology (may take a bit!)\n")); | 899 | _("Creating ring topology (may take a bit!)\n")); |
481 | #endif | 900 | #endif |
482 | /* | 901 | ret = create_ring (pg); |
483 | ret = GNUNET_REMOTE_connect_ring (&totalConnections, head, dotOutFile); | ||
484 | */ | ||
485 | ret = GNUNET_SYSERR; | ||
486 | break; | 902 | break; |
487 | case GNUNET_TESTING_TOPOLOGY_2D_TORUS: | 903 | case GNUNET_TESTING_TOPOLOGY_2D_TORUS: |
488 | #if VERBOSE_TESTING | 904 | #if VERBOSE_TESTING |
489 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 905 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
490 | _("Creating 2d torus topology (may take a bit!)\n")); | 906 | _("Creating 2d torus topology (may take a bit!)\n")); |
491 | #endif | 907 | #endif |
492 | /* | 908 | ret = create_2d_torus (pg); |
493 | ret = | ||
494 | GNUNET_REMOTE_connect_2d_torus (&totalConnections, number_of_daemons, | ||
495 | list_as_array, dotOutFile); | ||
496 | */ | ||
497 | ret = GNUNET_SYSERR; | ||
498 | break; | 909 | break; |
499 | case GNUNET_TESTING_TOPOLOGY_ERDOS_RENYI: | 910 | case GNUNET_TESTING_TOPOLOGY_ERDOS_RENYI: |
500 | #if VERBOSE_TESTING | 911 | #if VERBOSE_TESTING |
501 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 912 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
502 | _("Creating Erdos-Renyi topology (may take a bit!)\n")); | 913 | _("Creating Erdos-Renyi topology (may take a bit!)\n")); |
503 | #endif | 914 | #endif |
504 | /* ret = | 915 | ret = create_erdos_renyi (pg); |
505 | GNUNET_REMOTE_connect_erdos_renyi (&totalConnections, percentage, | ||
506 | head, dotOutFile); | ||
507 | */ | ||
508 | ret = GNUNET_SYSERR; | ||
509 | break; | 916 | break; |
510 | case GNUNET_TESTING_TOPOLOGY_INTERNAT: | 917 | case GNUNET_TESTING_TOPOLOGY_INTERNAT: |
511 | #if VERBOSE_TESTING | 918 | #if VERBOSE_TESTING |
512 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 919 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
513 | _("Creating InterNAT topology (may take a bit!)\n")); | 920 | _("Creating InterNAT topology (may take a bit!)\n")); |
514 | #endif | 921 | #endif |
515 | /* | 922 | ret = create_nated_internet (pg); |
516 | ret = | ||
517 | GNUNET_REMOTE_connect_nated_internet (&totalConnections, percentage, | ||
518 | number_of_daemons, head, | ||
519 | dotOutFile); | ||
520 | */ | ||
521 | ret = GNUNET_SYSERR; | ||
522 | break; | 923 | break; |
523 | case GNUNET_TESTING_TOPOLOGY_NONE: | 924 | case GNUNET_TESTING_TOPOLOGY_NONE: |
524 | ret = 0; | 925 | ret = 0; |