]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3732] addressed review comments
authorRazvan Becheriu <razvan@isc.org>
Thu, 17 Apr 2025 08:47:25 +0000 (11:47 +0300)
committerRazvan Becheriu <razvan@isc.org>
Thu, 17 Apr 2025 10:36:43 +0000 (13:36 +0300)
.dummy [deleted file]
src/bin/agent/tests/meson.build
src/bin/dhcp4/tests/d2_unittest.cc
src/bin/dhcp6/tests/d2_unittest.cc
src/hooks/dhcp/mysql/tests/mysql_lease_mgr_unittest.cc
src/lib/asiolink/tests/tcp_acceptor_unittest.cc
src/lib/asiolink/tests/tls_acceptor_unittest.cc
src/lib/dhcp_ddns/tests/meson.build

diff --git a/.dummy b/.dummy
deleted file mode 100644 (file)
index e69de29..0000000
index 43b814d413d7847bb55cf537fc5d26d083db36d3..7a4376bfd00d7f4e110f9cb3449c2150af3bec2d 100644 (file)
@@ -86,6 +86,8 @@ test(
     kea_agent_tests,
     depends: [callout, basic_auth],
     protocol: 'gtest',
+    is_parallel: false,
+    priority: -1,
 )
 
 
index c6f875ea2e53854fd3e7790181cf400cb8515f36..5570e8f50fee1bee543f8f94c0012f4074b6a14d 100644 (file)
@@ -10,6 +10,7 @@
 #include <dhcp4/json_config_parser.h>
 #include <dhcp4/tests/d2_unittest.h>
 #include <dhcpsrv/cfgmgr.h>
+#include <testutils/gtest_utils.h>
 
 #include <gtest/gtest.h>
 
@@ -298,11 +299,10 @@ TEST_F(Dhcp4SrvD2Test, simpleUDPSend) {
 // invoked as expected.  Note that this unit test relies on an attempt to send
 // to a server address of 0.0.0.0 port 0 fails, which it does under all OSes
 // except Solaris 11 and macOS 15.0.
-/// @todo Eventually we should find a way to test this under Solaris.
-#if (!defined(OS_SOLARIS) && !defined(OS_OSX))
 TEST_F(Dhcp4SrvD2Test, forceUDPSendFailure) {
-#else
-TEST_F(Dhcp4SrvD2Test, DISABLED_forceUDPSendFailure) {
+#if (defined(OS_SOLARIS) || defined(OS_OSX))
+    /// @todo Eventually we should find a way to test this under Solaris.
+    SKIP_IF(true);
 #endif
     // Grab the manager and verify that be default ddns is off
     // and a sender was not started.
index c16ac1be868e4b6d3330f8bf89255172cd166e7d..9fd82743936f3754f0447663cf347982e4905381 100644 (file)
@@ -10,6 +10,7 @@
 #include <dhcp6/json_config_parser.h>
 #include <dhcp6/tests/d2_unittest.h>
 #include <dhcpsrv/cfgmgr.h>
+#include <testutils/gtest_utils.h>
 
 #include <gtest/gtest.h>
 
@@ -302,11 +303,10 @@ TEST_F(Dhcp6SrvD2Test, simpleUDPSend) {
 // invoked as expected.  Note that this unit test relies on an attempt to send
 // to a server address of 0.0.0.0 port 0 fails, which it does under all OSs
 // except Solaris 11 and macOS 15.0.
-/// @todo Eventually we should find a way to test this under Solaris.
-#if (!defined(OS_SOLARIS) && !defined(OS_OSX))
 TEST_F(Dhcp6SrvD2Test, forceUDPSendFailure) {
-#else
-TEST_F(Dhcp6SrvD2Test, DISABLED_forceUDPSendFailure) {
+#if (defined(OS_SOLARIS) || defined(OS_OSX))
+    /// @todo Eventually we should find a way to test this under Solaris.
+    SKIP_IF(true);
 #endif
     // Grab the manager and verify that be default ddns is off
     // and a sender was not started.
index ffa91a99b5cf0eb396860b3bbc913ef0c890cf63..24591475f4a80a3df5954047bf20f867f8c43b0d 100644 (file)
@@ -176,15 +176,9 @@ TEST(MySqlOpenTest, OpenDatabase) {
         MYSQL_VALID_TYPE, INVALID_NAME, VALID_HOST, VALID_USER, VALID_PASSWORD)),
         DbOpenError);
 
-#ifndef OS_OSX
-    // Under MacOS, connecting with an invalid host can cause a TCP/IP socket
-    // to be orphaned and never closed.  This can interfere with subsequent tests
-    // which attempt to locate and manipulate MySQL client socket descriptor.
-    // In the interests of progress, we'll just avoid this test.
     EXPECT_THROW(LeaseMgrFactory::create(connectionString(
         MYSQL_VALID_TYPE, VALID_NAME, INVALID_HOST, VALID_USER, VALID_PASSWORD)),
         DbOpenError);
-#endif
 
     EXPECT_THROW(LeaseMgrFactory::create(connectionString(
         MYSQL_VALID_TYPE, VALID_NAME, VALID_HOST, INVALID_USER, VALID_PASSWORD)),
index 12c9950e121b0e7f398a4295ced1aa2b3aa60250..06892035395d2ae8775d6644f2738eae907febb7 100644 (file)
@@ -5,19 +5,24 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
+
 #include <asiolink/asio_wrapper.h>
 #include <asiolink/interval_timer.h>
 #include <asiolink/io_address.h>
 #include <asiolink/io_service.h>
 #include <asiolink/tcp_acceptor.h>
 #include <asiolink/tcp_endpoint.h>
+#include <testutils/gtest_utils.h>
+
+#include <functional>
+#include <list>
+#include <string>
+
 #include <boost/noncopyable.hpp>
 #include <boost/shared_ptr.hpp>
+
 #include <gtest/gtest.h>
-#include <functional>
-#include <list>
 #include <netinet/in.h>
-#include <string>
 
 using namespace isc::asiolink;
 namespace ph = std::placeholders;
@@ -420,13 +425,12 @@ TEST_F(TCPAcceptorTest, getNative) {
     EXPECT_GE(acceptor_.getNative(), 0);
 }
 
-// macOS 10.12.3 has a bug which causes the connections to not enter
-// the TIME-WAIT state and they never get closed.
-#if !defined (OS_OSX)
 // Test that TCPAcceptor::close works properly.
 TEST_F(TCPAcceptorTest, close) {
-#else
-TEST_F(TCPAcceptorTest, DISABLED_close) {
+#if defined (OS_OSX)
+    // macOS 10.12.3 has a bug which causes the connections to not enter
+    // the TIME-WAIT state and they never get closed.
+    SKIP_IF(true);
 #endif
     // Initialize acceptor.
     acceptorOpen();
index f3b878bc9c7569dd99ccd1782c0707aa1077dfc0..d69342dbe971467f3f0e3c06382f68dfd1fc932d 100644 (file)
@@ -5,19 +5,24 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
+
 #include <asiolink/asio_wrapper.h>
 #include <asiolink/interval_timer.h>
 #include <asiolink/io_address.h>
 #include <asiolink/io_service.h>
 #include <asiolink/tcp_endpoint.h>
 #include <asiolink/tls_acceptor.h>
+#include <testutils/gtest_utils.h>
+
+#include <functional>
+#include <list>
+#include <string>
+
 #include <boost/noncopyable.hpp>
 #include <boost/shared_ptr.hpp>
+
 #include <gtest/gtest.h>
-#include <functional>
-#include <list>
 #include <netinet/in.h>
-#include <string>
 
 using namespace isc::asiolink;
 using namespace boost::asio;
@@ -426,13 +431,12 @@ TEST_F(TLSAcceptorTest, getNative) {
     EXPECT_GE(acceptor_.getNative(), 0);
 }
 
-// macOS 10.12.3 has a bug which causes the connections to not enter
-// the TIME-WAIT state and they never get closed.
-#if !defined (OS_OSX)
 // Test that TLSAcceptor::close works properly.
 TEST_F(TLSAcceptorTest, close) {
-#else
-TEST_F(TLSAcceptorTest, DISABLED_close) {
+#if defined (OS_OSX)
+    // macOS 10.12.3 has a bug which causes the connections to not enter
+    // the TIME-WAIT state and they never get closed.
+    SKIP_IF(true);
 #endif
     // Initialize acceptor.
     acceptorOpen();
index 6b3d2bf06fb2b3ffcc1e60c524346f583b830377..fa607edd769e91ecec0d2ad92c78e3b1f591988a 100644 (file)
@@ -12,4 +12,11 @@ kea_dhcp_ddns_tests = executable(
     include_directories: [include_directories('.')] + INCLUDES,
     link_with: [kea_testutils_lib, kea_util_unittests_lib] + LIBS_BUILT_SO_FAR,
 )
-test('kea-dhcp-ddns-tests', kea_dhcp_ddns_tests, protocol: 'gtest')
+test(
+    'kea-dhcp-ddns-tests',
+    kea_dhcp_ddns_tests,
+    protocol: 'gtest',
+    is_parallel: false,
+    priority: -1,
+    timeout: 60,
+)