aboutsummaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2019-10-22With coccinelle, avoid includes in the middle of an expression.Nick Mathewson
2019-09-11Run test_operator_cleanup on our unit testsNick Mathewson
Coccinelle doesn't understand it when we use "==" and "!=" and so on as arguments to macros. To solve this, we prefer OP_EQ, OP_NE, and so on. This commit is automatically generated by running ./scripts/coccinelle/test_operator_cleanup over all of the source code in src.
2019-09-11Merge branch 'tor-github/pr/1296'David Goulet
2019-09-11Add test_cmdline.sh to distribution.Nick Mathewson
2019-09-11integration test for --list-torrc-optionsNick Mathewson
(This option tests our existing behavior, not necessarily the most sensible behavior.)
2019-09-11Test: Make sure NOLIST options are not listed.Nick Mathewson
2019-09-09Merge branch 'ticket30924_042_04_squashed' into ↵Nick Mathewson
ticket30924_042_04_squashed_merged
2019-09-09hs-v3: Rename validation function in hs_intropoint.cDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-09-09hs-v3: Move DoS parameter check against 0David Goulet
Move it outside of the validation function since 0 is a valid value but disables defenses. Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-09-05Merge branch 'tor-github/pr/1261'George Kadianakis
2019-09-05Add tests for IPv6 exit policies on microdescriptorsNeel Chauhan
2019-09-04Update routerset reset test to use new mgr API.Nick Mathewson
2019-09-04Merge branch 'ticket31240v2_merged_2' into ticket31240v2_merged_2_mergedNick Mathewson
2019-08-28test_confparse: verify that clearing a routerset sets it to NULL.Nick Mathewson
2019-08-28Merge branch 'ticket31240v2' into ticket31240v2_merged_2Nick Mathewson
2019-08-28Add a test for clear_fn support in handling non-managed fieldsNick Mathewson
2019-08-28Add a test for dumping a compound configurationNick Mathewson
2019-08-28Simple tests for nested configuration formatsNick Mathewson
One test makes sure that the toplevel magic numbers are distinct. One test makes sure that we can parse a configuration object with two sub-objects.
2019-08-28Confmgr tests: test deprecations and abbreviations.Nick Mathewson
2019-08-28Start on test cases for the multi-object feature of confmgr.Nick Mathewson
This test case, at this point, only constructs the confmgr object. More code to come.
2019-08-28Tests for config_find_option_name()Nick Mathewson
Fix a bug in config_find_option_name() where it did not consider the abbreviations table.
2019-08-28Add tests for variable-listing functions.Nick Mathewson
This discovered a bug related to an extra & in config_mgr_list_deprecated_vars(): fix that.
2019-08-28Make a config_suite_t type to hold multiple config sub-objectsNick Mathewson
Right now, it doesn't do anything; this patch is meant to make sure that we're doing memory management correctly.
2019-08-28Refactor config free logic to use a single path.Nick Mathewson
The right way to free a config object is now to wrap config_free(), always. Instead of creating an alternative free function, objects should provide an alternative clear callback to free any fields that the configuration manager doesn't manage. This lets us simplify our code a little, and lets us extend the confparse.c code to manage additional fields in config_free.
2019-08-28Use special magic to enforce manager/object connection.Nick Mathewson
Every time we finalize a config manager, we now generate a new magic number for it, so that we'll get an assertion failure if we ever try to use an object with a different configuration manager than the one that generated it.
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-26test: Unit tests HS DoS torrc optionsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-26hs-v3: Refactor DoS cell extension parameters validationDavid Goulet
Move everything to its own function in order to better log, document and tests the introduction point validation process. Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-26hs-v3: Privatize access to HS DoS consensus paramDavid Goulet
Remove the public functions returning the HS DoS consensus param or default values as it is exclusively used internally now. Rename the param_* variables to consensus_param_* for better code semantic. Finally, make some private functions available to unit tests. Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-26test: Adapt HS DoS test to use latest parameterDavid Goulet
We added a flag on the circuit to know if the DoS defenses are enabled or not. Before, it was solely the consensus parameter. Part of #30924 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-26test: Handling of ESTABLISH_INTRO DoS extensionDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-26test: Build DoS cell extensionDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-26hs-v3: Encode DoS ESTABLISH_INTRO cell extensionDavid Goulet
This commit makes tor add the DoS cell extension to the ESTABLISH_INTRO cell if the defense is enabled on the service side with a torrc option. Furthermore, the cell extension is only added if the introduction point supports it. The protover version HSIntro=5 is looked for. Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-26hs-v3: Rename INTRO2 consensus param gettersDavid Goulet
Make it clear that these functions return the consensus param only. Introduction point can not set those values with a torrc option. Signed-off-by: David Goulet <dgoulet@torproject.org>
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