diff options
author | Nick Mathewson <nickm@torproject.org> | 2021-03-17 08:45:37 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2021-03-17 08:45:37 -0400 |
commit | 2ae24d003d1d12e8e202748c4398d7438e4a65d9 (patch) | |
tree | ed28225754a655c069a9a6d5fd6b66af2fdfc205 /src/test | |
parent | 59bbf8cde9144ee5c8d060959e723a4bedfd6bb8 (diff) | |
download | tor-2ae24d003d1d12e8e202748c4398d7438e4a65d9.tar.gz tor-2ae24d003d1d12e8e202748c4398d7438e4a65d9.zip |
Add a MinTimeToReportBandwidth option; make it 0 for testing networks.
This option changes the time for which a bandwidth measurement period
must have been in progress before we include it when reporting our
observed bandwidth in our descriptors. Without this option, we only
consider a time period towards our maximum if it has been running
for a full day. Obviously, that's unacceptable for testing
networks, where we'd like to get results as soon as possible.
For non-testing networks, I've put a (somewhat arbitrary) 2-hour
minimum on the option, since there are traffic analysis concerns
with immediate reporting here.
Closes #40337.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_relay.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test_relay.c b/src/test/test_relay.c index b287f0d38b..8ed29b6282 100644 --- a/src/test/test_relay.c +++ b/src/test/test_relay.c @@ -98,7 +98,7 @@ test_relay_close_circuit(void *arg) tt_int_op(new_count, OP_EQ, old_count + 1); /* Ensure our write totals are 0 */ - tt_u64_op(find_largest_max(write_array), OP_EQ, 0); + tt_u64_op(find_largest_max(write_array, 86400), OP_EQ, 0); /* Mark the circuit for close */ circuit_mark_for_close(TO_CIRCUIT(orcirc), 0); @@ -107,7 +107,7 @@ test_relay_close_circuit(void *arg) advance_obs(write_array); commit_max(write_array); /* Check for two cells plus overhead */ - tt_u64_op(find_largest_max(write_array), OP_EQ, + tt_u64_op(find_largest_max(write_array, 86400), OP_EQ, 2*(get_cell_network_size(nchan->wide_circ_ids) +TLS_PER_CELL_OVERHEAD)); |