summaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
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
2019-10-22Merge branch 'from_setconf_removal_squashed'Nick Mathewson
2019-10-22Add tests for options_init_logs()Nick Mathewson
2019-10-22Update tests to handle new interpretation of quiet_level.Nick Mathewson
Two things needed to be changed. First, we used to set quiet_level to the default (QUIET_NONE) when running tests, since we would not call anything that acted based upon it. But since we sometimes call options_init_logs(), we need to pre-set quiet_level to QUIET_SILENT in the logs so that we don't add the default logs. This did not cause test failure: just unwanted logs. Second, we had a test that checked whether options_validate was messing with options->Logs correctly. Since options_validate no longer messes with the logs, we no longer want a test for this.
2019-10-21Fix a memory leak introduced by changes to test_options.cNick Mathewson
Since the FirewallPorts smartlist is now initialized, we can't just overwrite it.
2019-10-21Fix up some Windows CI issues.Nick Mathewson
2019-10-21test_options.c: Remove TEST_OPTIONS_DEFAULT_VALUESNick Mathewson
This finally became the empty string, since we no longer have to do anything in individual test_options.c tests to make "" be a valid set of options. Now we can remove it at last.
2019-10-21Stop overriding ConnLimit in tests.Nick Mathewson
Now that ConnLimit is set to the default value in the testing helper functions, the individual tests don't all need to make sure it is set to something valid.
2019-10-21test_options.c: remove weird usage of ConnLimitNick Mathewson
Several of our tests assumed that ConnLimit would be set to 0 by default, causing the default options not to be parseable. These tests had nothing to do with ConnLimit.
2019-10-21Stop overriding MaxClientCircuitsPending in tests.Nick Mathewson
Now that MaxClientCircuitsPending is set to the default value in the testing helper functions, the individual tests don't all need to make sure it is set to something valid.
2019-10-21test_options.c: remove weird usage of MaxClientCircuitsPendingNick Mathewson
Several of our tests assumed that MaxClientCircuitsPending would be set to 0 by default, causing the default options not to be parseable. These tests had nothing to do with MaxClientCircuitsPending.
2019-10-21Stop overriding KeepalivePeriod in tests.Nick Mathewson
Now that KeepalivePeriod is set to the default value in the testing helper functions, the individual tests don't all need to make sure it is set to something valid.
2019-10-21test_options.c: remove weird usage of KeepalivePeriod.Nick Mathewson
Several of our tests assumed that KeepalivePeriod would be set to 0 by default, causing the default options not to be parseable. These tests had nothing to do with KeepalivePeriod.
2019-10-21Remove a lot of cruft from TEST_OPTIONS_DEFAULT_VALUES.Nick Mathewson
This macro used to have a big list of "default" values that we needed to set in the test_options tests in order to have reasonable behavior. But now that we initialize options objects to the default settings in these tests, we no longer need such a long list of things to replace.
2019-10-21test_options: use testing options with (almost) real defaults.Nick Mathewson
Previously, we just used options set to all 0s, but this causes some pretty severe workarounds throughout the code, as our options fail to validate, or count as "default" for the wrong reasons. Note that in some places, we stop getting spurious warnings or failures which the tests previously demanded. In these cases, I've changed the test behavior. Fixes 32175.
2019-10-21Merge remote-tracking branch 'tor-github/pr/1430'Nick Mathewson
2019-10-21Merge remote-tracking branch 'tor-github/pr/1434'teor
2019-10-21test/getinfo: Remove unnecessary test codeteor
Fix for 31684.
2019-10-21control: Add GETINFO support for dumping microdesc consensusAmreshVenugopal
- Allows control port to read microdesc consensus using: GETINFO dir/status-vote/microdesc/consensus add: Helper function `getinfo_helper_current_consensus` test: check if GETINFO commands return expected consensus data. Resolves 31684.