aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_entrynodes.c
AgeCommit message (Collapse)Author
2017-03-26Merge remote-tracking branch 'origin/maint-0.3.0'Nick Mathewson
2017-03-26Tweak test_entrynodes commentNick Mathewson
2017-03-23Use update_approx_time() to run a test 100 days in the past.Nick Mathewson
Fixes bug21799.
2017-03-15Run the copyright update script.Nick Mathewson
2017-01-30Remove XXXXprop271 comments from test_entrynodes.cNick Mathewson
These commments were complaints about how I didn't like some aspects of prop271. They have been superseded by ticket 20832.
2017-01-24Add a unit test for dropguardsNick Mathewson
2017-01-18Remove GS_TYPE_LEGACYNick Mathewson
2017-01-18Remove UseDeprecatedGuardAlgorithm.Nick Mathewson
2017-01-18Remove the (no longer compiled) code for legacy guard selection.Nick Mathewson
Part of 20830.
2016-12-16Fix another pointless stack-protector warning.Nick Mathewson
This is the same as we fixed in 39f455468731d4746adb729a67.
2016-12-16Resolve some coverity complaints in test_entrynodes.cNick Mathewson
2016-12-16Fix broken entrynodes/retry_unreachable testNick Mathewson
I broke this with 20292ec4974b777d430e7962cc38349c5f82b220 when I changed the primary guard retry schedule.
2016-12-16Make NumDirectoryGuards work with the new guard algorithm.Nick Mathewson
Now that we support NumEntryGuards, NumDirectoryGuards is pretty easy to put back in.
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-12-16Tests for choosing which guard_selection to useNick Mathewson
2016-12-16Update node-selection tests to consider restrictionsNick Mathewson
2016-12-16Tests for restricted-circuit cases of upgrade_waiting_circuits()Nick Mathewson
2016-12-16prop271: Tests for the highlevel or_state_t encode/decode functionsNick Mathewson
2016-12-16Add a test for entry_guard_state_should_expire()Nick Mathewson
2016-12-16Repair unit test for tiny-network case.Nick Mathewson
The test assumed that the old rules about handling small max_sample were in effect, and didn't actually handle that case very well anyway.
2016-12-16Implement support for per-circuit guard restrictions.Nick Mathewson
This is an important thing I hadn't considered when writing prop271: sometimes you have to restrict what guard you use for a particular circuit. Most frequently, that would be because you plan to use a certain node as your exit, and so you can't choose that for your guard. This change means that the upgrade-waiting-circuits algorithm needs a slight tweak too: circuit A cannot block circuit B from upgrading if circuit B needs to follow a restriction that circuit A does not follow.
2016-12-16Re-enable some disabled tests about switching guard_selectionsNick Mathewson
2016-12-16Change return value of entry_guard_succeeded to an enum.Nick Mathewson
George pointed out that (-1,0,1) for (never usable, maybe usable later, usable right now) was a pretty rotten convention that made the code harder to read.
2016-12-16Lay down some infrastructure for bridges in the New Guard Order.Nick Mathewson
This includes: * making bridge_info_t exposed but opaque * allowing guards where we don't know an identity * making it possible to learn the identity of a guard * creating a guard that lacks a node_t * remembering a guard's address and port. * Looking up a guard by address and port. * Only enforcing the rule that we need a live consensus to update the "listed" status for guards when we are not using bridges.
2016-12-16Remove guard_selection argument from status-reporting functionsNick Mathewson
This prevents us from mixing up multiple guard_selections
2016-12-16Have multiple guard contexts we can switch between.Nick Mathewson
Currently, this code doesn't actually have the contexts behave differently, (except for the legacy context), but it does switch back and forth between them nicely.
2016-12-16More entry guard tests: for cancel, and for upgrade.Nick Mathewson
2016-12-16Test for entry_guard_has_higher_priority().Nick Mathewson
2016-12-16Unit tests for entry_guard_{pick_for_circuit,succeeded,failed}Nick Mathewson
2016-12-16Turn #defines for prop271 into networkstatus paramsNick Mathewson
Some of these will get torrc options to override them too; this is just the mechanical conversion. Also, add documentation for a couple of undocumented (but now used) parameters.
2016-12-16Test no-consensus case for filter.Nick Mathewson
2016-12-16Test get_guard_selection_by_nameNick Mathewson
2016-12-16Make sure primary-guards are up-to-date when we inspect them.Nick Mathewson
(Plus some magic to prevent and detect recursive invocation of entry_guards_update_primary(), since that can cause some pretty tricky misbehavior.)
2016-11-30Make new prop271 entry guards persistentNick Mathewson
To do this, it makes sense to treat legacy guards as a separate guard_selection_t *, and handle them separately. This also means we add support here for having multiple guard selections. Note that we don't persist pathbias information yet; that will take some refactoring.
2016-11-30Add an (as yet) unused UseDeprecatedGuardAlgorithm_ option.Nick Mathewson
I expect we'll be ripping this out somewhere in 0.3.0, but let's keep it around for a little while in case it turns out to be the only way to avert disaster?
2016-11-30Implement most of the prop271 data structure backends.Nick Mathewson
This code handles: * Maintaining the sampled set, the filtered set, and the usable_filtered set. * Maintaining the confirmed and primary guard lists. * Picking guards for circuits, and updating guard state when circuit state changes. Additionally, I've done code structure movement: even more constants and structures from entrynodes.c have become ENTRYNODES_PRIVATE fields of entrynodes.h. I've also included a bunch of documentation and a bunch of unit tests. Coverage on the new code is pretty high. I've noted important things to resolve before this branch is done with the /XXXX.*prop271/ regex.
2016-11-30Initial code to parse/encode/sample prop271 guardsNick Mathewson
The encoding code is very straightforward. The decoding code is a bit tricky, but clean-ish. The sampling code is untested and probably needs more work.
2016-11-30Add an entry_guard_describe() functionNick Mathewson
This function helpfully removes all but one remaining use of an entry_guard_t private field in pathbias.c
2016-11-30Move path-bias fields into a separate structureNick Mathewson
(Other than the field movement, the code changes here are just search-and-replace)
2016-09-25Abolish globals in entrynodes.c; relativize guard context to new ↵Andrea Shepard
guard_selection_t structure
2016-02-27Update the copyright year.Nick Mathewson
2016-02-03Make bridge clients prefer the configured bridge addressteor (Tim Wilson-Brown)
When ClientPreferIPv6ORPort is auto, bridges prefer the configured bridge ORPort address. Otherwise, they use the value of the option. Other clients prefer IPv4 ORPorts if ClientPreferIPv6ORPort is auto. When ClientPreferIPv6DirPort is auto, all clients prefer IPv4 DirPorts.
2016-01-29Automatically use IPv6 when ClientUseIPv4 is 0teor (Tim Wilson-Brown)
Consequential changes to log messages: * it's no longer possible to disable both IPv4 and IPv6, * refactor common string out of remaining log messages
2016-01-29Use fascist firewall and ClientUseIPv4 for bridge clientsteor (Tim Wilson-Brown)
Bridge clients ignore ClientUseIPv6, acting as if it is always 1. This preserves existing behaviour. Make ClientPreferIPv6OR/DirPort auto by default: * Bridge clients prefer IPv6 by default. * Other clients prefer IPv4 by default. This preserves existing behaviour.
2016-01-29Choose OR Entry Guards using IPv4/IPv6 preferencesteor (Tim Wilson-Brown)
Update unit tests.
2016-01-29Add ClientUseIPv4 and ClientPreferIPv6DirPort torrc optionsteor (Tim Wilson-Brown)
ClientUseIPv4 0 tells tor to avoid IPv4 client connections. ClientPreferIPv6DirPort 1 tells tor to prefer IPv6 directory connections. Refactor policy for IPv4/IPv6 preferences. Fix a bug where node->ipv6_preferred could become stale if ClientPreferIPv6ORPort was changed after the consensus was loaded. Update documentation, existing code, add unit tests.
2015-04-01Update entrynodes unit test for dirsSebastian Hahn
We no longer base our opinion on whether someone is a directory solely on the routerstatus we might have for that relay, but also on a routerinfo. Remove logic in test checking that. This broke unit tests in 05f7336624d6a47b3cf0f. Reported by toralf on #tor-dev, thanks!
2015-02-18Combine test_helpers.[ch] and testhelper.[ch]Nick Mathewson
2015-02-18Merge branch 'bug9321_rerebase'Nick Mathewson
Conflicts: src/or/dirvote.h src/test/include.am src/test/test_entrynodes.c
2015-02-18Unittest prep: Move get_yesterday_date_str() to helper file.George Kadianakis
We want to use this function in our guardfraction unittests, so make a test_helpers module and move it there.