aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_options.c
AgeCommit message (Collapse)Author
2017-11-04ClientDNSRejectInternalAddresses in non-default networksSebastian Hahn
Once again allow the flag to be set, unless the default network is used. Thanks to nickm for a suggestion for the workaround to a test failure.
2017-09-19tests: fix transproxy tests on BSD systemsMatt Traudt
2017-09-15Replace accumulated C ;;s with ;sNick Mathewson
I don't know where these came from.
2017-09-15Merge branch 'scan-build-032'Nick Mathewson
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-09-15Merge remote-tracking branch 'dgoulet/ticket12541_032_02'Nick Mathewson
2017-09-15test: Fix unit tests with latest scheduler changesDavid Goulet
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-12Clear up dead-assignment warnings from scan-buildNick Mathewson
2017-09-12Merge branch 'bug23347_squashed'Nick Mathewson
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-08-31config: Make parse_outbound_addresses() return failuresDavid Goulet
The function was never returning an error code on failure to parse the OutboundAddress* options. In the process, it was making our test_options_validate__outbound_addresses() not test the right thing. Fixes #23366 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24apply ahf's test_assert_null.cocciNick Mathewson
2017-08-24apply ahf's test_assert_int.cocciNick Mathewson
2017-05-10Test config line parsing errorsTaylor Yu
Add tests for lower-level syntax errors in config file lines. Fixes #22177.
2017-05-09Merge branch 'dgoulet_ticket22060_031_01_squashed'Nick Mathewson
2017-05-09config: Remove {Control,DNS,Dir,Socks,Trans,NATD,OR}ListenAddress optionDavid Goulet
Deprecated in 0.2.9.2-alpha, this commits changes it as OBSOLETE() and cleans up the code associated with it. Partially fixes #22060 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-05-09config: Remove TLSECGroup optionDavid Goulet
Deprecated in 0.2.9.2-alpha, this commits changes it as OBSOLETE() and cleans up the code associated with it. Partially fixes #22060 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-05-09config: Remove AllowSingleHopExits optionDavid Goulet
Deprecated in 0.2.9.2-alpha, this commits changes it as OBSOLETE() and cleans up the code associated with it. Partially fixes #22060 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-05-09config: Remove AllowInvalidNodes optionDavid Goulet
Deprecated in 0.2.9.2-alpha, this commits changes it as OBSOLETE() and cleans up the code associated with it. Partially fixes #22060 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-05-08Merge branch 'netflow_padding-v6-rebased2-squashed'Nick Mathewson
2017-05-08Fix a breakage in test_options.c.Mike Perry
IMO, these tests should be calling options_init() to properly set everything to default values, but when that is done, about a dozen tests fail. Setting the one default value that broke the tests for my branch. Sorry for being lame.
2017-05-08Remove a PredictedPortsRelevantTime test.Mike Perry
The option was deprecated by bug #17592.
2017-05-05Remove dead code in test_options_validate_impl().Alexander Færøy
Dead branch found by Coverity in CID #1405875.
2017-05-03Fix additional leaks in #22103 testsTaylor Yu
test_options_validate_impl() incorrectly executed subsequent phases of config parsing and validation after an expected error. This caused msg to leak when those later phases (which would likely produce errors as well) overwrote it.
2017-05-03Fix memory management for #22103 testsTaylor Yu
Code movement in the commit introducings tests for #22103 uncovered a latent memory management bug. Refactor the log message checking from test_options_checkmsgs() into a helper test_options_checklog(). This avoids a memory leak (and possible double-free) in a test failure condition. Don't reuse variables (especially pointers to allocated memory!) for multiple unrelated purposes. Fixes CID 1405778.
2017-05-02Add tests for #22103Taylor Yu
Also factor out the error message comparisions from test_options_validate_impl() into a separate function so it can check for error messages in different phases of config parsing.
2017-03-15Run the copyright update script.Nick Mathewson
2017-02-03Use the standard OpenBSD preprocessor definitioncypherpunks
2017-02-02test: Fix test after log message changed in #21294David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-01-14Disallow setting UseBridges to 1 and UseEntryGuards to 0Neel Chauhan
2017-01-13Merge branch 'ipv6-only-client_squashed'Nick Mathewson
2017-01-13Remove redundant options checks for IPv6 preference conflictsteor
It is no longer possible for the IPv6 preference options to differ from the IPv6 usage: preferring IPv6 implies possibly using IPv6. Also remove the corresponding unit test warning message checks. (But keep the unit tests themselves - they now run without warnings.)
2017-01-04fixup! Fix unit test failures in response to DNS hijacking.Nick Mathewson
2017-01-03Fix unit test failures in response to DNS hijacking.Nick Mathewson
Some DNS NXDOMAIN hijackers hijack truly ridiculous domains, like "invalid-stuff!!" or "1.2.3.4.5". This would provoke unit test failures where we used addresses like that to force tor_addr_lookup() to fail. The fix, for testing, is to mock tor_addr_lookup() with a variant that always fails when it gets a name with a !. Fixes bugs 20862 and 20863.
2016-12-08Use the correct preprocessor macro for Linuxcypherpunks
Also combine all of the checks into one if-tree as only one of them should actually succeed.
2016-12-07Netbsd doesn't have ipfw, only the regular pf transport stuff.Nick Mathewson
Attempted fix for 19960. Also, fixes a typo.
2016-12-07Increase verbosity on options/validate__transproxyNick Mathewson
This is an attempt to figure out what's up with #19960
2016-11-01Attempt to fix unit tests on netbsdNick Mathewson
2016-09-13Fix a memory leak in options/validate__single_onionNick Mathewson
2016-09-13options/validate__single_onion test: use new log capture apiNick Mathewson
I changed the API here in deb294ff532d074a7d4, to be less annoying to use.
2016-09-13Merge branch 'feature-17178-v7-squashed-v2'Nick Mathewson
2016-09-13Replace OnionService* with HiddenService* in option namesteor
And make consequential line-length adjustments.
2016-09-13Refactor Single Onion code to improve consistencyteor
* Check consistency between the two single onion torrc options * Use the more relevant option each time we check for single onion mode * Clarify log messages * Clarify comments * Otherwise, no behaviour change
2016-09-13Implement Prop #260: Single Onion Servicesteor (Tim Wilson-Brown)
Add experimental OnionServiceSingleHopMode and OnionServiceNonAnonymousMode options. When both are set to 1, every hidden service on a tor instance becomes a non-anonymous Single Onion Service. Single Onions make one-hop (direct) connections to their introduction and renzedvous points. One-hop circuits make Single Onion servers easily locatable, but clients remain location-anonymous. This is compatible with the existing hidden service implementation, and works on the current tor network without any changes to older relays or clients. Implements proposal #260, completes ticket #17178. Patch by teor & asn. squash! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Implement Prop #260: Single Onion Services Redesign single onion service poisoning. When in OnionServiceSingleHopMode, each hidden service key is poisoned (marked as non-anonymous) on creation by creating a poison file in the hidden service directory. Existing keys are considered non-anonymous if this file exists, and anonymous if it does not. Tor refuses to launch in OnionServiceSingleHopMode if any existing keys are anonymous. Similarly, it refuses to launch in anonymous client mode if any existing keys are non-anonymous. Rewrite the unit tests to match and be more comprehensive. Adds a bonus unit test for rend_service_load_all_keys().
2016-09-08Simplify log_test_helpers interfaceNick Mathewson
Previously, you needed to store the previous log severity in a local variable, and it wasn't clear if you were allowed to call these functions more than once.
2016-09-08Remove redundant definitions of expect_{no_,}log_msg()Nick Mathewson
2016-08-03Add new warn_deprecated option to config_assign*().Nick Mathewson
Also, collapse all the config_assign*() options into a flags argument, since having two boolean arguments was already confusing.
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-04-12Merge branch 'maint-0.2.8'Nick Mathewson