aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_tortls.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-09-09 09:44:57 -0400
committerNick Mathewson <nickm@torproject.org>2016-09-09 09:45:50 -0400
commit5e30e26c6d7ae33e23557bc18def36f98be4e1e6 (patch)
treed2f530092f07a79e6c2fc6e7dc6ac981445562eb /src/test/test_tortls.c
parent05110c9294f64b494600b056670f62ca89b52b0b (diff)
downloadtor-5e30e26c6d7ae33e23557bc18def36f98be4e1e6.tar.gz
tor-5e30e26c6d7ae33e23557bc18def36f98be4e1e6.zip
Chop another ~93 RSA key generations out of the unit tests
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.
Diffstat (limited to 'src/test/test_tortls.c')
-rw-r--r--src/test/test_tortls.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/test_tortls.c b/src/test/test_tortls.c
index 8502e8aa3f..8efcac242f 100644
--- a/src/test/test_tortls.c
+++ b/src/test/test_tortls.c
@@ -2422,6 +2422,8 @@ test_tortls_context_new(void *ignored)
ret = tor_tls_context_new(NULL, 0, 0, 0);
tt_assert(!ret);
+ /* note: we already override this in testing_common.c, so we
+ * run this unit test in a subprocess. */
MOCK(crypto_pk_generate_key_with_bits,
fixed_crypto_pk_generate_key_with_bits);
fixed_crypto_pk_new_result_index = 0;
@@ -2808,7 +2810,7 @@ struct testcase_t tortls_tests[] = {
INTRUSIVE_TEST_CASE(find_cipher_by_id, 0),
INTRUSIVE_TEST_CASE(session_secret_cb, 0),
INTRUSIVE_TEST_CASE(debug_state_callback, 0),
- INTRUSIVE_TEST_CASE(context_new, 0),
+ INTRUSIVE_TEST_CASE(context_new, TT_FORK /* redundant */),
LOCAL_TEST_CASE(create_certificate, 0),
LOCAL_TEST_CASE(cert_new, 0),
LOCAL_TEST_CASE(cert_is_valid, 0),