MCPcopy Create free account
hub / github.com/apache/thrift / GlobalFixtureSSL

Method GlobalFixtureSSL

lib/cpp/test/TSSLSocketInterruptTest.cpp:54–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52struct GlobalFixtureSSL
53{
54 GlobalFixtureSSL()
55 {
56 using namespace boost::unit_test::framework;
57 for (int i = 0; i < master_test_suite().argc; ++i)
58 {
59 BOOST_TEST_MESSAGE(boost::format("argv[%1%] = \"%2%\"") % i % master_test_suite().argv[i]);
60 }
61
62#ifdef __linux__
63 // OpenSSL calls send() without MSG_NOSIGPIPE so writing to a socket that has
64 // disconnected can cause a SIGPIPE signal...
65 signal(SIGPIPE, SIG_IGN);
66#endif
67
68 TSSLSocketFactory::setManualOpenSSLInitialization(true);
69 apache::thrift::transport::initializeOpenSSL();
70
71 keyDir = boost::filesystem::current_path().parent_path().parent_path().parent_path() / "test" / "keys";
72 if (!boost::filesystem::exists(certFile("server.crt")))
73 {
74 keyDir = boost::filesystem::path(master_test_suite().argv[master_test_suite().argc - 1]);
75 if (!boost::filesystem::exists(certFile("server.crt")))
76 {
77 throw std::invalid_argument("The last argument to this test must be the directory containing the test certificate(s).");
78 }
79 }
80 }
81
82 virtual ~GlobalFixtureSSL()
83 {

Callers

nothing calls this directly

Calls 2

initializeOpenSSLFunction · 0.85
certFileFunction · 0.70

Tested by

no test coverage detected