aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-05-23 00:37:47 +0000
committerBart Polot <bart@net.in.tum.de>2014-05-23 00:37:47 +0000
commit3c6d81413f88a28c4cac0625af2ba9a5dc7239d6 (patch)
tree0816c8686cc54cf9257b13c3bdf55854b3c12d01 /src
parentfbab5d34eb111e3d47e18d4b1f17e3b69c640d33 (diff)
downloadgnunet-3c6d81413f88a28c4cac0625af2ba9a5dc7239d6.tar.gz
gnunet-3c6d81413f88a28c4cac0625af2ba9a5dc7239d6.zip
- perform tests with only 2 peers for basic P2P test and with 5 peer line for testing of relay peers
Diffstat (limited to 'src')
-rw-r--r--src/cadet/test_cadet.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/cadet/test_cadet.c b/src/cadet/test_cadet.c
index ba636abc3..cd4c1c1df 100644
--- a/src/cadet/test_cadet.c
+++ b/src/cadet/test_cadet.c
@@ -820,15 +820,16 @@ tmain (void *cls,
820 struct GNUNET_CADET_TEST_Context *ctx, 820 struct GNUNET_CADET_TEST_Context *ctx,
821 unsigned int num_peers, 821 unsigned int num_peers,
822 struct GNUNET_TESTBED_Peer **peers, 822 struct GNUNET_TESTBED_Peer **peers,
823 struct GNUNET_CADET_Handle **cadetes) 823 struct GNUNET_CADET_Handle **cadets)
824{ 824{
825 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test main\n"); 825 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test main\n");
826 ok = 0; 826 ok = 0;
827 test_ctx = ctx; 827 test_ctx = ctx;
828 peers_running = num_peers; 828 peers_running = num_peers;
829 GNUNET_assert (peers_running == peers_requested);
829 testbed_peers = peers; 830 testbed_peers = peers;
830 h1 = cadetes[0]; 831 h1 = cadets[0];
831 h2 = cadetes[num_peers - 1]; 832 h2 = cadets[num_peers - 1];
832 disconnect_task = GNUNET_SCHEDULER_add_delayed (SHORT_TIME, 833 disconnect_task = GNUNET_SCHEDULER_add_delayed (SHORT_TIME,
833 &disconnect_cadet_peers, 834 &disconnect_cadet_peers,
834 (void *) __LINE__); 835 (void *) __LINE__);
@@ -858,6 +859,22 @@ main (int argc, char *argv[])
858 config_file = "test_cadet.conf"; 859 config_file = "test_cadet.conf";
859 860
860 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Start\n"); 861 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Start\n");
862 if (strstr (argv[0], "test_direct") != NULL)
863 {
864 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "DIRECT CONNECTIONs\n");
865 peers_requested = 2;
866 }
867 else if (strstr (argv[0], "test_small") != NULL)
868 {
869 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "5 PEER LINE\n");
870 peers_requested = 5;
871 }
872 else
873 {
874 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "SIZE UNKNOWN\n");
875 return 1;
876 }
877
861 if (strstr (argv[0], "_cadet_forward") != NULL) 878 if (strstr (argv[0], "_cadet_forward") != NULL)
862 { 879 {
863 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "FORWARD\n"); 880 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "FORWARD\n");
@@ -937,7 +954,7 @@ main (int argc, char *argv[])
937 ports[1] = 0; 954 ports[1] = 0;
938 GNUNET_CADET_TEST_run ("test_cadet_small", 955 GNUNET_CADET_TEST_run ("test_cadet_small",
939 config_file, 956 config_file,
940 5, 957 peers_requested,
941 &tmain, 958 &tmain,
942 NULL, /* tmain cls */ 959 NULL, /* tmain cls */
943 &incoming_channel, 960 &incoming_channel,