summaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2018-03-26Merge branch 'bug24658-rm-curve25519-header' into bug24658-mergeNick Mathewson
2018-03-23test: more data on geoip load failure.Nick Mathewson
2018-03-23Merge branch 'maint-0.3.3'Nick Mathewson
2018-03-23tests: Automatically detect Rust crates to test and also pass --verbose.Isis Lovecruft
* FIXES #25560: https://bugs.torproject.org/25560.
2018-03-22Merge remote-tracking branch 'public/geoip_testing'Nick Mathewson
2018-03-19Merge remote-tracking branch 'isis/bug23881_r1'Nick Mathewson
2018-03-19Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-03-19Merge branch 'maint-0.3.3'Nick Mathewson
2018-03-19tests: Fix HS test against max IP lifetime.Isis Lovecruft
* FIXES part of #25450: https://bugs.torproject.org/25450
2018-03-19Merge branch 'ticket25268_034_01'Nick Mathewson
2018-03-19Merge branch 'maint-0.3.3'Nick Mathewson
2018-03-19tests: Fix crash on win32 due to uninitialised mutex in bench.c.Gisle Vanem
Signed-off-by: Isis Lovecruft <isis@torproject.org>
2018-03-19Merge branch 'maint-0.3.3'Nick Mathewson
2018-03-19Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-03-15Add a test for geoip_load_file().Nick Mathewson
2018-03-15Split geoip tests into a separate module.Nick Mathewson
2018-03-08test: Increase time limit for IP creation in an HS test.Isis Lovecruft
This should avoid most intermittent test failures on developer and CI machines, but there could (and probably should) be a more elegant solution. Also, this test was testing that the IP was created and its expiration time was set to a time greater than or equal to `now+INTRO_POINT_LIFETIME_MIN_SECONDS+5`: /* Time to expire MUST also be in that range. We add 5 seconds because * there could be a gap between setting now and the time taken in * service_intro_point_new. On ARM, it can be surprisingly slow... */ tt_u64_op(ip->time_to_expire, OP_GE, now + INTRO_POINT_LIFETIME_MIN_SECONDS + 5); However, this appears to be a typo, since, according to the comment above it, adding five seconds was done because the IP creation can be slow on some systems. But the five seconds is added to the *minimum* time we're comparing against, and so it actually functions to make this test *more* likely to fail on slower systems. (It should either subtract five seconds, or instead add it to time_to_expire.) * FIXES #25450: https://bugs.torproject.org/25450
2018-03-03Merge branch 'maint-0.3.3'Nick Mathewson
2018-03-03Merge branch 'ticket23814' into maint-0.3.3Nick Mathewson
2018-03-01Merge branch 'maint-0.3.3'Nick Mathewson
2018-03-01Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-03-01Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2018-03-01Merge branch 'maint-0.2.9' into maint-0.3.1Nick Mathewson
2018-03-01Protover tests: disable some obsoleted testsNick Mathewson
These were meant to demonstrate old behavior, or old rust behavior. One of them _should_ work in Rust, but won't because of implementation details. We'll fix that up later.
2018-03-01Forbid UINT32_MAX as a protocol versionNick Mathewson
The C code and the rust code had different separate integer overflow bugs here. That suggests that we're better off just forbidding this pathological case. Also, add tests for expected behavior on receiving a bad protocol list in a consensus. Fixes another part of 25249.
2018-03-01Forbid "-0" as a protocol version.Nick Mathewson
Fixes part of 24249; bugfix on 0.2.9.4-alpha.
2018-03-01Add more of Teor's protover tests.Nick Mathewson
These are as Teor wrote them; I've disabled the ones that don't pass yet, with XXXX comments.
2018-03-01Add some protover vote round-trip tests from Teor.Nick Mathewson
I've refactored these to be a separate function, to avoid tricky merge conflicts. Some of these are disabled with "XXXX" comments; they should get fixed moving forward.
2018-02-21Revert 4438ef32's changes to test_address.cNick Mathewson
Apparently some versions of the mac sdk care about the ordering of net/if.h wrt other headers. Fixes bug 25319; bug not in any released tor.
2018-02-20crypto: Remove unnecessary curve25519 header from crypto_digest.h.Isis Lovecruft
* ADD includes for "torint.h" and "container.h" to crypto_digest.h. * ADD includes for "crypto_digest.h" to a couple places in which crypto_digest_t was then missing. * FIXES part of #24658: https://bugs.torproject.org/24658#comment:30
2018-02-20Remove a bunch of other redundant #includesNick Mathewson
Folks have found two in the past week or so; we may as well fix the others. Found with: \#!/usr/bin/python3 import re def findMulti(fname): includes = set() with open(fname) as f: for line in f: m = re.match(r'^\s*#\s*include\s+["<](\S+)[>"]', line) if m: inc = m.group(1) if inc in includes: print("{}: {}".format(fname, inc)) includes.add(m.group(1)) import sys for fname in sys.argv[1:]: findMulti(fname)
2018-02-16Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2018-02-16Merge branch 'maint-0.2.9' into maint-0.3.1Nick Mathewson
2018-02-15Merge branch 'maint-0.3.3'Nick Mathewson
2018-02-15Merge remote-tracking branch 'isis/bug25171' into maint-0.3.3Nick Mathewson
2018-02-15Merge branch '25162_zstd_static'Nick Mathewson
2018-02-16tests: Remove duplicate included header file in src/test/test.c.Isis Lovecruft
* FIXES #25271: https://bugs.torproject.org/25271
2018-02-15cmux: Always use the cmux policyDavid Goulet
Remove the checks on cmux->policy since it should always be set. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-15cmux: Remove round-robin circuit policyDavid Goulet
Since 0.2.4, tor uses EWMA circuit policy to prioritize. The previous algorithm, round-robin, hasn't been used since then but was still used as a fallback. Now that EWMA is mandatory, remove that code entirely and enforce a cmux policy to be set. This is part of a circuitmux cleanup to improve performance and reduce complexity in the code. We'll be able to address future optimization with this work. Closes #25268 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-15cmux: Make EWMA policy mandatoryDavid Goulet
To achieve this, a default value for the CircuitPriorityHalflife option was needed. We still look in the options and then the consensus but in case no value can be found, the default CircuitPriorityHalflifeMsec=30000 is used. It it the value we've been using since 0.2.4.4-alpha. This means that EWMA, our only policy, can not be disabled anymore fallbacking to the round robin algorithm. Unneeded code to control that is removed in this commit. Part of #25268 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-13Merge branch 'tests_rust'Nick Mathewson
2018-02-09Merge remote-tracking branch 'dgoulet/ticket24902_029_05'Nick Mathewson
2018-02-09test: DoS test to make sure we exclude known relaysDavid Goulet
Part of #25193 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-08Add a "make test-rust" target to run the rust tests only.Nick Mathewson
2018-02-08Merge branch 'ticket25183_029_01' into ticket24902_029_05David Goulet
2018-02-08test: Add unit tests for addressset.cDavid Goulet
This also adds one that tests the integration with the nodelist. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-07Merge remote-tracking branch 'dgoulet/bug25113_029_01'Nick Mathewson
2018-02-07test: Bump to 10 msec gap in the monotonic testDavid Goulet
On slow system, 1 msec between one read and the other was too tight. For instance, it failed on armel with a 4msec gap: https://buildd.debian.org/status/package.php?p=tor&suite=experimental Increase to 10 msec for now to address slow system. It is important that we keep this OP_LE test in so we make sure the msec/usec/nsec read aren't desynchronized by huge gaps. We'll adjust again if we ever encounter a system that goes slower than 10 msec between calls. Fixes #25113 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-07Fix spelling mistakes corresponding to ticket #23650Deepesh Pathak
2018-02-06Make zstd unit tests try running with static-only fns disabledNick Mathewson
Since we're making it so that unstable zstd apis can be disabled, we need to test them. I do this by adding a variant setup/cleanup function for the tests, and teaching it about a fake compression method called "x-zstd:nostatic".