aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-10-21 10:09:51 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-10-21 10:17:18 +0100
commit937e7f8aa6bda1280abdea493583f4f959ee18e8 (patch)
tree5d88a15ed55bec94d672a6c5edca52053965ba0b
parentMerge pull request #2601 (diff)
downloadmonero-937e7f8aa6bda1280abdea493583f4f959ee18e8.tar.xz
Initialize openssl on startup
Diffstat (limited to '')
-rw-r--r--src/common/util.cpp7
-rw-r--r--tests/core_proxy/core_proxy.cpp2
-rw-r--r--tests/core_tests/chaingen_main.cpp1
-rw-r--r--tests/functional_tests/main.cpp2
-rw-r--r--tests/fuzz/fuzzer.cpp2
-rw-r--r--tests/libwallet_api_tests/main.cpp2
-rw-r--r--tests/net_load_tests/clt.cpp1
-rw-r--r--tests/net_load_tests/srv.cpp1
-rw-r--r--tests/performance_tests/main.cpp2
-rw-r--r--tests/unit_tests/main.cpp2
10 files changed, 21 insertions, 1 deletions
diff --git a/src/common/util.cpp b/src/common/util.cpp
index 30746f680..1e180d325 100644
--- a/src/common/util.cpp
+++ b/src/common/util.cpp
@@ -549,6 +549,13 @@ std::string get_nix_version_display_string()
if (!strcmp(ver, "2.25"))
MCLOG_RED(el::Level::Warning, "global", "Running with glibc " << ver << ", hangs may occur - change glibc version if possible");
#endif
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000
+ SSL_library_init();
+#else
+ OPENSSL_init_ssl(0, NULL);
+#endif
+
return true;
}
void set_strict_default_file_permissions(bool strict)
diff --git a/tests/core_proxy/core_proxy.cpp b/tests/core_proxy/core_proxy.cpp
index a0be3db96..0dc314b49 100644
--- a/tests/core_proxy/core_proxy.cpp
+++ b/tests/core_proxy/core_proxy.cpp
@@ -71,7 +71,7 @@ int main(int argc, char* argv[])
TRY_ENTRY();
-
+ tools::on_startup();
string_tools::set_module_name_and_folder(argv[0]);
//set up logging options
diff --git a/tests/core_tests/chaingen_main.cpp b/tests/core_tests/chaingen_main.cpp
index 3e5b949c8..9eba347cd 100644
--- a/tests/core_tests/chaingen_main.cpp
+++ b/tests/core_tests/chaingen_main.cpp
@@ -47,6 +47,7 @@ namespace
int main(int argc, char* argv[])
{
TRY_ENTRY();
+ tools::on_startup();
epee::string_tools::set_module_name_and_folder(argv[0]);
//set up logging options
diff --git a/tests/functional_tests/main.cpp b/tests/functional_tests/main.cpp
index 4c9e073d4..35a0bb9bd 100644
--- a/tests/functional_tests/main.cpp
+++ b/tests/functional_tests/main.cpp
@@ -34,6 +34,7 @@
using namespace epee;
#include "common/command_line.h"
+#include "common/util.h"
#include "transactions_flow_test.h"
namespace po = boost::program_options;
@@ -58,6 +59,7 @@ namespace
int main(int argc, char* argv[])
{
TRY_ENTRY();
+ tools::on_startup();
string_tools::set_module_name_and_folder(argv[0]);
//set up logging options
diff --git a/tests/fuzz/fuzzer.cpp b/tests/fuzz/fuzzer.cpp
index 3edf8cd19..756a8c847 100644
--- a/tests/fuzz/fuzzer.cpp
+++ b/tests/fuzz/fuzzer.cpp
@@ -29,6 +29,7 @@
#include <boost/program_options.hpp>
#include "include_base_utils.h"
#include "common/command_line.h"
+#include "common/util.h"
#include "fuzzer.h"
#if (!defined(__clang__) || (__clang__ < 5))
@@ -48,6 +49,7 @@ using namespace boost::program_options;
int run_fuzzer(int argc, const char **argv, Fuzzer &fuzzer)
{
TRY_ENTRY();
+ tools::on_startup();
string_tools::set_module_name_and_folder(argv[0]);
//set up logging options
diff --git a/tests/libwallet_api_tests/main.cpp b/tests/libwallet_api_tests/main.cpp
index a3cf227de..a96c1cf58 100644
--- a/tests/libwallet_api_tests/main.cpp
+++ b/tests/libwallet_api_tests/main.cpp
@@ -33,6 +33,7 @@
#include "wallet/wallet2_api.h"
#include "wallet/wallet2.h"
#include "include_base_utils.h"
+#include "common/util.h"
#include <boost/chrono/chrono.hpp>
#include <boost/filesystem.hpp>
@@ -1138,6 +1139,7 @@ TEST_F(WalletManagerMainnetTest, RecoverAndRefreshWalletMainNetAsync)
int main(int argc, char** argv)
{
+ tools::on_startup();
// we can override default values for "TESTNET_DAEMON_ADDRESS" and "WALLETS_ROOT_DIR"
const char * testnet_daemon_addr = std::getenv("TESTNET_DAEMON_ADDRESS");
diff --git a/tests/net_load_tests/clt.cpp b/tests/net_load_tests/clt.cpp
index 376d7ee53..2572d3bb7 100644
--- a/tests/net_load_tests/clt.cpp
+++ b/tests/net_load_tests/clt.cpp
@@ -627,6 +627,7 @@ TEST_F(net_load_test_clt, permament_open_and_close_and_connections_closed_by_ser
int main(int argc, char** argv)
{
+ tools::on_startup();
epee::debug::get_set_enable_assert(true, false);
//set up logging options
mlog_configure(mlog_get_default_log_path("net_load_tests_clt.log"), true);
diff --git a/tests/net_load_tests/srv.cpp b/tests/net_load_tests/srv.cpp
index e6dee1639..2829b0508 100644
--- a/tests/net_load_tests/srv.cpp
+++ b/tests/net_load_tests/srv.cpp
@@ -215,6 +215,7 @@ namespace
int main(int argc, char** argv)
{
+ tools::on_startup();
//set up logging options
mlog_configure(mlog_get_default_log_path("net_load_tests_srv.log"), true);
diff --git a/tests/performance_tests/main.cpp b/tests/performance_tests/main.cpp
index 3c0283eca..459eecba4 100644
--- a/tests/performance_tests/main.cpp
+++ b/tests/performance_tests/main.cpp
@@ -28,6 +28,7 @@
//
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
+#include "common/util.h"
#include "performance_tests.h"
#include "performance_utils.h"
@@ -48,6 +49,7 @@
int main(int argc, char** argv)
{
+ tools::on_startup();
set_process_affinity(1);
set_thread_high_priority();
diff --git a/tests/unit_tests/main.cpp b/tests/unit_tests/main.cpp
index 1706c43c9..a6d398883 100644
--- a/tests/unit_tests/main.cpp
+++ b/tests/unit_tests/main.cpp
@@ -35,6 +35,7 @@
#include "include_base_utils.h"
#include "common/command_line.h"
+#include "common/util.h"
#include "unit_tests_utils.h"
namespace po = boost::program_options;
@@ -43,6 +44,7 @@ boost::filesystem::path unit_test::data_dir;
int main(int argc, char** argv)
{
+ tools::on_startup();
epee::string_tools::set_module_name_and_folder(argv[0]);
mlog_configure(mlog_get_default_log_path("unit_tests.log"), true);
epee::debug::get_set_enable_assert(true, false);