diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2010-11-03 14:16:23 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2010-11-03 14:16:23 +0000 |
commit | fe9bbd08e5f162a1ab2271ceeab17356134a8b89 (patch) | |
tree | d93c4bbc596f679a8a54221cb3c2e7a2ab8ef4ca /src/transport/test_quota_compliance.c | |
parent | 54b11ea287f10ef626c230cd51efd0b3c06bdb5d (diff) | |
download | gnunet-fe9bbd08e5f162a1ab2271ceeab17356134a8b89.tar.gz gnunet-fe9bbd08e5f162a1ab2271ceeab17356134a8b89.zip |
test has to be more flexible with lower quota value
Diffstat (limited to 'src/transport/test_quota_compliance.c')
-rw-r--r-- | src/transport/test_quota_compliance.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c index d4adfd14e..756b8b46a 100644 --- a/src/transport/test_quota_compliance.c +++ b/src/transport/test_quota_compliance.c | |||
@@ -48,6 +48,8 @@ | |||
48 | #define MEASUREMENT_MAX_QUOTA 1024 * 1024 * 1024 | 48 | #define MEASUREMENT_MAX_QUOTA 1024 * 1024 * 1024 |
49 | #define MEASUREMENT_MIN_QUOTA 1024 | 49 | #define MEASUREMENT_MIN_QUOTA 1024 |
50 | #define SEND_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) | 50 | #define SEND_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) |
51 | #define MEASUREMENT_SOFT_LIMIT 1024 | ||
52 | |||
51 | /** | 53 | /** |
52 | * Testcase timeout | 54 | * Testcase timeout |
53 | */ | 55 | */ |
@@ -363,6 +365,8 @@ measurement_end (void *cls, | |||
363 | { | 365 | { |
364 | static int strike_counter; | 366 | static int strike_counter; |
365 | unsigned long long quota_allowed = 0; | 367 | unsigned long long quota_allowed = 0; |
368 | int delta = 0; | ||
369 | |||
366 | measurement_task = GNUNET_SCHEDULER_NO_TASK; | 370 | measurement_task = GNUNET_SCHEDULER_NO_TASK; |
367 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 371 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
368 | return; | 372 | return; |
@@ -391,7 +395,13 @@ measurement_end (void *cls, | |||
391 | else | 395 | else |
392 | quota_allowed = current_quota_p2; | 396 | quota_allowed = current_quota_p2; |
393 | 397 | ||
394 | if ((total_bytes_sent/(duration.rel_value / 1000)) > (quota_allowed + (quota_allowed / 10))) | 398 | |
399 | if (MEASUREMENT_SOFT_LIMIT > (quota_allowed/10)) | ||
400 | delta = MEASUREMENT_SOFT_LIMIT; | ||
401 | else | ||
402 | delta = (quota_allowed/10); | ||
403 | |||
404 | if ((total_bytes_sent/(duration.rel_value / 1000)) > (quota_allowed + delta)) | ||
395 | { | 405 | { |
396 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 406 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
397 | "\nQuota compliance failed: \n"\ | 407 | "\nQuota compliance failed: \n"\ |