summaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2017-09-15Merge branch 'remove_allow_dotexit_v2'Nick Mathewson
2017-09-15Remove AllowDotExit.Nick Mathewson
It's been deprecated since 0.2.9.2-alpha. Closes ticket 23426.
2017-09-15Merge remote-tracking branch 'dgoulet/ticket12541_032_02'Nick Mathewson
2017-09-15sched: Define SCHEDULER_KIST_PRIVATE for more encapsulationDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15test: Fix unit tests with latest scheduler changesDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: Make the scheduler object staticDavid Goulet
Each type of scheduler implements its own static scheduler_t object and returns a reference to it. This commit also makes it a const pointer that is it can only change inside the scheduler type subsystem but not outside for extra protection. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: Add Schedulers torrc optionDavid Goulet
This option is a list of possible scheduler type tor can use ordered by priority. Its default value is "KIST,KISTLite,Vanilla" which means that KIST will be used first and if unavailable will fallback to KISTLite and so on. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: revisist compatibility on non-linux systemsMatt Traudt
Wrap things in HAVE_KIST_SUPPORT until Tor compiles and tests cleanly on my OS X machine.
2017-09-15sched: rename scheduler to the_schedulerMatt Traudt
2017-09-15sched: Implement the KIST schedulerMatt Traudt
Closes #12541 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: Remove vanilla sched options that will be going awayMatt Traudt
- massive change to src/tgest/test_options.c since the sched options were added all over the place in it - removing the sched options caused some tests to pass/fail in new ways so I assumed current behavior is correct and made them pass again - ex: "ConnLimit must be greater" lines - ex: "Authoritative directory servers must" line - remove test_options_validate__scheduler in prep for new sched tests Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15repair test_key_expiration.shNick Mathewson
2017-09-15test: Make check-spaces happyDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15fixup! test: Add HS v3 client-side test for picking intro pointsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15test: Add HS v3 client-side test for picking intro pointsGeorge Kadianakis
This commit adds a pretty advanced test for the client-side making sure that picking intro is done properly. This unittest also reveals a memleak on the client_pick_intro() function which is fixed by the subsequent commit. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15test: Improve HS v3 helper for building intro points.George Kadianakis
Valid intro points need both legacy key and ipv4. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15test: Unit test for the hs indexesDavid Goulet
Using a test vector in python, test both hs_build_hsdir_index() and hs_build_hs_index(). This commit also adds the hs_build_address.py to EXTRA_DIST which was missing. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15prop224 test: Enrich the client_service_hsdir_set_sync() test.George Kadianakis
Do two major improvements: a) Make the client pick 6 HSDirs instead of just 1 and make sure they all match the service's HSDirs. b) Test two additional missing scenarios borrowed from the test_reachability() test.
2017-09-14Merge remote-tracking branch 'catalyst-oniongit/skew'Nick Mathewson
2017-09-14Refactor control_event_bootstrap_problemTaylor Yu
Change the contract of control_event_bootstrap_problem() to be more general and to take a connection_t. New function control_event_bootstrap_prob_or() has the specific or_connection_t funcionality previously used.
2017-09-14Merge branch 'bug23019_squashed'Nick Mathewson
2017-09-14prop224 client-side: Start validating onion address pubkeys.George Kadianakis
Fix the test_build_address() test and its test vectors python script. They were both using a bogus pubkey for building an HS address which does not validate anymore. Also fix a few more unittests that were using bogus onion addresses and were failing the validation. I replaced the bogus address with the one generated from the test vector script.
2017-09-14Merge branch 'maint-0.3.1'Nick Mathewson
2017-09-14Merge remote-tracking branch 'mikeperry/bug23077' into maint-0.3.1Nick Mathewson
2017-09-14Bug 23077: Make channelpadding tests use mocked time.Mike Perry
2017-09-13Merge branch 'bug23466_squashed'Nick Mathewson
2017-09-13prop224 test: Test client desc expiration in tests.George Kadianakis
We enrich the test_client_cache() test in two ways: a) We check that transitioning time periods also cleans up expired descriptors in client memory. b) We test hs_cache_lookup_as_client() instead of lookup_v3_desc_as_client(). The former is a higher level function which calls the latter and allows us to test deeper into the subsystem.
2017-09-12Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2017-09-12Merge branch 'maint-0.3.1'Nick Mathewson
2017-09-12Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-09-12Avoid sscanf() warnings from openbsd in the unit testsNick Mathewson
OpenBSD doesn't like tricks where you use a too-wide sscanf argument for a too-narrow array, even when you know the input string statically. The fix here is just to use bigger buffers. Fixes 15582; bugfix on a3dafd3f58bb312 in 0.2.6.2-alpha.
2017-09-12hs-v3: Stall SOCKS connection when no live consensus availableDavid Goulet
Fixes #23481 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-12Merge branch 'ticket21031'Nick Mathewson
2017-09-12Merge branch 'bug23347_squashed'Nick Mathewson
2017-09-12Add a missing bridge download status resetteor
17750 made unused download schedules automatically reset. But we should make that explicit.
2017-09-12Make clients wait to refresh bridges when they have a recent descriptorteor
But when clients are just starting, make them try each bridge a few times before giving up on it. These changes make the bridge download schedules more explicit: before 17750, they relied on undocumented behaviour and specific schedule entries. (And between 17750 and this fix, they were broken.) Fixes 23347, not in any released version of tor.
2017-09-12Merge branch 'maint-0.3.1'Nick Mathewson
2017-09-12Merge branch 'ticket17857_squashed' into maint-0.3.1Nick Mathewson
2017-09-12Ticket #17857: Apply padding off-switch to existing connections.Mike Perry
2017-09-12Add v3 hidden service support to make test-network-allteor
Requires chutney master 50f64ea or later. Implements ticket 22437.
2017-09-11test: Fix memleaksDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-08Merge branch 'ed25519_lookup'Nick Mathewson
2017-09-08test: Test that client picks the right HSDir for service.George Kadianakis
This test is important because it tests that upload_descriptor_to_all() is in synch with pick_hsdir_v3(). That's not the case for the reachability test which just compares the responsible hsdir sets.
2017-09-08prop224: hs_time_between_tp_and_srv() -> hs_in_period_between_tp_and_srv()George Kadianakis
Conflicts: src/or/nodelist.c
2017-09-08test: Improve our rotation and build descriptor testsDavid Goulet
Because of the latest changes on when we rotate, longer lifetime of descriptors and no more overlap period, the tests needed to be improved to test more functionnalities. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-08test: Fix use out of scope and consensus timingsDavid Goulet
First, this fixes #23372. Second, the consensus timings for the build descriptor have been changed to the current test can pass. More extensive tests of descriptor rotation are coming in a commit near you because the rotation and time period logic has been changed. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-08test: Add an HS v3 reachability unit testDavid Goulet
This is a large and important unit test for the hidden service version 3! It tests the service reachability for a client using different consensus timings and makes sure that the computed hashring is the same on both side so it is actually reachable. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-08prop224: Make client and service pick same HSDirDavid Goulet
With the latest change on how we use the HSDir index, the client and service need to pick their responsible HSDir differently that is depending on if they are before or after a new time period. The overlap mode is active function has been renamed for this and test added. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-08prop224: Expand the overlap period concept to be a full SRV protocol runDavid Goulet
Because of #23387, we've realized that there is one scenario that makes the client unable to reach the service because of a desynch in the time period used. The scenario is as follows: +------------------------------------------------------------------+ | | | 00:00 12:00 00:00 12:00 00:00 12:00 | | SRV#1 TP#1 SRV#2 TP#2 SRV#3 TP#3 | | | | $==========|-----------$===========|-----------$===========| | | ^ ^ | | C S | +------------------------------------------------------------------+ In this scenario the HS has a newer consensus than the client, and the HS just moved to the next TP but the client is still stuck on the old one. However, the service is not in any sort of overlap mode so it doesn't cover the old TP anymore, so the client is unable to fetch a descriptor. We've decided to solve this by extending the concept of overlap period to be permanent so that the service always publishes two descriptors and aims to cover clients with both older and newer consensuses. See the spec patch in #23387 for more details.
2017-09-08prop224: Use fetch and store HSDir indexes.David Goulet
Based on our #23387 findings, it seems like to maintain 24/7 reachability we need to employ different logic when computing hsdir indices for fetching vs storing. That's to guarantee that the client will always fetch the current descriptor, while the service will always publish two descriptors aiming to cover all possible edge cases. For more details see the next commit and the spec branch. Signed-off-by: David Goulet <dgoulet@torproject.org>