summaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2019-08-28test_confparse: verify that clearing a routerset sets it to NULL.Nick Mathewson
2019-08-27Merge branch 'tor-github/pr/1267'George Kadianakis
2019-08-27Merge branch 'tor-github/pr/1258'George Kadianakis
2019-08-27Merge branch 'tor-github/pr/1234'George Kadianakis
2019-08-26test_address: parenthesize macro arguments.Nick Mathewson
It's good style to always add parentheses when using macro arguments, in case somebody someday provides an argument that contains an operator you don't expect, or causes the expression to parse differently.
2019-08-26In tests, make sure that "ri" is freed on all paths.Nick Mathewson
In Tor's tests, the tt_*() macros can call "goto done" on failure. When that happens, we need to make sure that all of our allocated memory still gets freed, or else Coverity will complain.
2019-08-26Add test for dirserv_router_has_valid_address()Neel Chauhan
2019-08-26Merge branch 'tor-github/pr/1239'David Goulet
2019-08-23Remove the unused circuit_type field from hs_ident_circuit_t and ↵Neel Chauhan
hs_ident_circuit_new()
2019-08-22Merge branch 'ticket30935' into ticket30935_mergedNick Mathewson
2019-08-23test/nodelist: Add unit tests for describe.cteor
Part of 21003.
2019-08-20Merge branch 'ticket30914' into ticket30914_mergedNick Mathewson
2019-08-19Fix a memory-leak warning in test_circuitbuid.cNick Mathewson
Coverity wants us to free everything that we are potentially allocating, even stuff where allocating it would be a bug. Adding a smartlist_free() here will fix the warning. Fixes bug 31452; bugfix on 16a0b7ed6779bf72a8a471c, which is not in any released Tor. This is CID 1447292.
2019-08-19Merge remote-tracking branch 'tor-github/pr/1235'Nick Mathewson
2019-08-19Merge branch 'tor-github/pr/1122'George Kadianakis
2019-08-19Merge branch 'tor-github/pr/1214'George Kadianakis
2019-08-19Merge branch 'tor-github/pr/1154'George Kadianakis
2019-08-19Merge remote-tracking branch 'mike/bug31356+logs-rebased2' into bug31356_finalGeorge Kadianakis
2019-08-19Merge branch 'tor-github/pr/1213'David Goulet
2019-08-19test/nodelist: Fix a typoteor
2019-08-12Bug 31356: Propogate protover padding support to circpadMike Perry
2019-08-07Merge remote-tracking branch 'tor-github/pr/1208'Nick Mathewson
2019-08-06test_token_bucket: negate after casting to signed type.Nick Mathewson
Previously we tried multiplying by -1 before casting to int32_t, which would cause us to cast the -1 to an unsigned before we multiplied. This gave us compiler warnings on windows. Fixes bug 31353; bug not in any released Tor.
2019-08-06test_util: Do not check for ENETUNREACH unless it exists.Nick Mathewson
Fixes bug 31352; bug not in any released Tor.
2019-08-06test: Series of fixes for hs_dos.c unit testsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-06hs-v3: Add consensus parameters for DoS defensesDavid Goulet
Part of #15516 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-06test: Add hs_dos.c unit testsDavid Goulet
Currently test the only available function which is hs_dos_can_send_intro2() within the HS anti-DoS subsystem. Closes #15516 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-06hs: Limit the amount of relayed INTRODUCE2David Goulet
This commit add the hs_dos.{c|h} file that has the purpose of having the anti-DoS code for onion services. At this commit, it only has one which is a function that decides if an INTRODUCE2 can be sent on the given introduction service circuit (S<->IP) using a simple token bucket. The rate per second is 25 and allowed burst to 200. Basic defenses on #15516. Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-06Merge branch 'tor-github/pr/1195'George Kadianakis
2019-08-05Rename handle_relay_command to handle_relay_cell_command .George Kadianakis
As per David's review.
2019-08-05Test that regular cells get ignored in padding circuits.George Kadianakis
2019-08-01practracker: Add unit tests to test script, and test script to makefileNick Mathewson
This makes all of the practracker tests get run by make check, and hence by our CI. Closes ticket 31304.
2019-07-25Merge branch 'maint-0.4.1'Nick Mathewson
2019-07-25Fix more 32-bit errors with domain and tt_int_opNick Mathewson
2019-07-25Merge branch 'maint-0.4.1'Nick Mathewson
2019-07-25test: Use a 64-bit comparison for logging domains.Nick Mathewson
2019-07-25Merge branch 'maint-0.4.1'David Goulet
2019-07-24Make config_var and config_fmt const.Nick Mathewson
Now that we have a reasonable implementation for overriding the default options for TestingTorNetwork, we don't need to modify config_var_t structs any more. And therefore, we can have constant format options, like reasonable people.
2019-07-24Fix clang-detected errors related to log_domain_mask_tNick Mathewson
2019-07-23Merge branch 'ticket24963_042_02'Nick Mathewson
2019-07-23Add a test for disallowing single-hop introductions.Nick Mathewson
Code from dgoulet.
2019-07-23Merge branch 'tor-github/pr/1116'David Goulet
2019-07-08Adjust log callback type to use log_domain_mask_tNick Mathewson
2019-07-03hs-v3: Disallow single hop client to post/get a descriptorDavid Goulet
Closes #24964 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-07-02Merge remote-tracking branch 'tor-github/pr/1120'Nick Mathewson
2019-06-28Coverity: fix memory leak on error in test function.Nick Mathewson
The function make_intro_from_plaintext() in test_introduce.c would leak memory if we ever hit a failure from our underlying crypto functions. This kind of failure should be impossible, but it's best to be safe here. Bugfix on 0.2.4.1-alpha.
2019-06-28Coverity: fix test issues with always-present 'service' var.Nick Mathewson
Coverity is worried that we check "service" at the end of these test functions, since it doesn't see any way to reach the cleanup code without having first dereferenced the variable. Removing the check would be unwise in this case: instead we add a tt_assert check before using "service" so that coverity thinks that the check is doing something useful. Bugfix on 0.3.2.1-alpha.
2019-06-28Fix a few coverity unitinitialzed-value warnings in the unit tests.Nick Mathewson
Coverity can't see that it is not in fact going to read uninitialized memory here, so we initialize these values unconditionally. Bugfix on 0.4.0.1-alpha.
2019-06-26Merge branch 'bug30721_squashed'Nick Mathewson
2019-06-26test/addr: test that tor_addr_port_lookup() handles IP addresses and portsteor
And that it does something sensible with host and host:port. Also reorder the tests into valid, invalid, and ambiguous. And add some missing cases. Note: tor_addr_port_lookup() handles ip, ip:port, host, and host:port. Tests for 30721.