aboutsummaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2019-11-07crypto config: do not change the user's value of HardwareAccel.Nick Mathewson
We still interpret "AccelName" as turning on the "HardwareAccel" feature, but we no longer modify the user's options here. Fixes bug 32382; bugfix on 0.2.2.1-alpha when we added openssl engine support.
2019-11-07Use new configuration architecture for crypto optionsNick Mathewson
This is a comparatively simple change.
2019-11-07test/parseconf: Update config parsing tests for 32410teor
2019-11-07Run "make autostyle"teor
2019-11-06Merge branch 'tor-github/pr/1491'David Goulet
2019-11-06test: Fix DoS heartbeat unit test after adding INTRO2David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-06test/parseconf: Add support for optional library variantsteor
test_parseconf.sh now supports: * {error,expected}{,_lzma,_nss,_zstd}{,_no_dirauth,_no_relay_dirauth} Or any combination of two or more optional libraries. Closes ticket 32397.
2019-11-06shellcheck: Fix minor issues in some scriptsteor
Fix minor issues in git-push-all.sh, git-setup-dirs.sh and test_parseconf.sh. Fixes bug 32402; not in any released version of tor. Obviously correct changes to already reviewed code.
2019-11-05test: Handle NULL circuit pointer in new_fake_orcircDavid Goulet
Coverity CID: 1455207 Closes #32376 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-11-05Merge remote-tracking branch 'tor-github/pr/1477'teor
2019-11-05config: Run "make autostyle"teor
Part of 32213.
2019-11-05config: Rename new global functions with a prefixteor
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ get_dirportfrontpage relay_get_dirportfrontpage \ parse_port_config port_parse_config \ count_real_listeners port_count_real_listeners \ parse_transport_line pt_parse_transport_line \ ensure_bandwidth_cap config_ensure_bandwidth_cap \ get_effective_bwrate relay_get_effective_bwrate \ get_effective_bwburst relay_get_effective_bwburst \ warn_nonlocal_ext_orports port_warn_nonlocal_ext_orports \ parse_ports_relay port_parse_ports_relay \ update_port_set_relay port_update_port_set_relay \ get_transport_bindaddr_from_config pt_get_bindaddr_from_config \ get_options_for_server_transport pt_get_options_for_server_transport It was generated with --no-verify, because it has some long lines. Part of 32213.
2019-11-05test/parseconf: Add conf_examples for relaysteor
Tests relay/relay_config.c. Part of 32213.
2019-11-05test/parseconf: Add conf_examples for PTsteor
Tests relay/transport_config.c. Part of 32213.
2019-11-05test/parseconf: Always show the result file name on failureteor
Obviously correct fixes on already reviewed code.
2019-11-05test/parseconf: Run all the tests, even if one failsteor
Obviously correct fixes on already reviewed code.
2019-11-05test/parseconf: Consistenly use FAILteor
Obviously correct fixes on already reviewed code.
2019-11-05test/parseconf: Don't specify a path for 'true'teor
Obviously correct fixes on already reviewed code.
2019-11-05test/parseconf: Send all errors to stderrteor
Obviously correct fixes on already reviewed code.
2019-11-05test/scripts: Use the same code to find the tor binaryteor
This change makes sure we are always using the coverage binary, when coverage is enabled. Fixes bug 32368; bugfix on 0.2.7.3-rc.
2019-11-05test/stats: Add minimal tests for rephist mtbfteor
Part of 32213.
2019-11-05test: Split stats into its own fileteor
Part of 32213.
2019-11-05relay: Refactor tests, and add extra options teststeor
Part of 32213.
2019-11-04relay: Disable relay config when the module is disabledteor
This commit: * disables the ORPort, DirPort, DirCache, and BridgeRelay options, * sets ClientOnly 1, * disables relay_config.c and relay/transport_config.c, * disables test_rebind.sh, and * modifies the expected results for test_parseconf.sh, when the relay module is disabled. Part of 32213.
2019-11-04relay: Make a transport_config function privateteor
Part of 32213.
2019-11-04dirauth: Refactor some code and teststeor
Minor simplification and refactoring. Make the dirauth tests focus on testing the intention of the code, rather than option processing order. Part of 32213.
2019-11-01Merge remote-tracking branch 'tor-github/pr/1480'Nick Mathewson
2019-10-31config: Move relay config actions into the relay moduleteor
This commit: * moves relay config actions into relay_config, * moves get_dirportfrontpage() into relay_config, * adds thin wrappers to make the moved code compile. No functional changes: the moved code is still enabled, even if the relay module is disabled. (Some of the checks are re-ordered, so the order of some warnings may change.) Part of 32213.
2019-10-31config: Move server transport config into the relay moduleteor
This commit: * creates feature/relay/transport_config.[ch], * moves server transport config checks into them, * exposes some code from src/app/config.c (we'll refactor it later in 29211), and * adds thin wrappers to make the moved code compile. No functional changes: the moved code is still enabled, even if the relay module is disabled. (Some of the checks are re-ordered, so the order of some warnings may change.) Part of 32213.
2019-10-31config: Move relay config checks into the relay moduleteor
This commit: * moves relay config checks into relay_config.[ch], * exposes some code from src/app/config.c (we'll refactor it later in 29211), and * adds thin wrappers to make the moved code compile. No functional changes: the moved code is still enabled, even if the relay module is disabled. (Some of the checks are re-ordered, so the order of some warnings may change.) Part of 32213.
2019-10-31dirauth: Disable dirauth config when the module is disabledteor
Part of 32213.
2019-10-31test: Fix a comment typo in src/test/test_hs_ntor.shteor
2019-10-31test: Fix a loop variable bug in test_parseconf.shteor
Obviously correct fixes to already reviewed code. No changes file required: not in any released version of tor.
2019-10-29Merge branch 'tor-github/pr/1456'George Kadianakis
2019-10-28ewma: Implement unit testsDavid Goulet
At this commit, 93.9% of line coverage and 95.5% of function coverage. Closes #32196 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-28test: Implement unit tests for circuitmux.cDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-28test: Add fakecircs.{h|c} helperDavid Goulet
Fake circuits are created everywhere in the unit tests. This is an attempt at centralizing a "fake circuit creation" API like fakechans.c does for channel. This commit introduces fakecircs.c and changes test_relay.c and test_circpadding.c which were using roughly the same code. This will allow easier OR circuit creation for the future tests in test_circuitmux.c Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-28test: Implement cmux allocate unit testDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-28test: Remove circuitmux/destroy_cell_queue code duplicationDavid Goulet
This also rename a function to improve code clarity. Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-28test: Add testcase setup object for test_cmuxDavid Goulet
Also remove a scheduler_init() from a test and MOCK the appropriate function so the test can pass. This is done in order to minimize initialization functions in the unit test and try to only go through the testcase setup object. Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-26Rename confparse.[ch] identifiers to confmgt.[ch] identifiers.Nick Mathewson
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ confparse.h confmgt.h \ confparse.c confmgt.c \ CONFPARSE_PRIVATE CONFMGT_PRIVATE \ TOR_CONFPARSE_H TOR_CONFMGT_H
2019-10-25Merge branch 'ticket31241_v3'Nick Mathewson
2019-10-25test: Use SEVERITY_MASK_IDX() to find the LOG_* mask indexesteor
In the unit tests. Fixes a regression to bug 31334; bug not in any released version of tor.
2019-10-24test_options: add a test for options_trial_assign()Nick Mathewson
This function is used by controllers to set options. I refactored it a bit when refactoring options validation, so it needs to get tested.
2019-10-24tests: set DataDirectory_option as well as DataDirectory.Nick Mathewson
options_validate_cb() derives DataDirectory (which we use) from DataDirectory_option (which the user sets). I want to add a test that will call options_validate_cb(), but it will fail unless it derives the same value.
2019-10-24Extend confmgr tests to handle validation callbacks.Nick Mathewson
2019-10-24Rename validate_fn{,_t} to start with "legacy_".Nick Mathewson
The current API of this callback mixes responsibilities, including: * validation * transition checking * processing (modifying) the configuration object. These will have to be disentangled piece by piece, so for now, we'll have "legacy" validate functions as well. This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ validate_fn_t legacy_validate_fn_t \ validate_fn legacy_validate_fn
2019-10-24test_options: stop generating old_data entirely.Nick Mathewson
Now that we no longer use it anywhere, we can remove this variable from the test data structure.
2019-10-24test_options: don't pass an old_options argument to options_validate()Nick Mathewson
This input was inessential, and none of the tests actually depended on it or tested anything about it (as can be seen from the fact that tests all still pass when it's removed). I tried to generate this commit with a coccinelle script, but it had trouble parsing a lot of options_validate as it stands. Instead, I did a search-and-replace to replace "tdata->old_opt," with "NULL,".
2019-10-24Use named-member syntax for initializing config_format_t objectsNick Mathewson
I'm about to mess with their lists of callbacks, and I don't want to proliferate lists where we say "NULL, NULL, NULL, ..."