mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-09-20 13:06:20 +02:00
fixup! Add networkstatus_consensus_has_ipv6() and unit tests
This is what happens when you don't run: make check-spaces make check-changes
This commit is contained in:
parent
b66b62fb75
commit
bbc781885d
@ -1,7 +1,7 @@
|
||||
o Minor feature (IPv6):
|
||||
- When a consensus has IPv6 ORPorts, make IPv6-only clients use them,
|
||||
rather than waiting to download microdescriptors.
|
||||
Implements #23827.
|
||||
Implements 23827.
|
||||
- Make IPv6-only clients wait for microdescs for relays, even if we were
|
||||
previously using descriptors (or were using them as a bridge) and have
|
||||
a cached descriptor for them.
|
||||
|
@ -6228,25 +6228,30 @@ test_dir_networkstatus_consensus_has_ipv6(void *arg)
|
||||
/* Test the bounds for A lines in the microdesc consensus */
|
||||
mock_options->UseMicrodescriptors = 1;
|
||||
|
||||
mock_networkstatus->consensus_method = MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS;
|
||||
mock_networkstatus->consensus_method =
|
||||
MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS;
|
||||
has_ipv6 = networkstatus_consensus_has_ipv6(get_options());
|
||||
tt_assert(has_ipv6);
|
||||
|
||||
mock_networkstatus->consensus_method = MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS + 1;
|
||||
mock_networkstatus->consensus_method =
|
||||
MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS + 1;
|
||||
has_ipv6 = networkstatus_consensus_has_ipv6(get_options());
|
||||
tt_assert(has_ipv6);
|
||||
|
||||
mock_networkstatus->consensus_method = MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS + 20;
|
||||
mock_networkstatus->consensus_method =
|
||||
MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS + 20;
|
||||
has_ipv6 = networkstatus_consensus_has_ipv6(get_options());
|
||||
tt_assert(has_ipv6);
|
||||
|
||||
mock_networkstatus->consensus_method = MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS - 1;
|
||||
mock_networkstatus->consensus_method =
|
||||
MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS - 1;
|
||||
has_ipv6 = networkstatus_consensus_has_ipv6(get_options());
|
||||
tt_assert(!has_ipv6);
|
||||
|
||||
/* Test the edge cases */
|
||||
mock_options->UseMicrodescriptors = 1;
|
||||
mock_networkstatus->consensus_method = MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS;
|
||||
mock_networkstatus->consensus_method =
|
||||
MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS;
|
||||
|
||||
/* Reasonably live */
|
||||
mock_networkstatus->valid_until = time(NULL) - 60;
|
||||
|
Loading…
Reference in New Issue
Block a user