AC_CONFIG_FILES([src/bin/netconf/tests/shtests/Makefile])
AC_CONFIG_FILES([src/bin/netconf/tests/shtests/netconf_tests.sh],
[chmod +x src/bin/netconf/tests/shtests/netconf_tests.sh])
-AC_CONFIG_FILES([src/bin/netconf/tests/test_data_files_config.h])
-AC_CONFIG_FILES([src/bin/netconf/tests/test_libraries.h])
AC_CONFIG_FILES([src/bin/perfdhcp/Makefile])
AC_CONFIG_FILES([src/bin/perfdhcp/tests/Makefile])
AC_CONFIG_FILES([src/bin/perfdhcp/tests/testdata/Makefile])
if have_premium
subdir('premium')
endif
+
+install_emptydir('var/run/kea')
#!/bin/sh
-# Copyright (C) 2016-2024 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2016-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
-// Copyright (C) 2020 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2020-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
-// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-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
#!/bin/sh
-# Copyright (C) 2014-2024 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2014-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
-// Copyright (C) 2021 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2021-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
-// Copyright (C) 2021 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2021-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
#!/bin/sh
-# Copyright (C) 2014-2024 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2014-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
#!/bin/sh
-# Copyright (C) 2014-2024 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2014-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
-// Copyright (C) 2013-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-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
subdir('keactrl')
subdir('perfdhcp')
subdir('shell')
-# subdir('netconf')
+subdir('netconf')
-// 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
/// @param ctrl_sock The control socket configuration.
/// @return A pointer to a control socket communication object.
/// @throw NotImplemented if no specialization was called.
-template <CfgControlSocket::Type TYPE> ControlSocketBasePtr
+template <CfgControlSocket::Type TYPE>
+ControlSocketBasePtr
createControlSocket(CfgControlSocketPtr ctrl_sock) {
isc_throw(NotImplemented, "not specialized createControlSocket");
}
endif
netconf_lib = static_library(
+ 'netconf',
'control_socket.cc',
'http_control_socket.cc',
'netconf.cc',
'simple_parser.cc',
'stdout_control_socket.cc',
'unix_control_socket.cc',
+ dependencies: NETCONF_DEPS_ARRAY + [crypto],
include_directories: [include_directories('.')] + INCLUDES,
+ link_with: [kea_yang_testutils_lib, kea_process_testutils_lib] + LIBS_BUILT_SO_FAR,
override_options: ['cpp_std=c++20'],
)
executable(
'kea-netconf',
'main.cc',
+ dependencies: NETCONF_DEPS_ARRAY + [crypto],
include_directories: [include_directories('.')] + INCLUDES,
install: true,
install_dir: 'sbin',
link_with: [netconf_lib] + LIBS_BUILT_SO_FAR,
override_options: ['cpp_std=c++20'],
)
+
+subdir('tests')
/netconf_tests.sh
netconf_unittests
-test_data_files_config.h
-test_libraries.h
AM_CPPFLAGS += -DCFG_EXAMPLES=\"$(abs_top_srcdir)/doc/examples/netconf\"
AM_CPPFLAGS += -DKEATEST_MODULE
AM_CPPFLAGS += -DSYNTAX_FILE=\"$(abs_srcdir)/../netconf_parser.yy\"
+AM_CPPFLAGS += -DTEST_DATA_SOURCEDIR=\"$(abs_top_srcdir)/src/bin/netconf/tests\"
AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/bin/netconf/tests\"
+AM_CPPFLAGS += -DBASIC_CALLOUT_LIBRARY=\"$(abs_top_builddir)/src/bin/netconf/tests/.libs/libbasic.so\"
AM_CPPFLAGS += $(BOOST_INCLUDES) $(CRYPTO_CFLAGS) $(CRYPTO_INCLUDES)
AM_CPPFLAGS += $(LIBYANG_CPPFLAGS)
AM_CPPFLAGS += $(LIBYANG_INCLUDEDIR)
CLEANFILES = *.json *.log
-DISTCLEANFILES = test_data_files_config.h test_libraries.h
-
AM_CXXFLAGS = $(KEA_CXXFLAGS)
if USE_STATIC_LINK
libbasic_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libbasic_la_LDFLAGS = -avoid-version -export-dynamic -module -rpath /nowhere
-nodist_netconf_unittests_SOURCES = test_data_files_config.h test_libraries.h
endif
noinst_EXTRA_DIST = configs-list.txt
-// 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
#include <gtest/gtest.h>
-#include "test_data_files_config.h"
-#include "test_libraries.h"
-
using namespace isc::netconf;
using namespace isc::config;
using namespace isc::data;
ASSERT_NO_THROW_LOG(config = readFile(simple_file));
// get the expected configuration
- string expected_file =
- string(NETCONF_TEST_DATA_DIR) + "/" + "get_config.json";
+ string const expected_file(string(TEST_DATA_SOURCEDIR) + "/testdata/get_config.json");
string expected;
ASSERT_NO_THROW_LOG(expected = readFile(expected_file));
subdir_done()
endif
+current_build_dir = meson.current_build_dir()
+current_source_dir = meson.current_source_dir()
+
kea_netconf_tests = executable(
'kea-netconf-tests',
'basic_library.cc',
'netconf_unittests.cc',
'parser_unittests.cc',
'run_unittests.cc',
- dependencies: NETCONF_DEPS_ARRAY + [gtest],
+ cpp_args: [
+ f'-DBASIC_CALLOUT_LIBRARY="@current_build_dir@/libbasic.so"',
+ f'-DCFG_EXAMPLES="@TOP_SOURCE_DIR@/doc/examples/netconf"',
+ '-DKEATEST_MODULE',
+ f'-DSYNTAX_FILE="@current_source_dir@/../netconf_parser.yy"',
+ f'-DTEST_DATA_SOURCEDIR="@current_source_dir@"',
+ f'-DTEST_DATA_BUILDDIR="@current_build_dir@"',
+ ],
+ dependencies: NETCONF_DEPS_ARRAY + [gtest, crypto],
include_directories: [include_directories('.')] + INCLUDES,
- link_with: [kea_yang_tests_lib] + LIBS_BUILT_SO_FAR,
+ link_with: [
+ netconf_lib,
+ kea_yang_testutils_lib,
+ kea_process_testutils_lib,
+ kea_testutils_lib,
+ ] + LIBS_BUILT_SO_FAR,
override_options: ['cpp_std=c++20'],
)
test('kea-netconf-tests', kea_netconf_tests, protocol: 'gtest')
+
+shared_library(
+ 'basic',
+ 'basic_library.cc',
+ include_directories: [include_directories('.')] + INCLUDES,
+ link_with: LIBS_BUILT_SO_FAR,
+ build_rpath: '/nowhere',
+ name_suffix: 'so',
+)
-// 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
#include <exceptions/exceptions.h>
#include <netconf/netconf_cfg_mgr.h>
#include <netconf/parser_context.h>
-#include <netconf/tests/test_libraries.h>
#include <process/d_cfg_mgr.h>
#include <process/testutils/d_test_stubs.h>
#include <testutils/gtest_utils.h>
+++ /dev/null
-// Copyright (C) 2018 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
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-/// @brief Path to netconf source dir
-#define NETCONF_SRC_DIR "@abs_top_srcdir@/src/bin/netconf"
-#define NETCONF_TEST_DATA_DIR "@abs_top_srcdir@/src/bin/netconf/tests/testdata"
+++ /dev/null
-// Copyright (C) 2018-2022 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
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-#ifndef AGENT_TEST_LIBRARIES_H
-#define AGENT_TEST_LIBRARIES_H
-
-#include <config.h>
-
-namespace {
-
-// Names of the libraries used in these tests. These libraries are built using
-// libtool, so we need to look in the hidden ".libs" directory to locate the
-// .so file. Note that we access the .so file - libtool creates this as a
-// like to the real shared library.
-
-// Basic library with context_create and three "standard" callouts.
-static const char* BASIC_CALLOUT_LIBRARY = "@abs_builddir@/.libs/libbasic.so";
-
-} // anonymous namespace
-
-#endif // TEST_LIBRARIES_H