From e6565d4e2c906efc6554569b12d30cd580363a89 Mon Sep 17 00:00:00 2001 From: Andrei Pavel Date: Mon, 3 Nov 2025 11:52:08 +0200 Subject: [PATCH] [#3969] Adapt existing tests --- src/bin/netconf/tests/control_socket_unittests.cc | 9 ++++----- src/bin/netconf/tests/netconf_controller_unittests.cc | 6 +++--- src/bin/netconf/tests/netconf_unittests.cc | 6 ++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/bin/netconf/tests/control_socket_unittests.cc b/src/bin/netconf/tests/control_socket_unittests.cc index d66dce3f8a..0d11611a33 100644 --- a/src/bin/netconf/tests/control_socket_unittests.cc +++ b/src/bin/netconf/tests/control_socket_unittests.cc @@ -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 #include #include +#include #include #include #include @@ -19,7 +20,6 @@ #include #include #include -#include #include #include @@ -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); } diff --git a/src/bin/netconf/tests/netconf_controller_unittests.cc b/src/bin/netconf/tests/netconf_controller_unittests.cc index 457dc8b6ba..f12f4de5f1 100644 --- a/src/bin/netconf/tests/netconf_controller_unittests.cc +++ b/src/bin/netconf/tests/netconf_controller_unittests.cc @@ -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\"" " }" " }" " }" diff --git a/src/bin/netconf/tests/netconf_unittests.cc b/src/bin/netconf/tests/netconf_unittests.cc index 822cb7b0f8..55ac3fa2c2 100644 --- a/src/bin/netconf/tests/netconf_unittests.cc +++ b/src/bin/netconf/tests/netconf_unittests.cc @@ -10,13 +10,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include #include @@ -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); } -- 2.47.3