diff options
author | Håvard Pettersen <havardpe@oath.com> | 2019-01-17 13:58:49 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2019-01-25 12:36:05 +0000 |
commit | 2ec8f7e3540b5dd4a5521b2f92c47de64ed01869 (patch) | |
tree | ea6d69d65ea79c2cc23c1f29cf91f8890a62dcc4 /vbench/src/tests/http_connection_pool/http_connection_pool_test.cpp | |
parent | 02d24b5d24d8c3c3e97dbca86357881a5282601c (diff) |
TLS support in vbench
- vbench/dumpurl applications explicitly run without encryption for
now (config file/command line options should be added).
- configstatus tool uses default encryption which will pick up local
settings via environment where applicable.
Diffstat (limited to 'vbench/src/tests/http_connection_pool/http_connection_pool_test.cpp')
-rw-r--r-- | vbench/src/tests/http_connection_pool/http_connection_pool_test.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/vbench/src/tests/http_connection_pool/http_connection_pool_test.cpp b/vbench/src/tests/http_connection_pool/http_connection_pool_test.cpp index 1c36cb6891f..c0c5982d22b 100644 --- a/vbench/src/tests/http_connection_pool/http_connection_pool_test.cpp +++ b/vbench/src/tests/http_connection_pool/http_connection_pool_test.cpp @@ -2,17 +2,20 @@ #include <vespa/vespalib/testkit/testapp.h> #include <vbench/test/all.h> #include <vespa/vespalib/util/sync.h> +#include <vespa/vespalib/net/crypto_engine.h> using namespace vbench; using vespalib::CountDownLatch; +auto null_crypto = std::make_shared<vespalib::NullCryptoEngine>(); + TEST_MT_F("http connection pool", 2, ServerSocket()) { if (thread_id == 0) { - for (; f1.accept().get() != 0; ) {} + for (; f1.accept(*null_crypto).get() != 0; ) {} } else { Timer timer; HttpConnection::UP conn; - HttpConnectionPool pool(timer); + HttpConnectionPool pool(null_crypto, timer); conn = pool.getConnection(ServerSpec("localhost", f1.port())); EXPECT_TRUE(conn.get() != 0); pool.putConnection(std::move(conn)); @@ -28,11 +31,11 @@ TEST_MT_F("http connection pool", 2, ServerSocket()) { } } -TEST_MT_FFFF("stress http connection pool", 256, ServerSocket(), Timer(), HttpConnectionPool(f2), +TEST_MT_FFFF("stress http connection pool", 256, ServerSocket(), Timer(), HttpConnectionPool(null_crypto, f2), CountDownLatch(num_threads-2)) { if (thread_id == 0) { - for (; f1.accept().get() != 0; ) {} + for (; f1.accept(*null_crypto).get() != 0; ) {} } else { while (f2.sample() < 5.0) { HttpConnection::UP conn = f3.getConnection(ServerSpec("localhost", f1.port())); |