Commit Graph

4358 Commits

Author SHA1 Message Date
Nick Mathewson a10e4d737e test_options: use testing options with (almost) real defaults.
Previously, we just used options set to all 0s, but this causes some
pretty severe workarounds throughout the code, as our options fail
to validate, or count as "default" for the wrong reasons.

Note that in some places, we stop getting spurious warnings or
failures which the tests previously demanded.  In these cases, I've
changed the test behavior.

Fixes 32175.
2019-10-21 14:12:59 -04:00
Nick Mathewson 7dc78aca29 Merge remote-tracking branch 'tor-github/pr/1430' 2019-10-21 12:43:26 -04:00
teor 7a72e71f74 Merge remote-tracking branch 'tor-github/pr/1434' 2019-10-21 15:24:22 +10:00
teor 4fde7699ee test/getinfo: Remove unnecessary test code
Fix for 31684.
2019-10-21 14:21:41 +10:00
AmreshVenugopal 6413b2102f control: Add GETINFO support for dumping microdesc consensus
- Allows control port to read microdesc consensus using:
GETINFO dir/status-vote/microdesc/consensus

add: Helper function `getinfo_helper_current_consensus`
test: check if GETINFO commands return expected consensus data.

Resolves 31684.
2019-10-21 13:54:55 +10:00
teor a1f73cb93d Merge branch 'maint-0.4.2' 2019-10-21 09:45:34 +10:00
teor 5c8ecf364a Merge remote-tracking branch 'tor-github/pr/1354' into maint-0.4.2 2019-10-21 09:44:42 +10:00
teor b266a804e9 test/parseconf: Add basic dirauth and bridgeauth tests
Part of 32123.
2019-10-20 20:25:58 +10:00
teor 0501ce9f13 test/parseconf: Expect different outputs when relay mode is disabled
Part of 32123.
2019-10-20 20:25:54 +10:00
teor cf2b00d3f5 test/rebind: Make control formatting and log parsing more robust
* actually sleep when tor has not logged anything
* log at debug level when waiting for tor to log something
* backslash-replace bad UTF-8 characters in logs
* format control messages as ASCII: tor does not accept UTF-8 control commands

Fixes bug 31837; bugfix on 0.3.5.1-alpha.
2019-10-20 20:09:35 +10:00
teor 012c44538c test: Skip test scripts that require the relay module
When tor is built without the relay module.

Part of 32123.
2019-10-20 19:26:59 +10:00
Nick Mathewson 264c5312eb Merge branch 'maint-0.4.2' 2019-10-18 12:32:49 -04:00
Nick Mathewson 0994050c4a Merge remote-tracking branch 'tor-github/pr/1426' into maint-0.4.2 2019-10-18 12:32:29 -04:00
Alexander Færøy 4ed06acb2a Add test to check if the exit callback is called in process_t upon process_exec() failures.
This patch adds a test to check for whether the exit callback is always
called when process_exec() fails, both on Windows and Unix.

See: https://bugs.torproject.org/31810
2019-10-17 20:52:32 +02:00
Nick Mathewson 800b823c29 Merge branch 'cmdline_refactor' 2019-10-17 12:01:45 -04:00
Nick Mathewson 763d955a17 Add a test for a command-line option without a value. 2019-10-17 12:01:40 -04:00
Nick Mathewson eebd2d44a1 Merge remote-tracking branch 'tor-github/pr/1393' into maint-0.4.2 2019-10-14 15:55:13 -04:00
Nick Mathewson ab064cf762 Merge remote-tracking branch 'tor-github/pr/1399' 2019-10-09 16:37:47 -04:00
Neel Chauhan 7c1b2fceb7 test: New behavior on IP retry for HSv3
Unit test for #31652 where if we are over the retry limit for the IP but we
have an established circuit, we don't remove the IP.

Part of #31652
2019-10-08 17:02:47 -04:00
David Goulet f50de3a918 hs-v3: Do not remove intro point if circuit exists
When considering introduction point of a service's descriptor, do not remove
an intro point that has an established or pending circuit.

Fixes #31652

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-08 17:02:47 -04:00
George Kadianakis 081bd37315 Fix flapping of test_service_intro_point() unittest. 2019-10-08 19:00:43 +03:00
Nick Mathewson 7a26f14a37 Merge remote-tracking branch 'tor-github/pr/1317' 2019-10-07 10:23:44 -04:00
Nick Mathewson fdfb4b196b Use {mock,unmock}_hostname_resolver() in relevant tests
These tests all invoke the hostname resolver in one way or another,
and therefore potentially block if our DNS server is missing,
absent, or extremely slow.  Closes ticket 31841.
2019-10-04 08:03:19 -04:00
Nick Mathewson 4a0749596c Add a mock replacement for blocking hostname resolution
Based on examination of our tests, this mock function accepts
"localhost" and "torproject.org", and rejects everything else.
2019-10-04 08:03:19 -04:00
teor e5b8bd38ab Merge remote-tracking branch 'tor-github/pr/1392' 2019-10-04 11:26:43 +10:00
David Goulet 52b7ae71b3 hs: ADD_ONION NEW:BEST now defaults to ED25519-V3
From RSA1024 (v2) to v3 now.

Closes #29669

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-03 15:43:03 -04:00
George Kadianakis 9309eaf8ea Merge branch 'tor-github/pr/1377' 2019-10-03 19:13:57 +03:00
George Kadianakis 3778b97cab Merge branch 'tor-github/pr/1276' 2019-10-03 19:13:02 +03:00
Nick Mathewson 49d6990cae Unit tests for dirserv_reject_tor_version(). 2019-10-03 19:12:52 +03:00
Nick Mathewson b2802ae3c3 util/map_anon_nofork: Add a cast to avoid passing -48 to memset
This fixes coverity CID 1454593, and bug 31948. Bug not in any
released version of Tor.
2019-10-03 07:21:25 -04:00
Nick Mathewson bca30bcb90 Merge remote-tracking branch 'tor-github/pr/1374' 2019-10-02 19:19:11 -04:00
David Goulet ca1f18c159 Merge branch 'tor-github/pr/1385' 2019-10-02 14:15:31 -04:00
Nick Mathewson 34bbdaf5d4 Add a test for max_u16_in_sl().
This test does not currently pass, because of bug 31898.
2019-10-01 13:01:20 -04:00
Nick Mathewson 53116ca0b7 Re-run "make autostyle" with improved annotate_ifdef_directives 2019-09-30 08:57:37 -04:00
teor db329522ef log: When initialising log domain masks, only set known log domains
And add a runtime test that checks for unknown domains and flags.

Fixes bug 31854; bugfix on 0.2.1.1-alpha.
2019-09-30 22:05:00 +10:00
George Kadianakis fc760c5088 Merge branch 'tor-github/pr/1356' 2019-09-30 13:47:06 +03:00
teor 2420c8c936 test: Avoid a map_anon_nofork test failure on SunOS
This test failure happened due to a signed/unsigned integer
comparison.

This bug occurred on SunOS, it may also occur on other systems that
use signed char as the default. (And cast 1-byte integer constants
to an unsigned integer.)

Fixes bug 31897; bugfix on 0.4.1.1-alpha.
2019-09-30 14:54:56 +10:00
Nick Mathewson ffd857bbe1 Merge remote-tracking branch 'tor-github/pr/1308' 2019-09-26 14:36:37 -04:00
Nick Mathewson 40a22fb707 Merge remote-tracking branch 'tor-github/pr/1349' 2019-09-25 13:07:19 -04:00
George Kadianakis 2199629648 Merge branch 'tor-github/pr/1345' 2019-09-25 14:14:30 +03:00
George Kadianakis 99f75373de Merge branch 'tor-github/pr/1309' 2019-09-25 14:12:42 +03:00
teor d30a042fa8 test: Use SEVERITY_MASK_IDX() to find the LOG_* mask indexes
In the unit tests and fuzzers.

Fixes bug 31334; bugfix on 0.2.5.2-alpha.
2019-09-25 16:40:09 +10:00
teor 83fa962c1a test: a file with no config options, at the end of an %include directory
(The file must contain whitespace or comments to trigger the bug.)

Regression test for 31408.
2019-09-24 11:10:50 +10:00
teor 876b3e2775 Merge branch 'bug31408_035' into bug31408_master 2019-09-24 11:07:38 +10:00
AmreshVenugopal 3e45260594 fix: Ticket #31589
- The function `decrypt_desc_layer` has a cleaner interface.
- `is_superencrypted_layer` changed from `int` -> `bool`

[ticket details](https://trac.torproject.org/projects/tor/ticket/31589)

add(changes/*): changes file
fix(src/features/hs): is_superencrypted changed from `int` -> `bool`
fix(changes/ticket31589): header
add(changes/ticket31589): subsystem(onion services) to change
2019-09-23 23:52:01 +05:30
Daniel Pinto 15490816da Fix bug when %including folder with comment only files. #31408
When processing a %included folder, a bug caused the pointer to
the last element of the options list to be set to NULL when
processing a file with only comments or whitepace. This could
cause options from other files on the same folder to be
discarded depending on the lines after the affected %include.
2019-09-23 10:39:08 +10:00
teor 69a1f9c8a7 test: test dirserv_router_has_valid_address() with DirAllowPrivateAddresses
Part of 31793.
2019-09-19 16:19:19 +10:00
teor c2ceede376 test: refactor dirserv_router_has_valid_address() tests
Cleanup after 31793.
2019-09-19 16:19:16 +10:00
teor 46fea1dfee test: dirserv_router_has_valid_address() with zero-family addresses
Sometimes tor doesn't initialise an address, so its family is zero.

Failing test for 31793. Future commits will fix the code.
2019-09-19 16:19:04 +10:00
Nick Mathewson 5f00c03ed0 Merge branch 'maint-0.4.0' into maint-0.4.1 2019-09-17 21:28:38 -04:00