summaryrefslogtreecommitdiff
path: root/src/test/testing_common.c
AgeCommit message (Collapse)Author
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.
2016-05-16Initialize networking _before_ initializing libevent in the testsNick Mathewson
This prevents WSANOTINITIALISED errors and fixes bug 18668. Bugfix on 0.2.8.1-alpha -- 1bac468882fd732460d8a25735131 specifically.
2016-02-27Update the copyright year.Nick Mathewson
2016-02-11Merge branch 'check_log_mutex_uncherrypicked'Nick Mathewson
2016-02-11Initialise logging before trying to use it in unit teststeor (Tim Wilson-Brown)
2016-02-04Fix two problems in the 0.2.8.x unit testsNick Mathewson
1. We were sometimes using libevent uninitialized, which is Not Allowed. 2. The malformed-PTR dns test was supposed to get a -1 output... but the test was wrong, since it forgot that in-addr.arpa addresses are in reverse order. Bugs not in any released tor.
2015-12-15Fix some memory leaks in the unit testsNick Mathewson
2015-11-25Make crypto_seed_rng() and crypto_rand() less scary.Nick Mathewson
These functions must really never fail; so have crypto_rand() assert that it's working okay, and have crypto_seed_rng() demand that callers check its return value. Also have crypto_seed_rng() check RAND_status() before returning.
2015-08-18Refactor initialization logic for control-event-queueNick Mathewson
This puts the init logic in a separate function, which we will need once we have locking.
2015-05-20Merge branch 'bug16034_no_more_openssl_098_squashed'Nick Mathewson
Conflicts: src/test/testing_common.c
2015-05-20Now that OpenSSL 0.9.8 is dead, crypto_seed_rng() needs no argsNick Mathewson
It needed an argument before because it wasn't safe to call RAND_poll() on openssl 0.9.8c if you had already opened more fds than would fit in fd_set.
2015-03-14Remove DynamicDHGroups as obsoleted by PluggableTransports or P256.Nick Mathewson
Closes ticket 13736.
2015-03-09testing_common.c: avoid side-effects of tor_assertTom van der Woerdt
2015-01-23Split the slow unit tests into their own binaryNick Mathewson
This can run in parallel with the faster ones and the other tests.