aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_testing_2dtorus.conf8
-rw-r--r--src/testing/test_testing_data_topology_clique.conf4
-rw-r--r--src/testing/test_testing_data_topology_stability.conf2
-rw-r--r--src/testing/test_testing_large_topology.c25
-rw-r--r--src/testing/test_testing_peergroup_data.conf2
-rw-r--r--src/testing/test_testing_topology.c27
-rw-r--r--src/testing/test_testing_topology_blacklist.c12
-rw-r--r--src/testing/testing.conf2
-rw-r--r--src/testing/testing_peergroup.c31
9 files changed, 51 insertions, 62 deletions
diff --git a/src/testing/test_testing_2dtorus.conf b/src/testing/test_testing_2dtorus.conf
index 8cf2f8f62..da5f90c9c 100644
--- a/src/testing/test_testing_2dtorus.conf
+++ b/src/testing/test_testing_2dtorus.conf
@@ -40,8 +40,8 @@ INTERNAL_ADDRESS = 127.0.0.1
40EXTERNAL_ADDRESS = 127.0.0.1 40EXTERNAL_ADDRESS = 127.0.0.1
41 41
42[core] 42[core]
43TOTAL_QUOTA_IN = 999111999 43TOTAL_QUOTA_IN = 1 GB
44TOTAL_QUOTA_OUT = 999111999 44TOTAL_QUOTA_OUT = 1 GB
45AUTOSTART = YES 45AUTOSTART = YES
46PORT = 10003 46PORT = 10003
47 47
@@ -61,13 +61,13 @@ CONNECT_TOPOLOGY = 2D_TORUS
61#PERCENTAGE = 3 61#PERCENTAGE = 3
62#PROBABILITY = .1 62#PROBABILITY = .1
63F2F = NO 63F2F = NO
64CONNECT_TIMEOUT = 600 64CONNECT_TIMEOUT = 600 s
65CONNECT_ATTEMPTS = 2 65CONNECT_ATTEMPTS = 2
66DEBUG = YES 66DEBUG = YES
67HOSTKEYSFILE = ../../contrib/testing_hostkeys.dat 67HOSTKEYSFILE = ../../contrib/testing_hostkeys.dat
68MAX_CONCURRENT_SSH = 10 68MAX_CONCURRENT_SSH = 10
69USE_PROGRESSBARS = YES 69USE_PROGRESSBARS = YES
70PEERGROUP_TIMEOUT = 2400 70PEERGROUP_TIMEOUT = 2400 s
71TOPOLOGY_OUTPUT_FILE = testing_topo_initial 71TOPOLOGY_OUTPUT_FILE = testing_topo_initial
72MAX_OUTSTANDING_CONNECTIONS = 75 72MAX_OUTSTANDING_CONNECTIONS = 75
73#SINGLE_PEERINFO_PER_HOST = YES 73#SINGLE_PEERINFO_PER_HOST = YES
diff --git a/src/testing/test_testing_data_topology_clique.conf b/src/testing/test_testing_data_topology_clique.conf
index 168af17f4..69cecb7e9 100644
--- a/src/testing/test_testing_data_topology_clique.conf
+++ b/src/testing/test_testing_data_topology_clique.conf
@@ -3,8 +3,8 @@
3DEFAULTCONFIG = test_testing_data_topology_clique.conf 3DEFAULTCONFIG = test_testing_data_topology_clique.conf
4 4
5[TESTING] 5[TESTING]
6CONNECT_TIMEOUT = 180 6CONNECT_TIMEOUT = 180 s
7CONNECT_ATTEMPTS = 14 7CONNECT_ATTEMPTS = 14
8NUM_PEERS = 4 8NUM_PEERS = 4
9TOPOLOGY = CLIQUE 9TOPOLOGY = CLIQUE
10 10SETTLE_TIME = 0
diff --git a/src/testing/test_testing_data_topology_stability.conf b/src/testing/test_testing_data_topology_stability.conf
index fc35fc8ab..1bfcd1bde 100644
--- a/src/testing/test_testing_data_topology_stability.conf
+++ b/src/testing/test_testing_data_topology_stability.conf
@@ -3,7 +3,7 @@
3DEFAULTCONFIG = test_testing_data_topology_clique.conf 3DEFAULTCONFIG = test_testing_data_topology_clique.conf
4 4
5[TESTING] 5[TESTING]
6SETTLE_TIME = 600 6SETTLE_TIME = 600 s
7NUM_PEERS = 2 7NUM_PEERS = 2
8TOPOLOGY = CLIQUE 8TOPOLOGY = CLIQUE
9 9
diff --git a/src/testing/test_testing_large_topology.c b/src/testing/test_testing_large_topology.c
index 78d91fa3d..a27154507 100644
--- a/src/testing/test_testing_large_topology.c
+++ b/src/testing/test_testing_large_topology.c
@@ -1043,26 +1043,25 @@ run (void *cls, char *const *args, const char *cfgfile,
1043 GNUNET_free_non_null (topology_str); 1043 GNUNET_free_non_null (topology_str);
1044 GNUNET_free_non_null (blacklist_topology_str); 1044 GNUNET_free_non_null (blacklist_topology_str);
1045 1045
1046 if (GNUNET_OK == 1046 if (GNUNET_OK !=
1047 GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "settle_time", 1047 GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "SETTLE_TIME",
1048 &temp_settle)) 1048 &settle_time))
1049 settle_time = 1049 {
1050 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, temp_settle); 1050 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n",
1051 1051 "testing", "SETTLE_TIME");
1052 return;
1053 }
1052 if (GNUNET_SYSERR == 1054 if (GNUNET_SYSERR ==
1053 GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "num_peers", 1055 GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "num_peers",
1054 &num_peers)) 1056 &num_peers))
1055 num_peers = DEFAULT_NUM_PEERS; 1057 num_peers = DEFAULT_NUM_PEERS;
1056 1058
1057 if (GNUNET_OK == 1059 if (GNUNET_OK !=
1058 GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "connect_timeout", 1060 GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "CONNECT_TIMEOUT",
1059 &temp_settle)) 1061 &connect_timeout))
1060 connect_timeout =
1061 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, temp_settle);
1062 else
1063 { 1062 {
1064 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", 1063 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n",
1065 "testing", "connect_timeout"); 1064 "testing", "CONNECT_TIMEOUT");
1066 return; 1065 return;
1067 } 1066 }
1068 1067
diff --git a/src/testing/test_testing_peergroup_data.conf b/src/testing/test_testing_peergroup_data.conf
index be734c7d2..6eadede95 100644
--- a/src/testing/test_testing_peergroup_data.conf
+++ b/src/testing/test_testing_peergroup_data.conf
@@ -6,7 +6,7 @@ DEFAULTCONFIG = test_testing_peergroup_data.conf
6CONNECT_ATTEMPTS = 2 6CONNECT_ATTEMPTS = 2
7MAX_OUTSTANDING_CONNECTIONS = 20 7MAX_OUTSTANDING_CONNECTIONS = 20
8MAX_CONCURRENT_SSH = 1 8MAX_CONCURRENT_SSH = 1
9PEERGROUP_TIMEOUT = 300 9PEERGROUP_TIMEOUT = 300 s
10TOPOLOGY = CLIQUE 10TOPOLOGY = CLIQUE
11PERCENTAGE = 0.5 11PERCENTAGE = 0.5
12PROBABILITY = 0.5 12PROBABILITY = 0.5
diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c
index deaeae457..ba092220a 100644
--- a/src/testing/test_testing_topology.c
+++ b/src/testing/test_testing_topology.c
@@ -999,7 +999,6 @@ run (void *cls, char *const *args, const char *cfgfile,
999 char *blacklist_topology_str; 999 char *blacklist_topology_str;
1000 char *connect_topology_option_str; 1000 char *connect_topology_option_str;
1001 char *connect_topology_option_modifier_string; 1001 char *connect_topology_option_modifier_string;
1002 unsigned long long temp_settle;
1003 unsigned long long max_outstanding_connections; 1002 unsigned long long max_outstanding_connections;
1004 1003
1005 ok = 1; 1004 ok = 1;
@@ -1101,21 +1100,21 @@ run (void *cls, char *const *args, const char *cfgfile,
1101 GNUNET_free_non_null (topology_str); 1100 GNUNET_free_non_null (topology_str);
1102 GNUNET_free_non_null (blacklist_topology_str); 1101 GNUNET_free_non_null (blacklist_topology_str);
1103 1102
1104 if (GNUNET_OK == 1103 if (GNUNET_OK !=
1105 GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "settle_time", 1104 GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "SETTLE_TIME",
1106 &temp_settle)) 1105 &settle_time))
1107 settle_time = 1106 {
1108 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, temp_settle); 1107 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n",
1109 1108 "testing", "SETTLE_TIME");
1110 if (GNUNET_OK == 1109 return;
1111 GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "connect_timeout", 1110 }
1112 &temp_settle)) 1111
1113 connect_timeout = 1112 if (GNUNET_OK !=
1114 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, temp_settle); 1113 GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "CONNECT_TIMEOUT",
1115 else 1114 &connect_timeout))
1116 { 1115 {
1117 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", 1116 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n",
1118 "testing", "connect_timeout"); 1117 "testing", "CONNECT_TIMEOUT");
1119 return; 1118 return;
1120 } 1119 }
1121 1120
diff --git a/src/testing/test_testing_topology_blacklist.c b/src/testing/test_testing_topology_blacklist.c
index 046cb2ca5..d53fc8cbe 100644
--- a/src/testing/test_testing_topology_blacklist.c
+++ b/src/testing/test_testing_topology_blacklist.c
@@ -390,7 +390,6 @@ run (void *cls, char *const *args, const char *cfgfile,
390 unsigned long long connect_topology_num; 390 unsigned long long connect_topology_num;
391 unsigned long long blacklist_topology_num; 391 unsigned long long blacklist_topology_num;
392 unsigned long long connect_topology_option_num; 392 unsigned long long connect_topology_option_num;
393 unsigned long long temp_connect;
394 char *connect_topology_option_modifier_string; 393 char *connect_topology_option_modifier_string;
395 394
396 ok = 1; 395 ok = 1;
@@ -485,15 +484,12 @@ run (void *cls, char *const *args, const char *cfgfile,
485 &num_peers)) 484 &num_peers))
486 num_peers = DEFAULT_NUM_PEERS; 485 num_peers = DEFAULT_NUM_PEERS;
487 486
488 if (GNUNET_OK == 487 if (GNUNET_OK !=
489 GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "connect_timeout", 488 GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "CONNECT_TIMEOUT",
490 &temp_connect)) 489 &connect_timeout))
491 connect_timeout =
492 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, temp_connect);
493 else
494 { 490 {
495 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", 491 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n",
496 "testing", "connect_timeout"); 492 "testing", "CONNECT_TIMEOUT");
497 return; 493 return;
498 } 494 }
499 495
diff --git a/src/testing/testing.conf b/src/testing/testing.conf
index 1604ebc3a..7e25f8c13 100644
--- a/src/testing/testing.conf
+++ b/src/testing/testing.conf
@@ -1,6 +1,6 @@
1[TESTING] 1[TESTING]
2# How long before failing a connection? 2# How long before failing a connection?
3CONNECT_TIMEOUT = 30 3CONNECT_TIMEOUT = 30 s
4# How many connect attempts should we make? 4# How many connect attempts should we make?
5CONNECT_ATTEMPTS = 3 5CONNECT_ATTEMPTS = 3
6# How many connections can happen simultaneously? 6# How many connections can happen simultaneously?
diff --git a/src/testing/testing_peergroup.c b/src/testing/testing_peergroup.c
index 837b50c08..0923dfc50 100644
--- a/src/testing/testing_peergroup.c
+++ b/src/testing/testing_peergroup.c
@@ -33,7 +33,7 @@
33#include "gnunet_disk_lib.h" 33#include "gnunet_disk_lib.h"
34 34
35/** Globals **/ 35/** Globals **/
36#define DEFAULT_CONNECT_TIMEOUT 30 // FIXME: use fancy time 36#define DEFAULT_CONNECT_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
37 37
38#define DEFAULT_CONNECT_ATTEMPTS 2 38#define DEFAULT_CONNECT_ATTEMPTS 2
39 39
@@ -55,7 +55,7 @@ struct PeerGroupStartupContext
55 /** 55 /**
56 * How long to spend trying to establish all the connections? 56 * How long to spend trying to establish all the connections?
57 */ 57 */
58 unsigned long long connect_timeout; // FIXME: use fancy time 58 struct GNUNET_TIME_Relative connect_timeout;
59 59
60 unsigned long long max_concurrent_ssh; 60 unsigned long long max_concurrent_ssh;
61 struct GNUNET_TIME_Absolute timeout; 61 struct GNUNET_TIME_Absolute timeout;
@@ -508,10 +508,7 @@ internal_peers_started_callback (void *cls,
508 pg_start_ctx->connect_topology, 508 pg_start_ctx->connect_topology,
509 pg_start_ctx->connect_topology_option, 509 pg_start_ctx->connect_topology_option,
510 pg_start_ctx->connect_topology_option_modifier, 510 pg_start_ctx->connect_topology_option_modifier,
511 // FIXME: use fancy time 511 pg_start_ctx->connect_timeout,
512 GNUNET_TIME_relative_multiply(
513 GNUNET_TIME_UNIT_SECONDS,
514 pg_start_ctx->connect_timeout),
515 pg_start_ctx->connect_attempts, NULL, 512 pg_start_ctx->connect_attempts, NULL,
516 NULL); 513 NULL);
517 514
@@ -740,6 +737,7 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
740 unsigned long long temp_config_number; 737 unsigned long long temp_config_number;
741 char *temp_str; 738 char *temp_str;
742 int temp; 739 int temp;
740 struct GNUNET_TIME_Relative rtimeout;
743 741
744 GNUNET_assert (total > 0); 742 GNUNET_assert (total > 0);
745 GNUNET_assert (cfg != NULL); 743 GNUNET_assert (cfg != NULL);
@@ -757,10 +755,10 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
757 } 755 }
758 756
759 if (GNUNET_OK != 757 if (GNUNET_OK !=
760 GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "connect_timeout", 758 GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "CONNECT_TIMEOUT",
761 &pg_start_ctx->connect_timeout)) 759 &pg_start_ctx->connect_timeout))
762 { 760 {
763 pg_start_ctx->connect_timeout = DEFAULT_CONNECT_TIMEOUT; 761 pg_start_ctx->connect_timeout = DEFAULT_CONNECT_TIMEOUT;
764 } 762 }
765 763
766 if (GNUNET_OK != 764 if (GNUNET_OK !=
@@ -796,21 +794,18 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
796 return NULL; 794 return NULL;
797 } 795 }
798 796
799 if (GNUNET_OK == 797 if (GNUNET_OK !=
800 GNUNET_CONFIGURATION_get_value_number (cfg, "testing", 798 GNUNET_CONFIGURATION_get_value_number (cfg, "testing",
801 "peergroup_timeout", 799 "PEERGROUP_TIMEOUT",
802 &temp_config_number)) 800 &rtimeout))
803 pg_start_ctx->timeout =
804 GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply
805 (GNUNET_TIME_UNIT_SECONDS,
806 temp_config_number));
807 else
808 { 801 {
809 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", 802 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n",
810 "testing", "peergroup_timeout"); 803 "testing", "PEERGROUP_TIMEOUT");
811 GNUNET_free (pg_start_ctx); 804 GNUNET_free (pg_start_ctx);
812 return NULL; 805 return NULL;
813 } 806 }
807 pg_start_ctx->timeout =
808 GNUNET_TIME_relative_to_absolute (rtimeout);
814 809
815 810
816 /* Read topology related options from the configuration file */ 811 /* Read topology related options from the configuration file */