summaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2020-11-12Fix typos.Samanta Navarro
Typos found with codespell. Please keep in mind that this should have impact on actual code and must be carefully evaluated: src/core/or/lttng_circuit.inc - ctf_enum_value("CONTROLER", CIRCUIT_PURPOSE_CONTROLLER) + ctf_enum_value("CONTROLLER", CIRCUIT_PURPOSE_CONTROLLER)
2020-11-12Fake the current time when we're loading TEST_DESCRIPTORS.Nick Mathewson
Fixes bug 40187; bugfix on 0.4.5.1-alpha.
2020-11-03Merge remote-tracking branch 'tor-gitlab/mr/185' into masterGeorge Kadianakis
2020-11-02Merge branch 'tor-gitlab/mr/186'David Goulet
2020-10-30Merge remote-tracking branch 'tor-gitlab/mr/174' into masterGeorge Kadianakis
2020-10-28Merge remote-tracking branch 'tor-gitlab/mr/171'Alexander Færøy
2020-10-28Fix a previously overstrict log message check.Nick Mathewson
OpenSSL doesn't seem to report error locations in the same way as before, which broke one of our tests. Fixes bug 40170; bugfix on 0.2.8.1-alpha.
2020-10-28Revise fix for bug 32178 (spaces at end of log msg).Nick Mathewson
The loop in the earlier patch would invoke undefined behavior in two ways: First, it would check whether it was looking at a space before it checked whether the pointer was in-range. Second, it would let a pointer reach a position _before_ the start of a string, which is not allowed. I've removed the assertion about empty messages: empty messages can be their own warning IMO. I've also added tests for this formatting code, to make sure it actually works.
2020-10-28test: Missing tor_free() in metrics unit testsDavid Goulet
Found by coverity: *** CID 1468664: Resource leaks (RESOURCE_LEAK) /src/test/test_metrics.c: 83 in test_config() 77 tt_int_op(ret, OP_EQ, false); 78 79 done: 80 SMARTLIST_FOREACH(ports, port_cfg_t *, c, port_cfg_free(c)); 81 smartlist_free(ports); 82 or_options_free(options); >>> CID 1468664: Resource leaks (RESOURCE_LEAK) >>> Variable "err_msg" going out of scope leaks the storage it points to. 83 } 84 85 static char _c_buf[256]; 86 #define CONTAINS(conn, msg) \ 87 do { \ 88 tt_int_op(buf_datalen(conn->outbuf), OP_EQ, (strlen(msg))); \ Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-10-27lib/metrics: Fix wrong macro expansionDavid Goulet
The "METRICS_PREFIX" was not expanded but rather used as a litteral. Fix that by just removing the define and using "tor_" directly. Reviewed-by: Alexander Færøy <ahf@torproject.org> Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-10-27test: Add test for onion service metrics moduleDavid Goulet
Related to #40063 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-10-27test: Metrics tests for lib/ and feature/David Goulet
Related to #40063 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-10-27tests: Fix unit tests after adding new HS metrics moduleDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-10-27Merge branch 'tor-gitlab/mr/173'David Goulet
2020-10-23Merge remote-tracking branch 'tor-gitlab/mr/127'Nick Mathewson
2020-10-23Merge branch 'combined_libs'Nick Mathewson
2020-10-21Allow mutiple lines on configuration for ROUTERSET entries. #28361Daniel Pinto
Affected entries are: EntryNodes, ExcludeNodes, ExcludeExitNodes, ExitNodes, MiddleNodes, HSLayer2Nodes and HSLayer3Nodes.
2020-10-20Merge remote-tracking branch 'tor-gitlab/mr/148' into masterGeorge Kadianakis
2020-10-16Regenerate extample_extrainfo.inc and adjust tests.Nick Mathewson
2020-10-16Regenerate complete failing_routerdescs.inc and adjust tests accordingly.Nick Mathewson
2020-10-16Update makedesc.py script so that it works with python3.Nick Mathewson
2020-10-16Update slow_ed25519.py to work with python 3.Nick Mathewson
2020-10-16Fix formats_rsa_ed25519 tests.Nick Mathewson
The "protos" field is mandatory, and so are Ed25519 signatures. Also, remove formats_rsa (the version without Ed25519), since RSA-only relays are no longer supported.
2020-10-16Add pr= lines to test_dir_clip_unmeasured*.Nick Mathewson
2020-10-16Fix a couple of routerstatus-based tests.Nick Mathewson
2020-10-16Replace the contents of test_descriptors.inc with a new set.Nick Mathewson
Had to replace these since we're updating the list of required fields. These are taken from a chutney instance. Shockingly, this is enough to make the test_dir_handle_get.c tests pass again.
2020-10-16test_dir_handle_get: add ntor-onion-key to microdescriptor exampleNick Mathewson
Shockingly, this test didn't break after this change!
2020-10-16Fix up vote tests in test_dir_handle_get.Nick Mathewson
These tests used a hardcoded vote with a hardcoded digest. That vote didn't have any pr lines, and so it is now invalid. I've adjusted the testing code so that it mocks the signature-checking, so that we can more easily change the contents of the vote.
2020-10-16Fix the tests in test_microdesc.cNick Mathewson
This was fairly simple: just had to replace the examples with ones that had ntor keys. There were a couple of example chutney routerinfos that I had to replace too. I also removed tests for producing microdescs via consensus methods that we don't support any longer.
2020-10-16Fix router/dump_router_to_string_no_bridge_distribution_methodNick Mathewson
The descriptor it generated needed to include ed25519 keys; needed to have a correct TAP crosscert.
2020-10-16test_dir_common: make sure we include pr lines. Fixes 7 tests.Nick Mathewson
2020-10-15Also, include ed25519 identities in connection_describe().Nick Mathewson
Related to #22668.
2020-10-15Add ed25519 identities to relay descriptions.Nick Mathewson
(Or at least, to all those relay descriptions that derive from format_node_description()). Closes #22668.
2020-10-14Protover: simplify implementation structure to use 64-bit propertyNick Mathewson
Now that prop318 is in, we can simplify our representation for protocol range sets to just be a bitmask.
2020-10-14Merge branch 'prop318_limit_protover_035' into prop318_limit_protover_045Nick Mathewson
2020-10-14Implement proposal 318: Limit protovers to 0..63Nick Mathewson
In brief: we go through a lot of gymnastics to handle huge protover numbers, but after years of development we're not even close to 10 for any of our current versions. We also have a convenient workaround available in case we ever run out of protocols: if (for example) we someday need Link=64, we can just add Link2=0 or something. This patch is a minimal patch to change tor's behavior; it doesn't take advantage of the new restrictions. Implements #40133 and proposal 318.
2020-10-14Merge branch 'tor-gitlab/mr/170'David Goulet
2020-10-13Make OptimisticData always-on.Nick Mathewson
We've been using it for years, and it seems to work just fine. This patch removes the option and its network parameter. Part of #40139
2020-10-13Merge remote-tracking branch 'tor-gitlab/mr/161'Alexander Færøy
2020-10-07Remove long-obsolete members from the state file.Nick Mathewson
Tor has a feature to preserve unrecognized state file entries in order to maintain forward compatibility. But this feature, along with some unused code that we never actually removed, led to us keeping items that were of no use to the user, other than at worst to preserve ancient information about them. This commit adds a feature to remove obsolete entries when we load the file. Closes ticket 40137.
2020-10-07Merge remote-tracking branch 'tor-github/pr/1827/head' into maint-0.3.5Nick Mathewson
2020-10-07Merge remote-tracking branch 'tor-gitlab/mr/103' into maint-0.3.5Nick Mathewson
2020-10-07Merge branch 'mr_124_squashed' into maint-0.3.5Nick Mathewson
2020-10-07Parallelize src/test/test into chunks.Nick Mathewson
First, we introduce a flag to teach src/test/test to split its work into chunks. Then we replace our invocation of src/test/test in our "make check" target with a set of 8 scripts that invoke the first 8th of the tests, the second 8th, and so on. This change makes our "make -kj4 check" target in our hardened gitlab build more than twice as fast, since src/test/test was taking the longest to finish. Closes 40098.
2020-10-07Merge branch 'maint-0.4.4' into masterGeorge Kadianakis
2020-10-07Merge remote-tracking branch 'tor-gitlab/mr/163' into maint-0.4.4George Kadianakis
2020-09-28Merge branch 'bug40133_035' into bug40133_043Nick Mathewson
2020-09-28Merge branch 'maint-0.3.5' into bug40133_035Nick Mathewson
2020-09-23Remove parseconf test with AndroidIdentityTag.Nick Mathewson
2020-09-23Style and correctness issues in test_dirvote.Nick Mathewson
Style: - We end our types with _t. - Use 'static' to declare functions that only exist in a single module. Correctness: - Many tt_...() macros can invoke "goto done;" -- we need to make sure that all the variables that could get freed are initialized before any "goto done" is hit, or else we might free an uninitialized variable.