diff options
Diffstat (limited to 'src')
6 files changed, 27 insertions, 24 deletions
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c index 3422ef2fd..2eacbd765 100644 --- a/src/transport/test_quota_compliance.c +++ b/src/transport/test_quota_compliance.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #include "transport.h" | 36 | #include "transport.h" |
37 | #include "transport-testing.h" | 37 | #include "transport-testing.h" |
38 | 38 | ||
39 | #define VERBOSE GNUNET_EXTRA_LOGGING | 39 | #define VERBOSE GNUNET_YES |
40 | 40 | ||
41 | #define VERBOSE_ARM GNUNET_EXTRA_LOGGING | 41 | #define VERBOSE_ARM GNUNET_EXTRA_LOGGING |
42 | 42 | ||
@@ -150,24 +150,21 @@ end () | |||
150 | if (datarate > quota_in_p2) | 150 | if (datarate > quota_in_p2) |
151 | { | 151 | { |
152 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 152 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
153 | "Datarate of %llu higher than allowed inbound quota of %llu\n", datarate, quota_in_p2); | 153 | "Datarate of %llu b/s higher than allowed inbound quota of %llu b/s\n", datarate, quota_in_p2); |
154 | test_failed = GNUNET_YES; | 154 | test_failed = GNUNET_YES; |
155 | } | 155 | } |
156 | if (datarate > quota_out_p1) | 156 | if (datarate > quota_out_p1) |
157 | { | 157 | { |
158 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 158 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
159 | "Datarate of %llu higher than allowed outbound quota of %llu\n", datarate, quota_out_p1); | 159 | "Datarate of %llu b/s higher than allowed outbound quota of %llu b/s\n", datarate, quota_out_p1); |
160 | test_failed = GNUNET_YES; | 160 | test_failed = GNUNET_YES; |
161 | } | 161 | } |
162 | if (test_failed == GNUNET_NO) | 162 | if (test_failed == GNUNET_NO) |
163 | { | 163 | { |
164 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 164 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
165 | "Datarate of %llu complied to allowed outbound quota of %llu and inbound quota of %llu\n", datarate, quota_out_p1, quota_in_p2); | 165 | "Datarate of %llu b/s complied to allowed outbound quota of %llu b/s and inbound quota of %llu b/s\n", datarate, quota_out_p1, quota_in_p2); |
166 | } | 166 | } |
167 | 167 | ||
168 | |||
169 | |||
170 | |||
171 | if (die_task != GNUNET_SCHEDULER_NO_TASK) | 168 | if (die_task != GNUNET_SCHEDULER_NO_TASK) |
172 | GNUNET_SCHEDULER_cancel (die_task); | 169 | GNUNET_SCHEDULER_cancel (die_task); |
173 | 170 | ||
@@ -189,6 +186,9 @@ end_badly () | |||
189 | die_task = GNUNET_SCHEDULER_NO_TASK; | 186 | die_task = GNUNET_SCHEDULER_NO_TASK; |
190 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); | 187 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); |
191 | 188 | ||
189 | if (measure_task != GNUNET_SCHEDULER_NO_TASK) | ||
190 | GNUNET_SCHEDULER_cancel (measure_task); | ||
191 | |||
192 | if (test_connected == GNUNET_YES) | 192 | if (test_connected == GNUNET_YES) |
193 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peers got connected\n"); | 193 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peers got connected\n"); |
194 | else | 194 | else |
@@ -462,20 +462,19 @@ void start_cb (struct PeerContext * p, | |||
462 | } | 462 | } |
463 | 463 | ||
464 | static char * | 464 | static char * |
465 | generate_config (char * cfg_file_p1, unsigned long long quota_in, unsigned long long quota_out) | 465 | generate_config (char * cfg_file, unsigned long long quota_in, unsigned long long quota_out) |
466 | { | 466 | { |
467 | char * fname = NULL; | 467 | char * fname = NULL; |
468 | struct GNUNET_CONFIGURATION_Handle *cfg = GNUNET_CONFIGURATION_create(); | 468 | struct GNUNET_CONFIGURATION_Handle *cfg = GNUNET_CONFIGURATION_create(); |
469 | GNUNET_CONFIGURATION_load (cfg, cfg_file_p1); | 469 | GNUNET_CONFIGURATION_load (cfg, cfg_file); |
470 | 470 | GNUNET_asprintf (&fname, "q_in_%u_q_out_%u_%s", quota_in, quota_out, cfg_file); | |
471 | GNUNET_CONFIGURATION_set_value_number(cfg, "core", "TOTAL_QUOTA_IN", quota_in); | 471 | GNUNET_CONFIGURATION_set_value_string(cfg, "PATHS", "DEFAULTCONFIG", fname); |
472 | GNUNET_CONFIGURATION_set_value_number(cfg, "core", "TOTAL_QUOTA_OUT", quota_out); | 472 | GNUNET_CONFIGURATION_set_value_number(cfg, "core", "TOTAL_QUOTA_OUT", quota_out); |
473 | 473 | GNUNET_CONFIGURATION_set_value_number(cfg, "core", "TOTAL_QUOTA_IN", quota_in); | |
474 | GNUNET_asprintf (&fname, "q_in_%ull_q_out_%ull_%s", quota_in, quota_out, cfg_file_p1); | 474 | GNUNET_CONFIGURATION_set_value_number(cfg, "ats", "TOTAL_QUOTA_IN", quota_in); |
475 | 475 | GNUNET_CONFIGURATION_set_value_number(cfg, "ats", "TOTAL_QUOTA_OUT", quota_out); | |
476 | GNUNET_CONFIGURATION_write(cfg, fname); | 476 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_write(cfg, fname)); |
477 | GNUNET_CONFIGURATION_destroy(cfg); | 477 | GNUNET_CONFIGURATION_destroy(cfg); |
478 | |||
479 | return fname; | 478 | return fname; |
480 | } | 479 | } |
481 | 480 | ||
@@ -551,7 +550,7 @@ check () | |||
551 | { | 550 | { |
552 | static char *argv[] = { "test_transport-quota-compliance", | 551 | static char *argv[] = { "test_transport-quota-compliance", |
553 | "-c", | 552 | "-c", |
554 | "test_transport_api_data.conf", | 553 | "", |
555 | #if VERBOSE | 554 | #if VERBOSE |
556 | "-L", "DEBUG", | 555 | "-L", "DEBUG", |
557 | #endif | 556 | #endif |
diff --git a/src/transport/test_quota_compliance_unix_asymmetric_peer1.conf b/src/transport/test_quota_compliance_unix_asymmetric_peer1.conf index f562d4c1a..649cf1c63 100644 --- a/src/transport/test_quota_compliance_unix_asymmetric_peer1.conf +++ b/src/transport/test_quota_compliance_unix_asymmetric_peer1.conf | |||
@@ -1,7 +1,7 @@ | |||
1 | @INLINE@ template_cfg_peer1.conf | 1 | @INLINE@ template_cfg_peer1.conf |
2 | [PATHS] | 2 | [PATHS] |
3 | SERVICEHOME = /tmp/test_quota_compliance_peer1/ | 3 | SERVICEHOME = /tmp/test_quota_compliance_peer1/ |
4 | DEFAULTCONFIG = test_quota_compliance_unix_peer1.conf | 4 | DEFAULTCONFIG = test_quota_compliance_unix_asymmetric_peer1.conf |
5 | 5 | ||
6 | [arm] | 6 | [arm] |
7 | PORT = 4087 | 7 | PORT = 4087 |
@@ -24,5 +24,6 @@ PORT = 4091 | |||
24 | PLUGINS = unix | 24 | PLUGINS = unix |
25 | UNIXPATH = /tmp/test_quota_compliance_unix_transport_peer1.sock | 25 | UNIXPATH = /tmp/test_quota_compliance_unix_transport_peer1.sock |
26 | 26 | ||
27 | 27 | [transport-unix] | |
28 | PORT = 4092 | ||
28 | 29 | ||
diff --git a/src/transport/test_quota_compliance_unix_asymmetric_peer2.conf b/src/transport/test_quota_compliance_unix_asymmetric_peer2.conf index b444cb48c..fa24517ee 100644 --- a/src/transport/test_quota_compliance_unix_asymmetric_peer2.conf +++ b/src/transport/test_quota_compliance_unix_asymmetric_peer2.conf | |||
@@ -1,7 +1,7 @@ | |||
1 | @INLINE@ template_cfg_peer1.conf | 1 | @INLINE@ template_cfg_peer1.conf |
2 | [PATHS] | 2 | [PATHS] |
3 | SERVICEHOME = /tmp/test_quota_compliance_peer2 | 3 | SERVICEHOME = /tmp/test_quota_compliance_peer2 |
4 | DEFAULTCONFIG = test_quota_compliance_unix_peer2.conf | 4 | DEFAULTCONFIG = test_quota_compliance_unix_asymmetric_peer2.conf |
5 | 5 | ||
6 | [arm] | 6 | [arm] |
7 | PORT = 3087 | 7 | PORT = 3087 |
diff --git a/src/transport/test_quota_compliance_unix_peer1.conf b/src/transport/test_quota_compliance_unix_peer1.conf index f562d4c1a..60e656bad 100644 --- a/src/transport/test_quota_compliance_unix_peer1.conf +++ b/src/transport/test_quota_compliance_unix_peer1.conf | |||
@@ -3,6 +3,9 @@ | |||
3 | SERVICEHOME = /tmp/test_quota_compliance_peer1/ | 3 | SERVICEHOME = /tmp/test_quota_compliance_peer1/ |
4 | DEFAULTCONFIG = test_quota_compliance_unix_peer1.conf | 4 | DEFAULTCONFIG = test_quota_compliance_unix_peer1.conf |
5 | 5 | ||
6 | [transport-unix] | ||
7 | PORT = 12120 | ||
8 | |||
6 | [arm] | 9 | [arm] |
7 | PORT = 4087 | 10 | PORT = 4087 |
8 | UNIXPATH = /tmp/test_quota_compliance_unix_arm_peer1.sock | 11 | UNIXPATH = /tmp/test_quota_compliance_unix_arm_peer1.sock |
@@ -23,6 +26,3 @@ UNIXPATH = /tmp/test_quota_compliance_unix_peerinfo_peer1.sock | |||
23 | PORT = 4091 | 26 | PORT = 4091 |
24 | PLUGINS = unix | 27 | PLUGINS = unix |
25 | UNIXPATH = /tmp/test_quota_compliance_unix_transport_peer1.sock | 28 | UNIXPATH = /tmp/test_quota_compliance_unix_transport_peer1.sock |
26 | |||
27 | |||
28 | |||
diff --git a/src/transport/test_quota_compliance_unix_peer2.conf b/src/transport/test_quota_compliance_unix_peer2.conf index b444cb48c..42db979a2 100644 --- a/src/transport/test_quota_compliance_unix_peer2.conf +++ b/src/transport/test_quota_compliance_unix_peer2.conf | |||
@@ -3,6 +3,9 @@ | |||
3 | SERVICEHOME = /tmp/test_quota_compliance_peer2 | 3 | SERVICEHOME = /tmp/test_quota_compliance_peer2 |
4 | DEFAULTCONFIG = test_quota_compliance_unix_peer2.conf | 4 | DEFAULTCONFIG = test_quota_compliance_unix_peer2.conf |
5 | 5 | ||
6 | [transport-unix] | ||
7 | PORT = 12136 | ||
8 | |||
6 | [arm] | 9 | [arm] |
7 | PORT = 3087 | 10 | PORT = 3087 |
8 | UNIXPATH = /tmp/test_quota_compliance_unix_arm_peer2.sock | 11 | UNIXPATH = /tmp/test_quota_compliance_unix_arm_peer2.sock |
diff --git a/src/transport/test_transport_api_unix_peer2.conf b/src/transport/test_transport_api_unix_peer2.conf index 30b44e51d..a15358844 100644 --- a/src/transport/test_transport_api_unix_peer2.conf +++ b/src/transport/test_transport_api_unix_peer2.conf | |||
@@ -25,5 +25,5 @@ PLUGINS = unix | |||
25 | UNIXPATH = /tmp/gnunet-p2-service-transport.sock | 25 | UNIXPATH = /tmp/gnunet-p2-service-transport.sock |
26 | 26 | ||
27 | [transport-unix] | 27 | [transport-unix] |
28 | PORT = 12131 | 28 | PORT = 12136 |
29 | 29 | ||