summaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
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-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-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, ..."
2019-10-24test_options: Use 64-bit comparisons when checking domain masks.Nick Mathewson
This prevents a warning when building for 32-bit targets. Fixes bug 32269; bug not in any released Tor.
2019-10-24Merge remote-tracking branch 'tor-github/pr/1447'teor
2019-10-23hs-v3: Remove the circuit_established intro flagDavid Goulet
Only use the HS circuit map to know if an introduction circuit is established or not. No need for a flag to keep state of something we already have in the circuit map. Furthermore, the circuit map gets cleaned up properly so it will always have the "latest truth". This commit also removes a unit test that was testing specifically that flag but now we rely solely on the HS circuit map which is also tested few lines below the removed test. Fixes #32094 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-23Merge remote-tracking branch 'tor-github/pr/1449'teor
2019-10-23Tidy whitespace around some STMT_BEGINs and STMT_ENDsteor
2019-10-22config validation: make the "old_options" argument const.Nick Mathewson
We can't do this with the "options" argument yet, since several places in the code change those right now.
2019-10-22test_options: remove def_opt member of test data.Nick Mathewson
2019-10-22test_options: remove "dflt" part of setup_options().Nick Mathewson
It is no longer used anywhere.
2019-10-22Remove a pair of now-unused default-options arguments.Nick Mathewson
2019-10-22test_options: Fix options_validate() calls in macros.Nick Mathewson
Coccinelle missed these.
2019-10-22Use coccinelle to fix most options_validate() call sites.Nick Mathewson
There was one that it could not find because it was in a macro definition. I used the following semantic patch: @@ expression e1, e2, e3, e4, e5; @@ options_validate(e1, e2, - e3, - e4, e5)
2019-10-22validate_fn(): remove now-unused defaults and from_setconf.Nick Mathewson
These arguments were only used by options_validate, and are now ignored even there.
2019-10-22Re-run make autostyle.Nick Mathewson
2019-10-22Merge branch 'ticket31705_v2' into ticket31705_v2_mergedNick Mathewson
Conflicts: src/feature/dirparse/authcert_parse.c src/feature/dirparse/ns_parse.c src/feature/hs/hs_service.c src/lib/conf/conftesting.h src/lib/log/log.h src/lib/thread/threads.h src/test/test_options.c These conflicts were mostly related to autostyle improvements, with one or two due to doxygen fixes.
2019-10-22test_addr.c: use COCCI to suppress macros coccinelle cannot parse.Nick Mathewson
2019-10-22test.h: Use COCCI to suppress macros Coccinelle does not understand.Nick Mathewson
2019-10-22test: Hide some test-declaration macro definitions to COCCI.Nick Mathewson
(These ones cause parsing failures.)
2019-10-22With coccinelle, avoid includes in the middle of an expression.Nick Mathewson
2019-10-22Merge branch 'bug32175'Nick Mathewson