diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2010-11-08 13:21:12 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2010-11-08 13:21:12 +0000 |
commit | 003418574034d78318d3499c644ae675f7f4899c (patch) | |
tree | aad0d36df9d972a0b0a1581915fdf78ab3a466f5 /src/transport/test_quota_compliance.c | |
parent | eacd7e172761853019dfe7122f48a5275b0cabe5 (diff) | |
download | gnunet-003418574034d78318d3499c644ae675f7f4899c.tar.gz gnunet-003418574034d78318d3499c644ae675f7f4899c.zip |
added check to prevent testcase to exit with success if throughput is 0
Diffstat (limited to 'src/transport/test_quota_compliance.c')
-rw-r--r-- | src/transport/test_quota_compliance.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c index 041bd0968..abb9507db 100644 --- a/src/transport/test_quota_compliance.c +++ b/src/transport/test_quota_compliance.c | |||
@@ -400,6 +400,23 @@ measurement_end (void *cls, | |||
400 | else | 400 | else |
401 | delta = (quota_allowed/10); | 401 | delta = (quota_allowed/10); |
402 | 402 | ||
403 | /* Throughput is far too slow. This is to prevent the test to exit with success when throughput is 0 */ | ||
404 | if ((total_bytes_sent/(duration.rel_value / 1000)) < 100) | ||
405 | { | ||
406 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
407 | "\nQuota compliance failed: \n"\ | ||
408 | "Hard quota limit allowed: %10llu kB/s (%llu B/s)\n"\ | ||
409 | "Soft quota limit allowed: %10llu kB/s (%llu B/s)\n"\ | ||
410 | "Throughput : %10llu kB/s (%llu B/s)\n", | ||
411 | (quota_allowed / (1024)), quota_allowed, | ||
412 | ((quota_allowed+delta) / (1024)), quota_allowed+delta, | ||
413 | (total_bytes_sent/(duration.rel_value / 1000)/1024), | ||
414 | total_bytes_sent/(duration.rel_value / 1000)); | ||
415 | ok = 1; | ||
416 | end(); | ||
417 | } | ||
418 | |||
419 | /* Throughput is bigger than allowed quota + some extra*/ | ||
403 | if ((total_bytes_sent/(duration.rel_value / 1000)) > (quota_allowed + delta)) | 420 | if ((total_bytes_sent/(duration.rel_value / 1000)) > (quota_allowed + delta)) |
404 | { | 421 | { |
405 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 422 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |