aboutsummaryrefslogtreecommitdiff
path: root/src/test/testing_common.c
AgeCommit message (Collapse)Author
2020-10-07Parallelize 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-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.
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 2019.Nick 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
2018-05-03Merge remote-tracking branch 'isis/bug24660_r1'Nick Mathewson
2018-04-26Fix a test assertion failure due to uninitialized mainloop eventsNick Mathewson
Bug not in any released Tor.
2018-04-06crypto: Refactor (P)RNG functionality into new crypto_rand module.Isis Lovecruft
* ADD new /src/common/crypto_rand.[ch] module. * ADD new /src/common/crypto_util.[ch] module (contains the memwipe() function, since all crypto_* modules need this). * FIXES part of #24658: https://bugs.torproject.org/24658
2018-02-20Remove a bunch of other redundant #includesNick Mathewson
Folks have found two in the past week or so; we may as well fix the others. Found with: \#!/usr/bin/python3 import re def findMulti(fname): includes = set() with open(fname) as f: for line in f: m = re.match(r'^\s*#\s*include\s+["<](\S+)[>"]', line) if m: inc = m.group(1) if inc in includes: print("{}: {}".format(fname, inc)) includes.add(m.group(1)) import sys for fname in sys.argv[1:]: findMulti(fname)
2018-01-31Use thread-safe types to store the LOG_PROTOCOL_WARN severityNick Mathewson
Fixes a race condition; resolves 23954.
2017-12-05Implement the various get_foodir_*() functions.Nick Mathewson
2017-10-18Move tor_git_revision into a new module.Nick Mathewson
At first, we put the tor_git_revision constant in tor_main.c, so that we wouldn't have to recompile config.o every time the git revision changed. But putting it there had unintended side effect of forcing every program that wanted to link libor.a (including test, test-slow, the fuzzers, the benchmarks, etc) to declare their own tor_git_revision instance. That's not very nice, especially since we want to start supporting others who want to link against Tor (see 23846). So, create a new git_revision.c file that only contains this constant, and remove the duplicated boilerplate from everywhere else. Part of implementing ticket 23845.
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-05-08Merge branch 'netflow_padding-v6-rebased2-squashed'Nick Mathewson
2017-05-08Cache netflow-related consensus parameters.Mike Perry
Checking all of these parameter lists for every single connection every second seems like it could be an expensive waste. Updating globally cached versions when there is a new consensus will still allow us to apply consensus parameter updates to all existing connections immediately.
2017-05-08Bug 17592: Clean up connection timeout logic.Mike Perry
This unifies CircuitIdleTimeout and PredictedCircsRelevanceTime into a single option, and randomizes it. It also gives us control over the default value as well as relay-to-relay connection lifespan through the consensus. Conflicts: src/or/circuituse.c src/or/config.c src/or/main.c src/test/testing_common.c
2017-04-25Use atomic counters for compressor allocation.Nick Mathewson
2017-03-31Isolate dmalloc/openssl bridge code to crypto.cNick Mathewson
This makes it so main.c, and the rest of src/or, no longer need to include any openssl headers.
2017-03-15Run the copyright update script.Nick Mathewson
2016-11-07Merge branch 'maint-0.2.9'Nick Mathewson
Conflicts: src/or/rendservice.c
2016-11-03Move unittests' RSA pregen code into a new file, and improve.Nick Mathewson
This patch moves the pregenerated RSA key logic into a new testing_rsakeys.c. Also, it adds support for RSA2048, since the link handshake tests want that. Also, it includes pregenerated keys, rather than trying to actually generate the keys at startup, since generating even a small handful of RSA2048 keys makes for an annoying delay.
2016-11-02Make sure passthrough_test_setup doesn't inadvertently fail or skip teststeor
passthrough_test_setup doesn't pass through arguments if the argument is equal to 0 or TT_SKIP. Instead, it fails or skips the test. Assert on this, so we don't accidentally fail or skip tests.
2016-11-02Add get_fname_rnd for unit tests that want a unique path every timeteor
2016-11-02Create get_fname_suffix, and refactor get_fname to use itteor
2016-09-09make check-spacesNick Mathewson
2016-09-09Chop another ~93 RSA key generations out of the unit testsNick Mathewson
We have a mock for our RSA key generation function, so we now wire it to pk_generate(). This covers all the cases that were not using pk_generate() before -- all ~93 of them.
2016-09-09Move the donna-fuzzing tests into test_slow.Nick Mathewson
This shaves another 3-4 seconds off the main-path tests for me, which is again worth it, according to XKCD#1204.
2016-09-09Re-enable RSA cacheing in tests, with a better design.Nick Mathewson
This makes tests faster and saves about 6 seconds for me, which makes it worth it, according to https://xkcd.com/1205.
2016-09-08Treat all nonfatal assertion failures as unit test failures.Nick Mathewson
Part of 19999.
2016-08-31Actually, always monotime_init() in the unit tests.Nick Mathewson
2016-08-31Always log [bug] warnings from the unit tests.Nick Mathewson
We should consider them bugs. If they are happening intentionally, we should use the log_test_helpers code to capture and suppress them. But having them off-by-default has potential to cause programming errors.
2016-06-11Add -Wmissing-variable-declarations, with attendant fixesNick Mathewson
This is a big-ish patch, but it's very straightforward. Under this clang warning, we're not actually allowed to have a global variable without a previous extern declaration for it. The cases where we violated this rule fall into three roughly equal groups: * Stuff that should have been static. * Stuff that was global but where the extern was local to some other C file. * Stuff that was only global when built for the unit tests, that needed a conditional extern in the headers. The first two were IMO genuine problems; the last is a wart of how we build tests.