aboutsummaryrefslogtreecommitdiff
path: root/src/test/testing_common.c
AgeCommit message (Collapse)Author
2020-08-19Merge branch 'maint-0.4.4'George Kadianakis
2020-08-19Merge branch 'mr/124' into maint-0.4.4George Kadianakis
2020-08-19Parallelize src/test/test into chunks.Nick Mathewson
First, we introduce a flag to teach src/test/test to split its work into chunks. Then we replace our invocation of src/test/test in our "make check" target with a set of 8 scripts that invoke the first 8th of the tests, the second 8th, and so on. This change makes our "make -kj4 check" target in our hardened gitlab build more than twice as fast, since src/test/test was taking the longest to finish. Closes 40098.
2020-07-10Split bandwidth history functions into a separate C file.Nick Mathewson
These are logically independent from the rest of rephist, and make more sense in isolation. The next patch will rename them too.
2020-03-20Merge branch 'maint-0.4.3'teor
2020-03-20Merge branch 'maint-0.4.2' into maint-0.4.3teor
2020-03-20Merge branch 'maint-0.4.1' into maint-0.4.2teor
2020-03-19Merge branch 'ticket33643_skip_035' into ticket33643_skip_041Nick Mathewson
2020-03-19Add a TOR_SKIP_TESTCASES environment variable for suppressing tests.Nick Mathewson
For example, "TOR_SKIP_TESTCASES=crypto/.. ./src/test/test" will run the tests and suppress all the "crypto/" tests. You could get the same effect by running "./src/test/test :crypto/..", but that can be harder to arrange from CI. Part of a fix/workaround for 33643.
2020-02-24Initialize all subsystems during the unit testsNick Mathewson
Previously we had initialized only the library subsystems. This made it hard to write some tests, and encouraged people to put their subsystems at a level lower than they really belonged at. Instead, it probably just makes sense to initialize everything before we start the tests. Without this fix, 33316 breaks our tests because of raising the level of the ocirc/orconn events.
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-12-20Run "make autostyle"teor
2019-12-10set up tmp dir for test suite to run on AndroidHans-Christoph Steiner
There is no /tmp or mkdtemp on Android, there is /data/local/tmp for root and the shell user. So this fakes mkdtemp. Also, FYI, tor might not like the default perms of /data/local/tmp, e.g. 0770. https://trac.torproject.org/projects/tor/ticket/32172
2019-11-07Make all our struct names end with "_t".Nick Mathewson
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ address_ttl_s address_ttl_t \ aes_cnt_cipher aes_cnt_cipher_t \ authchallenge_data_s authchallenge_data_t \ authenticate_data_s authenticate_data_t \ cached_bw_event_s cached_bw_event_t \ cbuf cbuf_t \ cell_ewma_s cell_ewma_t \ certs_data_s certs_data_t \ channel_idmap_entry_s channel_idmap_entry_t \ channel_listener_s channel_listener_t \ channel_s channel_t \ channel_tls_s channel_tls_t \ circuit_build_times_s circuit_build_times_t \ circuit_muxinfo_s circuit_muxinfo_t \ circuitmux_policy_circ_data_s circuitmux_policy_circ_data_t \ circuitmux_policy_data_s circuitmux_policy_data_t \ circuitmux_policy_s circuitmux_policy_t \ circuitmux_s circuitmux_t \ coord coord_t \ cpuworker_job_u cpuworker_job_u_t \ cv_testinfo_s cv_testinfo_t \ ddmap_entry_s ddmap_entry_t \ dircollator_s dircollator_t \ dist_ops dist_ops_t \ ecdh_work_s ecdh_work_t \ ewma_policy_circ_data_s ewma_policy_circ_data_t \ ewma_policy_data_s ewma_policy_data_t \ fp_pair_map_entry_s fp_pair_map_entry_t \ fp_pair_map_s fp_pair_map_t \ guard_selection_s guard_selection_t \ mbw_cache_entry_s mbw_cache_entry_t \ outbuf_table_ent_s outbuf_table_ent_t \ queued_event_s queued_event_t \ replyqueue_s replyqueue_t \ rsa_work_s rsa_work_t \ sandbox_cfg_elem sandbox_cfg_elem_t \ scheduler_s scheduler_t \ smp_param smp_param_t \ socket_table_ent_s socket_table_ent_t \ state_s state_t \ threadpool_s threadpool_t \ timeout_cb timeout_cb_t \ tor_libevent_cfg tor_libevent_cfg_t \ tor_threadlocal_s tor_threadlocal_t \ url_table_ent_s url_table_ent_t \ worker_state_s worker_state_t \ workerthread_s workerthread_t \ workqueue_entry_s workqueue_entry_t
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-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-09-30Re-run "make autostyle" with improved annotate_ifdef_directivesNick Mathewson
2019-09-25test: Use SEVERITY_MASK_IDX() to find the LOG_* mask indexesteor
In the unit tests and fuzzers. Fixes bug 31334; bugfix on 0.2.5.2-alpha.
2019-07-08Adjust log callback type to use log_domain_mask_tNick Mathewson
2019-03-25Split all controller events code into a new control_events.cNick Mathewson
Also, split the formatting code shared by control.c and control_events.c into controller_fmt.c.
2019-01-16Merge branch 'ticket28668_035' into ticket28668_040Nick Mathewson
2019-01-16Fail any unit test that causes an unhandled LD_BUG or LOG_ERRNick Mathewson
Closes ticket 28668.
2019-01-16Bump copyright date to 2019Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2018-11-05Turn "compress" into a subsystem.Nick Mathewson
2018-11-05Move monotonic time setup into a subsystemNick Mathewson
2018-11-05Move prefork, postfork, and thread-exit hooks into subsysNick Mathewson
So far, crypto is the only module that uses them, but others are likely to do so in the future.
2018-11-05Add crypto module as a subsystem.Nick Mathewson
2018-11-05Move networking startup/cleanup logic into a subsystem.Nick Mathewson
2018-11-05Use subsystems manager for subsystems used in tests.Nick Mathewson
2018-11-05Move the code that knows our tor version into a lowest-level libNick Mathewson
2018-09-27Move the predicted ports code out of rephist.cNick Mathewson
It differs from the rest of the rephist code in that it's actually necessary for Tor to operate, so it should probably go somewhere else. I'm not sure where yet, so I'll leave it in the same directory, but give it its own file.
2018-09-21Split main.c into main.c and mainloop.cNick Mathewson
The main.c code is responsible for initialization and shutdown; the mainloop.c code is responsible for running the main loop of Tor. Splitting the "generic event loop" part of mainloop.c from the event-loop-specific part is not done as part of this patch.
2018-09-07Merge remote-tracking branch 'dgoulet/ticket20700_035_03'Nick Mathewson
2018-09-07bug: Use PATH_SEPARATOR instead of slashSuphanat Chunhapanya
In function get_fname_suffix, previously it uses /, but in fact it should use PATH_SEPARATOR.
2018-09-04Update prefork and postfork NSS code for unit tests.Nick Mathewson
2018-08-21Also reinitialize the pregenerated keys postfork.Nick Mathewson
2018-07-31Implement DH in NSS.Nick Mathewson
2018-07-13Add postfork support for nssNick Mathewson
We need this in our unit tests, since otherwise NSS will notice we've forked and start cussing us out. I suspect we'll need a different hack for daemonizing, but this should be enough for tinytest to work.
2018-07-11Move the initialization and cleanup parts of crypto.cNick Mathewson
These are now part of crypto_init.c. The openssl-only parts now live in crypto_openssl_mgt.c. I recommend reviewing this patch with -b and --color-moved.
2018-07-05Fix every include path changed in the previous commit (automated)Nick Mathewson
I am very glad to have written this script.
2018-07-05Clean up include paths for libtor-evloop (automated)Nick Mathewson
2018-07-01Remove system headers from or.hNick Mathewson
2018-07-01Minimize headers that include crypto_formats and x25519 stuffNick Mathewson
2018-07-01Remove needless includes from or.hNick Mathewson
or.h should really include only the minimum of stuff from or/*, common/*, and lib/*.
2018-06-21Rectify include paths (automated)Nick Mathewson
2018-06-21Rectify include paths (automated)Nick Mathewson
2018-06-20Remove dmalloc support; closes #26426Nick Mathewson
Dmalloc hasn't seen a release in over a decade, and there are much better tools to use these days.
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson