aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_routerlist.c
AgeCommit message (Collapse)Author
2018-05-08Improve tolerance for dirauths with skewed clocksTaylor Yu
Previously, an authority with a clock more than 60 seconds ahead could cause a client with a correct clock to warn that the client's clock was behind. Now the clocks of a majority of directory authorities have to be ahead of the client before this warning will occur. Relax the early-consensus check so that a client's clock must be 60 seconds behind the earliest time that a given sufficiently-signed consensus could possibly be available. Add a new unit test that calls warn_early_consensus() directly. Fixes bug 25756; bugfix on 0.2.2.25-alpha.
2018-05-08Test early-consensus clock skew warningsTaylor Yu
2018-05-08tests: Add "now" param to construct_consensus()Taylor Yu
construct_consensus() in test_routerlist.c created votes using a timestamp from time(). Tests that called construct_consensus() might have nondeterministic results if they rely on time() not changing too much on two successive calls. Neither existing of the two existing tests that calls construct_consensus is likely to have a failure due to this problem.
2018-05-03Merge remote-tracking branch 'isis/bug24660_r1'Nick Mathewson
2018-04-27mod: Move dirauth specific files to its own moduleDavid Goulet
This is a pretty big commit but it only moves these files to src/or/dirauth: dircollate.c dirvote.c shared_random.c shared_random_state.c dircollate.h dirvote.h shared_random.h shared_random_state.h Then many files are modified to change the include line for those header files that have moved into a new directory. Without using --disable-module-dirauth, everything builds fine. When using the flag to disable the module, tor doesn't build due to linking errors. This will be addressed in the next commit(s). No code behavior change. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-04-06crypto: Refactor (P)RNG functionality into new crypto_rand module.Isis Lovecruft
* ADD new /src/common/crypto_rand.[ch] module. * ADD new /src/common/crypto_util.[ch] module (contains the memwipe() function, since all crypto_* modules need this). * FIXES part of #24658: https://bugs.torproject.org/24658
2017-12-08Rename connection_free_ to connection_free_minimal.Nick Mathewson
2017-11-09Fix unit test behavior: we need to be in STATE_LIVE.Nick Mathewson
2017-11-01test: Fix SR initialization in routerlist testDavid Goulet
Fixes #24053 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-10-25Fix offending unittest and add changes file for #23862.George Kadianakis
2017-10-25Add a unittest that reveals the offending case of #23862.George Kadianakis
2017-08-24apply ahf's test_assert_null.cocciNick Mathewson
2017-08-24apply ahf's test_assert_int.cocciNick Mathewson
2017-08-24Fix operator usage in src/test/*.cAlexander Færøy
This patch fixes the operator usage in src/test/*.c to use the symbolic operators instead of the normal C comparison operators. This patch was generated using: ./scripts/coccinelle/test-operator-cleanup src/test/*.[ch]
2017-03-15Run the copyright update script.Nick Mathewson
2017-01-18Remove the (no longer compiled) code for legacy guard selection.Nick Mathewson
Part of 20830.
2016-12-16Wrap all of the legacy guard code, and its users, in #ifdefsNick Mathewson
This will make it easier to see what we remove down the line.
2016-10-19Compilation fix. (function pointer implicit cast in tests.)Nick Mathewson
2016-09-25Abolish globals in entrynodes.c; relativize guard context to new ↵Andrea Shepard
guard_selection_t structure
2016-07-01prop250: Add unit testsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
2016-06-11Add -Wmissing-variable-declarations, with attendant fixesNick Mathewson
This is a big-ish patch, but it's very straightforward. Under this clang warning, we're not actually allowed to have a global variable without a previous extern declaration for it. The cases where we violated this rule fall into three roughly equal groups: * Stuff that should have been static. * Stuff that was global but where the extern was local to some other C file. * Stuff that was only global when built for the unit tests, that needed a conditional extern in the headers. The first two were IMO genuine problems; the last is a wart of how we build tests.
2016-05-19Add unit tests for networkstatus_consensus_is_bootstrappingteor (Tim Wilson-Brown)
2016-02-27Update the copyright year.Nick Mathewson
2016-02-24Fix memory leaks in routerlist/pick_directory_server_impl testNick Mathewson
2016-02-23Appease make check-spacesAndrea Shepard
2016-02-22Fix a bunch of memory leaks in the unit testsNick Mathewson
2016-02-16Fix a NULL dereference on unit test failure. CID 1353177.Nick Mathewson
2016-02-11Merge remote-tracking branch 'teor/feature17840-v11-merged-v2'Nick Mathewson
2016-02-01Bitwise negate is ~, not !.Nick Mathewson
Spotted by coverity; bug in tests only, not in any released Tor. This is CID 1351128
2016-01-29Merge branch 'feature17840-v11-squashed' into feature17840-v11-mergedteor (Tim Wilson-Brown)
Conflicts: src/or/directory.c src/test/test_routerlist.c Fix minor conflicts.
2016-01-29Choose directory servers by IPv4/IPv6 preferencesteor (Tim Wilson-Brown)
Add unit tests, refactor pick_directory functions.
2015-12-18fix routerlist/pick_directory_server_impl in light of 12538Nick Mathewson
2015-12-18Add unit test for router_pick_directory_server_implMatthew Finkel
2015-12-16Prop210: Add want_authority to directory_get_from_dirserverteor (Tim Wilson-Brown)
2015-01-23whitespace fixesNick Mathewson
2015-01-23Merge remote-tracking branch 'public/ticket9969'Nick Mathewson
Conflicts: src/or/directory.c src/or/routerlist.c src/or/routerlist.h src/test/include.am src/test/test.c
2014-09-29fixup! Unit tests for router download functions.Nick Mathewson
(Add missing test_routerlist.c that I forgot to add from arlo's branch last time. Oops.)