]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3969] Adapt existing tests
authorAndrei Pavel <andrei@isc.org>
Mon, 3 Nov 2025 09:52:08 +0000 (11:52 +0200)
committerAndrei Pavel <andrei@isc.org>
Wed, 5 Nov 2025 13:01:01 +0000 (15:01 +0200)
src/bin/netconf/tests/control_socket_unittests.cc
src/bin/netconf/tests/netconf_controller_unittests.cc
src/bin/netconf/tests/netconf_unittests.cc

index d66dce3f8a245e048b84444d61a654c939e7e11d..0d11611a3347f88c770eb8a2f0cfaca3dc0d4d60 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -9,6 +9,7 @@
 #include <asiolink/asio_wrapper.h>
 #include <asiolink/interval_timer.h>
 #include <asiolink/io_service.h>
+#include <config/unix_command_config.h>
 #include <http/listener.h>
 #include <http/post_request_json.h>
 #include <http/response_creator.h>
@@ -19,7 +20,6 @@
 #include <netconf/netconf_config.h>
 #include <netconf/stdout_control_socket.h>
 #include <netconf/unix_control_socket.h>
-#include <testutils/sandbox.h>
 #include <testutils/threaded_test.h>
 #include <yang/tests/sysrepo_setup.h>
 
@@ -33,6 +33,7 @@ using namespace std;
 using namespace isc;
 using namespace isc::netconf;
 using namespace isc::asiolink;
+using namespace isc::config;
 using namespace isc::data;
 using namespace isc::http;
 using namespace isc::http::test;
@@ -140,8 +141,6 @@ const long TEST_TIMEOUT = 1500;
 /// @brief Test fixture class for unix control sockets.
 class UnixControlSocketTest : public ThreadedTest {
 public:
-    isc::test::Sandbox sandbox;
-
     /// @brief Constructor.
     UnixControlSocketTest()
         : ThreadedTest(), io_service_(new IOService()) {
@@ -172,7 +171,7 @@ public:
         if (env) {
             socket_path = string(env) + "/test-socket";
         } else {
-            socket_path = sandbox.join("test-socket");
+            socket_path = UnixCommandConfig::getSocketPath() + "/test-socket";
         }
         return (socket_path);
     }
index 457dc8b6bad43986561a6a5b137c79bfc97aed6d..f12f4de5f1a4c0010fdd944c01efc2d1ff8e0ff2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -33,13 +33,13 @@ const char* valid_netconf_config =
     "    \"dhcp4\": {"
     "      \"control-socket\": {"
     "        \"socket-type\": \"unix\","
-    "        \"socket-name\": \"/first/dhcp4/socket\""
+    "        \"socket-name\": \"dhcp4-socket\""
     "      }"
     "    },"
     "    \"dhcp6\": {"
     "      \"control-socket\": {"
     "        \"socket-type\": \"unix\","
-    "        \"socket-name\": \"/first/dhcp6/socket\""
+    "        \"socket-name\": \"dhcp6-socket\""
     "      }"
     "    }"
     "  }"
index 822cb7b0f816115a8cef4a23fc23941ffc65c555..55ac3fa2c2de83b6db8587cb2153f17738d1018c 100644 (file)
 #include <asiolink/interval_timer.h>
 #include <asiolink/io_service.h>
 #include <cc/command_interpreter.h>
+#include <config/unix_command_config.h>
 #include <netconf/netconf.h>
 #include <netconf/netconf_process.h>
 #include <netconf/parser_context.h>
 #include <netconf/simple_parser.h>
 #include <netconf/unix_control_socket.h>
 #include <testutils/log_utils.h>
-#include <testutils/sandbox.h>
 #include <testutils/threaded_test.h>
 #include <yang/tests/sysrepo_setup.h>
 #include <yang/testutils/translator_test.h>
@@ -107,8 +107,6 @@ ElementPtr sortSubnets(ElementPtr const& map) {
 /// @brief Test fixture class for netconf agent.
 class NetconfAgentTest : public ThreadedTest {
 public:
-    isc::test::Sandbox sandbox;
-
     void SetUp() override {
         SysrepoSetup::cleanSharedMemory();
         removeUnixSocketFile();
@@ -144,7 +142,7 @@ public:
         if (env) {
             socket_path = string(env) + "/" + TEST_SOCKET;
         } else {
-            socket_path = sandbox.join(TEST_SOCKET);
+            socket_path = UnixCommandConfig::getSocketPath() + "/" + TEST_SOCKET;
         }
         return (socket_path);
     }