aboutsummaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2018-04-02tests: Run all existing protover tests in both languages.Isis Lovecruft
There's now no difference in these tests w.r.t. the C or Rust: both fail miserably (well, Rust fails with nice descriptive errors, and C gives you a traceback, because, well, C).
2018-04-02tests: Make inline comments in test_protover.c more accurate.Isis Lovecruft
The DoS potential is slightly higher in C now due to some differences to the Rust code, see the C_RUST_DIFFERS tags in src/rust/protover/tests/protover.rs. Also, the comment about "failing at the splitting stage" in Rust wasn't true, since when we split, we ignore empty chunks (e.g. "1--1" parses into "(1,None),(None,1)" and "None" can't be parsed into an integer). Finally, the comment about "Rust seems to experience an internal error" is only true in debug mode, where u32s are bounds-checked at runtime. In release mode, code expressing the equivalent of this test will error with `Err(ProtoverError::Unparseable)` because 4294967295 is too large.
2018-04-02protover: Change protover_all_supported() to return only unsupported.Isis Lovecruft
Previously, if "Link=1-5" was supported, and you asked protover_all_supported() (or protover::all_supported() in Rust) if it supported "Link=3-999", the C version would return "Link=3-999" and the Rust would return "Link=6-999". These both behave the same now, i.e. both return "Link=6-999".
2018-04-01misc tiny fixesRoger Dingledine
2018-03-28Merge branch 'maint-0.3.3'Nick Mathewson
2018-03-28Merge remote-tracking branch 'dgoulet/bug24767_033_03' into maint-0.3.3Nick Mathewson
2018-03-28Merge branch 'maint-0.3.3'Nick Mathewson
2018-03-28Rename string_is_valid_hostname -> string_is_valid_nonrfc_hostnameNick Mathewson
Per discussion on 25055.
2018-03-28Don't explode on NULL or empty stringrl1987
2018-03-28Allow alphanumeric TLDs in test for nowrl1987
2018-03-28Validate hostnames with punycode TLDs correctlyrl1987
2018-03-28Test TLD validationrl1987
2018-03-28Also test bracket-less IPv6 string validationrl1987
2018-03-28Fix bracketed IPv6 string validationrl1987
2018-03-28Do not consider IP strings valid DNS names. Fixes #25055rl1987
2018-03-28Allow IPv6 address strings to be used as hostnames in SOCKS5 requestsrl1987
2018-03-27test: Add unittest for the OR connection failure cacheGeorge Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-03-27Merge branch 'maint-0.3.3'Nick Mathewson
2018-03-26Merge branch 'bug24658-rm-curve25519-header' into bug24658-mergeNick Mathewson
2018-03-26Fix a unit test which was broken by the previous commitNick Mathewson
This test was expecting Tor to find and use routerinfos, but hadn't cleared the UseMicrodescriptors flag. Part of the fix for 25213.
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)