From: Francis Dupont Date: Tue, 23 Mar 2021 14:14:30 +0000 (+0100) Subject: [#1661] Checkpoint: addressing comments X-Git-Tag: Kea-1.9.6~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd752c39a2677a48e813fdef9a5ab730df896e38;p=thirdparty%2Fkea.git [#1661] Checkpoint: addressing comments --- diff --git a/src/lib/http/tests/server_client_unittests.cc b/src/lib/http/tests/server_client_unittests.cc index c859258a2c..9e1e092772 100644 --- a/src/lib/http/tests/server_client_unittests.cc +++ b/src/lib/http/tests/server_client_unittests.cc @@ -227,19 +227,10 @@ protected: /// This method is virtual so as it can be overridden when customized /// connections are to be used, e.g. in case of unit testing. /// - /// @param io_service IO service to be used by the connection. - /// @param acceptor Pointer to the TCP acceptor object used to listen for - /// new HTTP connections. - /// @param tls_context TLS context. - /// @param connection_pool Connection pool in which this connection is - /// stored. /// @param response_creator Pointer to the response creator object used to /// create HTTP response from the HTTP request received. /// @param acceptor_callback Callback invoked when new connection is accepted. /// @param handshake_callback Callback invoked when TLS handshake is performed. - /// @param request_timeout Configured timeout for a HTTP request. - /// @param idle_timeout Timeout after which persistent HTTP connection is - /// closed by the server. /// /// @return Pointer to the created connection. virtual HttpConnectionPtr createConnection(const HttpResponseCreatorPtr& response_creator, diff --git a/src/lib/http/tests/tls_client_unittests.cc b/src/lib/http/tests/tls_client_unittests.cc index e6775d5c10..ab21dd1ba8 100644 --- a/src/lib/http/tests/tls_client_unittests.cc +++ b/src/lib/http/tests/tls_client_unittests.cc @@ -1137,22 +1137,22 @@ public: TlsContextPtr client_context_; }; +#ifndef DISABLE_SOME_TESTS // Test that two consecutive requests can be sent over the same (persistent) // connection. TEST_F(HttpsClientTest, consecutiveRequests) { -#ifndef DISABLE_SOME_TESTS + ASSERT_NO_FATAL_FAILURE(testConsecutiveRequests(HttpVersion(1, 1))); -#endif } // Test that two consecutive requests can be sent over the same (persistent) // connection. TEST_F(HttpsClientTest, consecutiveRequestsMultiThreading) { MultiThreadingMgr::instance().setMode(true); -#ifndef DISABLE_SOME_TESTS + ASSERT_NO_FATAL_FAILURE(testConsecutiveRequests(HttpVersion(1, 1))); -#endif } +#endif // Test that two consecutive requests can be sent over non-persistent connection. // This is achieved by sending HTTP/1.0 requests, which are non-persistent by @@ -1249,13 +1249,13 @@ TEST_F(HttpsClientTest, DISABLED_clientRequestLateStartNoQueueMultiThreading) { testClientRequestLateStart(false); } +#ifndef DISABLE_SOME_TESTS // This test verifies the behavior of the HTTP client when the premature // timeout occurs and there are requests queued after the request which // times out. TEST_F(HttpsClientTest, clientRequestLateStartQueue) { -#ifndef DISABLE_SOME_TESTS + testClientRequestLateStart(true); -#endif } // This test verifies the behavior of the HTTP client when the premature @@ -1263,10 +1263,9 @@ TEST_F(HttpsClientTest, clientRequestLateStartQueue) { // times out. TEST_F(HttpsClientTest, clientRequestLateStartQueueMultiThreading) { MultiThreadingMgr::instance().setMode(true); -#ifndef DISABLE_SOME_TESTS testClientRequestLateStart(true); -#endif } +#endif // Test that client times out when connection takes too long. TEST_F(HttpsClientTest, clientConnectTimeout) { @@ -1279,20 +1278,18 @@ TEST_F(HttpsClientTest, clientConnectTimeoutMultiThreading) { ASSERT_NO_FATAL_FAILURE(testClientConnectTimeout()); } +#ifndef DISABLE_SOME_TESTS /// Tests that connect and close callbacks work correctly. TEST_F(HttpsClientTest, connectCloseCallbacks) { -#ifndef DISABLE_SOME_TESTS ASSERT_NO_FATAL_FAILURE(testConnectCloseCallbacks(HttpVersion(1, 1))); -#endif } /// Tests that connect and close callbacks work correctly. TEST_F(HttpsClientTest, connectCloseCallbacksMultiThreading) { MultiThreadingMgr::instance().setMode(true); -#ifndef DISABLE_SOME_TESTS ASSERT_NO_FATAL_FAILURE(testConnectCloseCallbacks(HttpVersion(1, 1))); -#endif } +#endif /// Tests that HttpClient::closeIfOutOfBand works correctly. TEST_F(HttpsClientTest, closeIfOutOfBand) { diff --git a/src/lib/http/tests/tls_server_unittests.cc b/src/lib/http/tests/tls_server_unittests.cc index 44ecf081fb..c92127f2d3 100644 --- a/src/lib/http/tests/tls_server_unittests.cc +++ b/src/lib/http/tests/tls_server_unittests.cc @@ -231,19 +231,10 @@ protected: /// This method is virtual so as it can be overridden when customized /// connections are to be used, e.g. in case of unit testing. /// - /// @param io_service IO service to be used by the connection. - /// @param acceptor Pointer to the TCP acceptor object used to listen for - /// new HTTP connections. - /// @param tls_context TLS context. - /// @param connection_pool Connection pool in which this connection is - /// stored. /// @param response_creator Pointer to the response creator object used to /// create HTTP response from the HTTP request received. /// @param acceptor_callback Callback invoked when new connection is accepted. /// @param handshake_callback Callback invoked when TLS handshake is performed. - /// @param request_timeout Configured timeout for a HTTP request. - /// @param idle_timeout Timeout after which persistent HTTP connection is - /// closed by the server. /// /// @return Pointer to the created connection. virtual HttpConnectionPtr createConnection(const HttpResponseCreatorPtr& response_creator,