Commit Graph

22797 Commits

Author SHA1 Message Date
Nick Mathewson 075c52084d Fix unit test failure introduced by #20002
Updating the consensus algorithm made a non-valid node never get
listed, which messed up some other tests.
2016-09-07 13:40:38 -04:00
Nick Mathewson a49fee1c29 Capture and enforce bug warnings in util/time test 2016-09-07 12:15:46 -04:00
Nick Mathewson e9b1d0619f Merge remote-tracking branch 'dgoulet/ticket18693_029_01' 2016-09-07 11:46:00 -04:00
Nick Mathewson 2a3b651790 Merge remote-tracking branch 'sebastian/bug20064' 2016-09-07 11:38:43 -04:00
Nick Mathewson 3823d0aa7d Capture and detect the BUG() warnings in test_util_parse_integer. 2016-09-06 21:01:52 -04:00
Nick Mathewson d09723ad19 Add facility to suppress/capture tor_bug_occurred_() messages in unit tests. 2016-09-06 21:01:17 -04:00
Nick Mathewson 2b39c927c7 Add !(...) to BUG() log messages
They use the same code as reporting assertion failures, so we should
invert the sense of what we're "asserting".

Fixes bug 20093.
2016-09-06 21:00:51 -04:00
Nick Mathewson 2a4a815f58 Fix a unit test bug for passing arguments to tor_parse_ulong.
We wanted to make sure -50 was a bad input, but instead we were
passing a 'min' that was greater than 'max'.
2016-09-06 20:29:55 -04:00
Nick Mathewson 7ba47ca1fd Split tor_parse_{some_int} testing into separate fn. Code movement only. 2016-09-06 20:25:54 -04:00
Nick Mathewson af58a89b86 Merge remote-tracking branch 'teor/bug20012' 2016-09-06 19:14:02 -04:00
Nick Mathewson 43092e21c1 Merge remote-tracking branch 'teor/feature20069' 2016-09-06 19:06:32 -04:00
Nick Mathewson 128f7ffbc0 Merge remote-tracking branch 'public/ticket20002' 2016-09-06 14:27:13 -04:00
Sebastian Hahn f4ed254652 Document Exit flag assignment when private nets are allowed 2016-09-06 18:38:36 +02:00
Nick Mathewson 5927ed8d33 checkSpace.pl now forbids more identifiers.
The functions it warns about are:
  assert, memcmp, strcat, strcpy, sprintf, malloc, free, realloc,
  strdup, strndup, calloc.

Also, fix a few lingering instances of these in the code. Use other
conventions to indicate _intended_ use of assert and
malloc/realloc/etc.
2016-09-06 12:35:37 -04:00
Nick Mathewson 4e3f9c1f3a Merge remote-tracking branch 'pastly/ticket19122' 2016-09-06 11:56:46 -04:00
Matt Traudt e90bd48c2f Change UID to Username in man page 2016-09-06 11:37:59 -04:00
Nick Mathewson 440228907d Merge remote-tracking branch 'sebastian/bug20065' 2016-09-06 10:12:42 -04:00
teor 55a2bfb056 Fix an indentation issue in rend_config_services 2016-09-06 17:49:52 +10:00
teor b3dfd9defb Fix a space error in the man page 2016-09-06 17:49:48 +10:00
teor (Tim Wilson-Brown) 41ad244dd6 Fix a comment typo in smartlist_get_most_frequent_() 2016-09-06 17:49:44 +10:00
teor 26b47f80dd Add hs-ipv6 to the chutney IPv6 tests
Requires a recent version of chutney.

Also remove bridges+hs, as it's somewhat redundant.
2016-09-06 13:45:09 +10:00
Sebastian Hahn 74d710e7dc Give useful error if authority_signing_key doesn't exist 2016-09-06 00:14:20 +02:00
Sebastian Hahn 0d485fcfef Vote Exit correctly with DirAllowPrivateAddresses set
When allowing private addresses, mark Exits that only exit to private
locations as such. Fixes bug 20064; bugfix on 0.2.2.9-alpha.
2016-09-05 23:39:47 +02:00
Andrea Shepard 341a159ab4 Appease make check-spaces 2016-09-05 17:47:39 +00:00
Nick Mathewson 6abce601f2 Fix BUG warning with stack trace from config/parse_port_config__listenaddress 2016-09-05 13:30:50 -04:00
Georg Koppen d0cdc8d783 Bug 20038: Fix typo in ControlPort description 2016-09-05 09:55:58 -04:00
Nick Mathewson 6c1d1127a8 Fix memory leaks in the shared random tests.
Please remember to test your code with
--enable-expensive-hardening. :)
2016-09-01 09:10:27 -04:00
Nick Mathewson 7ef4eef764 Actually, always monotime_init() in the unit tests. 2016-08-31 14:38:17 -04:00
Nick Mathewson cfc62e2374 Initialize monotonic timer code before using it in the tests 2016-08-31 14:34:49 -04:00
Nick Mathewson 251b348d7b It is not a bug to attempt to base32_decode a non-base32 string
(Rationale: it isn't a bug to try this for a base16 or base64
string. It's just a bad input that we're detecting.)
2016-08-31 14:31:00 -04:00
Nick Mathewson d4f05dcd0e Detect and suppress bug message from zlib compression bomb test 2016-08-31 14:30:34 -04:00
Nick Mathewson d299c043d4 Require specific messages for remaining link-handshake failure cases 2016-08-31 14:10:15 -04:00
Nick Mathewson 240c58017d Merge branch 'log_test_improvements' 2016-08-31 14:09:21 -04:00
Nick Mathewson 05c2db3f0b Changes file for log test improvements 2016-08-31 13:35:46 -04:00
Nick Mathewson 273290d4fe Always log [bug] warnings from the unit tests.
We should consider them bugs.  If they are happening intentionally,
we should use the log_test_helpers code to capture and suppress
them.  But having them off-by-default has potential to cause
programming errors.
2016-08-31 13:22:07 -04:00
Nick Mathewson 69dce09031 Do not call tor_tls_server_info_callback(NULL) from tests.
This isn't valid behavior, and it causes a crash when you run
the unit tests at --debug.

I've added an IF_BUG_ONCE() check for this case.
2016-08-31 13:18:13 -04:00
Nick Mathewson 871b711f10 Work even harder not to suppress logging messages unless we mean to. 2016-08-31 13:12:36 -04:00
Nick Mathewson 2df6cdc9f9 Document and clean log_test_helpers.c a bit
In addition to documentation, this commit makes a function static,
and removes a weird single-point-of-return-ism, and notes a thing I
should fix.
2016-08-31 13:11:26 -04:00
Nick Mathewson d5614b2102 Use setup_full_capture_of_logs() where appropriate. 2016-08-31 12:53:18 -04:00
Nick Mathewson f74916a98f setup_capture_of_logs: no longer suppress log messages
Previously setup_capture_of_logs would prevent log messages from
going to the console entirely.  That's a problem, since sometimes
log messages are bugs!  Now setup_capture_of_logs() acts sensibly.

If you really do need to keep a message from going to the console
entirely, there is setup_full_capture_of_logs().  But only use that
if you're prepared to make sure that there are no extraneous
messages generated at all.
2016-08-31 12:51:22 -04:00
Nick Mathewson 1f7dc823c5 Improvements to test_link_handshake: check specific error messages
Otherwise it's too easy to lose our test coverage.
2016-08-31 12:11:01 -04:00
Nick Mathewson 26a63a9303 Fix all "BUG" warnings created from link-handshake tests. 2016-08-31 11:37:18 -04:00
Nick Mathewson 14c07f3f21 Another log testing helper helper, for matching partial strings. 2016-08-31 11:35:12 -04:00
Nick Mathewson debe846cb8 Merge remote-tracking branch 'teor/bug19905' 2016-08-31 10:58:41 -04:00
Nick Mathewson bbac9e1d0c Don't warn on unlink(bw_accounting) when errno == ENOENT
Patch from pastly; fixes bug 19964.
2016-08-31 10:57:09 -04:00
Nick Mathewson c15b99e6e9 Fix a deref-before-null-check complaint
Found by coverity scan; this is CID 1372329.

Also, reindent some oddly indented code.
2016-08-31 10:32:10 -04:00
teor b822c5891a Fix the test network IPv6 check so it works on Linux 2016-08-31 15:22:34 +10:00
teor 0a3009bb85 Stop inadvertently upgrading client intro connections to ntor
Also stop logging the intro point details on error by default.

Fixes #20012, introduced with ntor in tor 0.2.4.8-alpha.
2016-08-31 15:10:58 +10:00
Nick Mathewson e3bf8854c8 We no longer need to tag UseNTorHandshake as deprecated, since it is obsolete 2016-08-29 15:03:55 -04:00
Nick Mathewson bbaa7d09a0 Merge remote-tracking branch 'teor/reject-tap-v6' 2016-08-29 15:02:11 -04:00