aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_options.c
AgeCommit message (Collapse)Author
2020-08-14Revise trac.torproject.org urls to refer to gitlab replacements.Nick Mathewson
Closes #40101.
2020-07-13Bug 31812: Change http URL's to httpsJeremyRand
2020-03-12Merge branch 'ticket33361_035_01_squashed' into maint-0.4.3Nick Mathewson
2020-03-12Fix unit tests that look at contactinfo logs.Nick Mathewson
2020-02-26In typed_var_kvassign, include config names in error messages.Nick Mathewson
This should improve the usability of our configuration error messages.
2020-02-26confmgt: when a units value is invalid, include a meaningful error.Nick Mathewson
Part of 33460.
2020-02-26confmgt: when an int/enum value is invalid, say which values are ok.Nick Mathewson
Part of 33460.
2020-01-17Merge branch 'ticket32806'Nick Mathewson
2020-01-17Remove some dead checksNick Mathewson
The only code that could set these options to be negative was in the unit tests.
2020-01-09Remove all usage of the NS*() macros in test*.cNick Mathewson
This is an automatically generated commit, made with the following kludgey perl script. It results in a number of wide lines, which I'll clean up in a subsequent commit. #/usr/bin/perl -w -i $mod = "NS_MODULE"; $submod = "NS_SUBMODULE"; $last_was_empty = 0; while (<>) { s/\bASPECT\(\s*(\w+)\s*,\s*(\w+)\s*\)/$1_$2/; if (/# *define +NS_MODULE +(\w+)/) { $mod = $1; next; } elsif (/# *define +NS_SUBMODULE +(\w+)/) { $submod = $1; next; } next if (/#undef NS_(SUB)?MODULE/); s/NS\(\s*test_main\s*\)/test_${mod}_${submod}/; s/NS\(\s*(\w+)\s*\)/${mod}_${submod}_$1/g; s/NS_FULL\(\\s*(\w+)\s*,\s*(\w+),\s*(\w+)\s*\)/$1_$2_$3/; s/^(\s*)NS_MOCK\(\s*(\w+)\s*\)/$1MOCK($2,\n$1 ${mod}_${submod}_$2)/; s/NS_UNMOCK\(\s*(\w+)\s*\)/UNMOCK($1)/; s/TEST_CASE\(\s*(\w+)\s*\)/{ "$1", test_${mod}_$1, TT_FORK, NULL, NULL }/; s/TEST_CASE_ASPECT\(\s*(\w+)\s*,\s*(\w+)\s*\)/{ "$1_$2", test_${mod}_$1_$2, TT_FORK, NULL, NULL }/; s/NS_DECL\(\s*([^,]+)\s*,\s*([^,]+)\s*,\s*(\(.*)\);/static $1 ${mod}_${submod}_$2$3;\nATTR_UNUSED static int ${mod}_${submod}_$2_called = 0;/; s/\bCALLED\(\s*(\w+)\s*\)/${mod}_${submod}_$1_called/; if (/^$/) { print if (! $last_was_empty); $last_was_empty = 1; } else { $last_was_empty = 0; print; } if (eof) { $mod = "NS_MODULE"; $submod = "NS_SUBMODULE"; $last_was_empty = 0; } } # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Thu Jan 9 10:26:10 2020 -0500 # # On branch disable_ns_macro # Changes to be committed: # modified: src/test/test_accounting.c # modified: src/test/test_compat_libevent.c # modified: src/test/test_dir.c # modified: src/test/test_dir_handle_get.c # modified: src/test/test_dns.c # modified: src/test/test_options.c # modified: src/test/test_procmon.c # modified: src/test/test_rendcache.c # modified: src/test/test_router.c # modified: src/test/test_routerset.c # modified: src/test/test_status.c # modified: src/test/test_tortls.c # modified: src/test/test_tortls_openssl.c # modified: src/test/test_util_format.c # modified: src/test/test_util_process.c # # Untracked files: # experiments/ # locate_options.sh # un_ns.pl # # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Thu Jan 9 10:26:10 2020 -0500 # # On branch disable_ns_macro # Changes to be committed: # modified: src/test/test_accounting.c # modified: src/test/test_compat_libevent.c # modified: src/test/test_dir.c # modified: src/test/test_dir_handle_get.c # modified: src/test/test_dns.c # modified: src/test/test_options.c # modified: src/test/test_procmon.c # modified: src/test/test_rendcache.c # modified: src/test/test_router.c # modified: src/test/test_routerset.c # modified: src/test/test_status.c # modified: src/test/test_tortls.c # modified: src/test/test_tortls_openssl.c # modified: src/test/test_util_format.c # modified: src/test/test_util_process.c # # Untracked files: # experiments/ # locate_options.sh # un_ns.pl #
2020-01-09Always define NS_MODULE and NS_SUBMODULE when NS is used.Nick Mathewson
When these macros aren't defined, the expansions of the NS macros can get particularly ugly.
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2020-01-06Merge branch 'haxxpop/tcp_proxy_squashed' into tcp_proxy_squshed_and_mergedNick Mathewson
2019-12-19Mark TestingEstimatedDescriptorPropagationTime as obsolete.Nick Mathewson
We stopped looking at this option in 85cf6dcba3693b, back when we implemented the minimal pieces of prop275. Since then, we've had code to validate and adjust this option, and to give it a different value in testing networks, but the option hasn't actually done anything. We can safely mark it as OBSOLETE, since doing so does not make any old configuration get rejected. Closes ticket 32807.
2019-12-19Move TestingDirVote{Exit,Guard,HSdir}{,IsStrict} to dirauth moduleNick Mathewson
2019-12-19Move TestingDirAuthTimeToLearnReachability into dirauth module.Nick Mathewson
2019-12-19Move MinUptimeHidServDirectoryV2 to dirauth module.Nick Mathewson
2019-12-19Move get_foo_options() test helpers into a new test module.Nick Mathewson
Some of these helpers will be needed in multiple places in the unit tests, so we should move them now.
2019-12-19Dirauth options: move versioning options to dirauth moduleNick Mathewson
This commit moves VersioningAuthoritativeDirectory, RecommendedClientVersions, and RecommendedServerVersions.
2019-11-15Remove the extra whitespace around the DARWIN #definesNeel Chauhan
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-05config: Run "make autostyle"teor
Part of 32213.
2019-11-05relay: Refactor tests, and add extra options teststeor
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 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-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-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-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-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-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-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: Hide some test-declaration macro definitions to COCCI.Nick Mathewson
(These ones cause parsing failures.)
2019-10-22Merge branch 'bug32175'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.