summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-07-16 12:21:47 +0200
committerRichard Levitte <levitte@openssl.org>2019-07-19 20:20:02 +0200
commita9befadf73df107a1da3f143d0b7ae941b6b3d8e (patch)
treecdfac09da195d4001f2371f83340f67f6e4a43c6 /test
parent7fab4310409189767e86b9d2f5fa6d3fa3fd6270 (diff)
test/enginetest.c: Make sure no config file is loaded
If a config file gets loaded, the tests get disturbed. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9393) (cherry picked from commit 5800ba761052894145abe7a74a1159df007b6875)
Diffstat (limited to 'test')
-rw-r--r--test/enginetest.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/enginetest.c b/test/enginetest.c
index be57f16183..a837b09c6c 100644
--- a/test/enginetest.c
+++ b/test/enginetest.c
@@ -120,8 +120,12 @@ static int test_engines(void)
display_engine_list();
/*
- * Depending on whether there's any hardware support compiled in, this
- * remove may be destined to fail.
+ * At this point, we should have an empty list, unless some hardware
+ * support engine got added. However, since we don't allow the config
+ * file to be loaded and don't otherwise load any built in engines,
+ * that is unlikely. Still, we check, if for nothing else, then to
+ * notify that something is a little off (and might mean that |new_h1|
+ * wasn't unloaded when it should have)
*/
if ((ptr = ENGINE_get_first()) != NULL) {
if (!ENGINE_remove(ptr))
@@ -346,6 +350,15 @@ static int test_redirect(void)
}
#endif
+int global_init(void)
+{
+ /*
+ * If the config file gets loaded, the dynamic engine will be loaded,
+ * and that interferes with our test above.
+ */
+ return OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL);
+}
+
int setup_tests(void)
{
#ifdef OPENSSL_NO_ENGINE