]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2095] removed dependency on src/bin/d2
authorRazvan Becheriu <razvan@isc.org>
Mon, 4 Oct 2021 17:12:47 +0000 (20:12 +0300)
committerRazvan Becheriu <razvan@isc.org>
Mon, 4 Oct 2021 17:12:47 +0000 (20:12 +0300)
34 files changed:
configure.ac
src/bin/d2/Makefile.am
src/bin/d2/d2_update_mgr.h
src/bin/d2/nc_add.h
src/bin/d2/nc_remove.h
src/bin/d2/simple_add.h
src/bin/d2/simple_remove.h
src/bin/d2/tests/Makefile.am
src/bin/d2/tests/d2_controller_unittests.cc
src/bin/d2/tests/d2_process_unittests.cc
src/bin/d2/tests/d2_update_mgr_unittests.cc
src/bin/d2/tests/nc_add_unittests.cc
src/bin/d2/tests/nc_remove_unittests.cc
src/bin/d2/tests/simple_add_unittests.cc
src/bin/d2/tests/simple_remove_unittests.cc
src/lib/d2srv/Makefile.am
src/lib/d2srv/d2_update_message.cc [moved from src/bin/d2/d2_update_message.cc with 99% similarity]
src/lib/d2srv/d2_update_message.h [moved from src/bin/d2/d2_update_message.h with 99% similarity]
src/lib/d2srv/d2_zone.cc [moved from src/bin/d2/d2_zone.cc with 96% similarity]
src/lib/d2srv/d2_zone.h [moved from src/bin/d2/d2_zone.h with 100% similarity]
src/lib/d2srv/dns_client.cc [moved from src/bin/d2/dns_client.cc with 99% similarity]
src/lib/d2srv/dns_client.h [moved from src/bin/d2/dns_client.h with 99% similarity]
src/lib/d2srv/nc_trans.cc [moved from src/bin/d2/nc_trans.cc with 99% similarity]
src/lib/d2srv/nc_trans.h [moved from src/bin/d2/nc_trans.h with 99% similarity]
src/lib/d2srv/tests/Makefile.am
src/lib/d2srv/tests/d2_update_message_unittests.cc [moved from src/bin/d2/tests/d2_update_message_unittests.cc with 99% similarity]
src/lib/d2srv/tests/d2_zone_unittests.cc [moved from src/bin/d2/tests/d2_zone_unittests.cc with 99% similarity]
src/lib/d2srv/tests/dns_client_unittests.cc [moved from src/bin/d2/tests/dns_client_unittests.cc with 99% similarity]
src/lib/d2srv/tests/nc_trans_unittests.cc [moved from src/bin/d2/tests/nc_trans_unittests.cc with 99% similarity]
src/lib/d2srv/testutils/Makefile.am [new file with mode: 0644]
src/lib/d2srv/testutils/nc_test_utils.cc [moved from src/bin/d2/tests/nc_test_utils.cc with 99% similarity]
src/lib/d2srv/testutils/nc_test_utils.h [moved from src/bin/d2/tests/nc_test_utils.h with 99% similarity]
src/lib/d2srv/testutils/stats_test_utils.cc [moved from src/bin/d2/tests/stats_test_utils.cc with 96% similarity]
src/lib/d2srv/testutils/stats_test_utils.h [moved from src/bin/d2/tests/stats_test_utils.h with 100% similarity]

index 7feae351807182b949f1ce92af471c3eeae7a3dc..186fa27fbace865d21a29444c023c710fd80ac70 100644 (file)
@@ -1660,6 +1660,7 @@ AC_CONFIG_FILES([src/lib/config_backend/tests/Makefile])
 AC_CONFIG_FILES([src/lib/cryptolink/Makefile])
 AC_CONFIG_FILES([src/lib/cryptolink/tests/Makefile])
 AC_CONFIG_FILES([src/lib/d2srv/Makefile])
+AC_CONFIG_FILES([src/lib/d2srv/testutils/Makefile])
 AC_CONFIG_FILES([src/lib/d2srv/tests/Makefile])
 AC_CONFIG_FILES([src/lib/database/Makefile])
 AC_CONFIG_FILES([src/lib/database/tests/Makefile])
index 9a716e42e483398b203d0b534689741285b2673f..53282977f71c8aea2ddb086d3b1609dfb3d7c1a1 100644 (file)
@@ -33,13 +33,9 @@ libd2_la_SOURCES += d2_process.cc d2_process.h
 libd2_la_SOURCES += d2_lexer.ll location.hh
 libd2_la_SOURCES += d2_parser.cc d2_parser.h
 libd2_la_SOURCES += d2_queue_mgr.cc d2_queue_mgr.h
-libd2_la_SOURCES += d2_update_message.cc d2_update_message.h
 libd2_la_SOURCES += d2_update_mgr.cc d2_update_mgr.h
-libd2_la_SOURCES += d2_zone.cc d2_zone.h
-libd2_la_SOURCES += dns_client.cc dns_client.h
 libd2_la_SOURCES += nc_add.cc nc_add.h
 libd2_la_SOURCES += nc_remove.cc nc_remove.h
-libd2_la_SOURCES += nc_trans.cc nc_trans.h
 libd2_la_SOURCES += d2_controller.cc d2_controller.h
 libd2_la_SOURCES += parser_context.cc parser_context.h parser_context_decl.h
 libd2_la_SOURCES += simple_add.cc simple_add.h
index 2ff8765bcd339cde76b2ff42a20e6d3ca54d8f1d..593cfd1167a0600bf75a408ee9a2df67e3169b10 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <asiolink/io_service.h>
 #include <d2/d2_queue_mgr.h>
-#include <d2/nc_trans.h>
+#include <d2srv/nc_trans.h>
 #include <d2srv/d2_cfg_mgr.h>
 #include <d2srv/d2_log.h>
 #include <exceptions/exceptions.h>
index 0f9929abd12c9e0c3ec5eccb8e04b305f84a9a6e..15f31a4e2b3bef553d6cb8d3b06ea68f23b8bff0 100644 (file)
@@ -9,7 +9,7 @@
 
 /// @file nc_add.h This file defines the class NameAddTransaction.
 
-#include <d2/nc_trans.h>
+#include <d2srv/nc_trans.h>
 #include <dns/rdata.h>
 
 namespace isc {
index 1584cb0025d6131100ad26ec3b62c0aa19129251..f098680d9530b292f619fcfccf9ca45a9098619b 100644 (file)
@@ -9,7 +9,7 @@
 
 /// @file nc_remove.h This file defines the class NameRemoveTransaction.
 
-#include <d2/nc_trans.h>
+#include <d2srv/nc_trans.h>
 
 namespace isc {
 namespace d2 {
index 7bf7b6c605472d73c43f4df004f74b2adec58960..43a5d678a2abcc55d663ce0716453ba61bd79b13 100644 (file)
@@ -9,7 +9,7 @@
 
 /// @file nc_add.h This file defines the class SimpleAddTransaction.
 
-#include <d2/nc_trans.h>
+#include <d2srv/nc_trans.h>
 #include <dns/rdata.h>
 
 namespace isc {
index ce6d52514556a96878e4bded96e06b16201644b6..58bf1ef171d7d560d31e62ff8a70c8d414335e1b 100644 (file)
@@ -9,7 +9,7 @@
 
 /// @file nc_remove.h This file defines the class SimpleRemoveTransaction.
 
-#include <d2/nc_trans.h>
+#include <d2srv/nc_trans.h>
 
 namespace isc {
 namespace d2 {
index 820c4900c470ba783817d7604d53e4be7a5b5146..0c20c437cd0dbe651bf0fa01a0ed375f9a270344 100644 (file)
@@ -45,14 +45,9 @@ d2_unittests_SOURCES  = d2_unittests.cc
 d2_unittests_SOURCES += d2_process_unittests.cc
 d2_unittests_SOURCES += d2_cfg_mgr_unittests.cc
 d2_unittests_SOURCES += d2_queue_mgr_unittests.cc
-d2_unittests_SOURCES += d2_update_message_unittests.cc
 d2_unittests_SOURCES += d2_update_mgr_unittests.cc
-d2_unittests_SOURCES += d2_zone_unittests.cc
-d2_unittests_SOURCES += dns_client_unittests.cc
 d2_unittests_SOURCES += nc_add_unittests.cc
 d2_unittests_SOURCES += nc_remove_unittests.cc
-d2_unittests_SOURCES += nc_test_utils.cc nc_test_utils.h
-d2_unittests_SOURCES += nc_trans_unittests.cc
 d2_unittests_SOURCES += d2_controller_unittests.cc
 d2_unittests_SOURCES += d2_simple_parser_unittest.cc
 d2_unittests_SOURCES += parser_unittest.cc parser_unittest.h
@@ -60,7 +55,6 @@ d2_unittests_SOURCES += get_config_unittest.cc
 d2_unittests_SOURCES += d2_command_unittest.cc
 d2_unittests_SOURCES += simple_add_unittests.cc
 d2_unittests_SOURCES += simple_remove_unittests.cc
-d2_unittests_SOURCES += stats_test_utils.cc stats_test_utils.h
 
 d2_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
 d2_unittests_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS)
@@ -75,7 +69,8 @@ d2_unittests_LDFLAGS += $(CQL_LIBS)
 endif
 d2_unittests_LDFLAGS += $(GTEST_LDFLAGS)
 
-d2_unittests_LDADD = $(top_builddir)/src/bin/d2/libd2.la
+d2_unittests_LDADD  = $(top_builddir)/src/bin/d2/libd2.la
+d2_unittests_LDADD += $(top_builddir)/src/lib/d2srv/testutils/libd2srvtest.la
 d2_unittests_LDADD += $(top_builddir)/src/lib/d2srv/libkea-d2srv.la
 d2_unittests_LDADD += $(top_builddir)/src/lib/process/testutils/libprocesstest.la
 d2_unittests_LDADD += $(top_builddir)/src/lib/cfgrpt/libcfgrpt.la
index 2a4a7dd73822dc913fa2c160199f379ba2e02474..0c6e5ecf90aab1002d2388fcfc07d1f9d72d9abc 100644 (file)
@@ -8,9 +8,9 @@
 
 #include <asiolink/testutils/timed_signal.h>
 #include <cc/command_interpreter.h>
+#include <d2srv/testutils/nc_test_utils.h>
 #include <d2/d2_controller.h>
 #include <d2/d2_process.h>
-#include <d2/tests/nc_test_utils.h>
 #include <process/testutils/d_test_stubs.h>
 
 #include <boost/pointer_cast.hpp>
index 992c533fb669e91ff8f6aba4ecca14f29c69d432..4dda27551d0e02e71c10ca24a7764bc980d4ef0d 100644 (file)
@@ -8,11 +8,11 @@
 
 #include <asiolink/io_service.h>
 #include <cc/command_interpreter.h>
+#include <d2srv/testutils/nc_test_utils.h>
 #include <d2/d2_process.h>
+#include <d2/tests/test_configured_libraries.h>
 #include <dhcp_ddns/ncr_io.h>
 #include <process/testutils/d_test_stubs.h>
-#include <d2/tests/nc_test_utils.h>
-#include <d2/tests/test_configured_libraries.h>
 
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <gtest/gtest.h>
index a89de3e27369c5f0d95336e27dc385848634e366..ce2bb3e90257b6bcd334c382f989083061368254 100644 (file)
@@ -7,8 +7,8 @@
 #include <config.h>
 
 #include <asiolink/io_service.h>
+#include <d2srv/testutils/nc_test_utils.h>
 #include <d2/d2_update_mgr.h>
-#include <nc_test_utils.h>
 #include <d2/nc_add.h>
 #include <d2/nc_remove.h>
 #include <d2/simple_add.h>
index 0ef94ddf6b6786672a58280ff15bb9472823dd91..ec8351aed2565fa81ed6b0aef1363719d200fbe4 100644 (file)
@@ -9,8 +9,8 @@
 #include <asiolink/io_service.h>
 #include <d2/nc_add.h>
 #include <d2srv/d2_cfg_mgr.h>
+#include <d2srv/testutils/nc_test_utils.h>
 #include <dns/messagerenderer.h>
-#include <nc_test_utils.h>
 
 #include <gtest/gtest.h>
 
index d335e101a5ba72caf65c4587967734a812507214..3889c7cbab72c134e64add83aa29730f19825395 100644 (file)
@@ -9,8 +9,8 @@
 #include <asiolink/io_service.h>
 #include <d2/nc_remove.h>
 #include <d2srv/d2_cfg_mgr.h>
+#include <d2srv/testutils/nc_test_utils.h>
 #include <dns/messagerenderer.h>
-#include <nc_test_utils.h>
 
 #include <gtest/gtest.h>
 
index 5d8f4d56530cbeefe79b021ff2481c2cf72ca92e..54bc7fabe5288928d428b9e3d0d902c04e2f46e6 100644 (file)
@@ -9,8 +9,8 @@
 #include <asiolink/io_service.h>
 #include <d2/simple_add.h>
 #include <d2srv/d2_cfg_mgr.h>
+#include <d2srv/testutils/nc_test_utils.h>
 #include <dns/messagerenderer.h>
-#include <nc_test_utils.h>
 
 #include <gtest/gtest.h>
 
index 64ce75834a7fa7079a11f5ff4841c2c333b3bae8..de74cc520cc2ad88e47b8ca4b2ea3a39e8d8ac07 100644 (file)
@@ -9,8 +9,8 @@
 #include <asiolink/io_service.h>
 #include <d2/simple_remove.h>
 #include <d2srv/d2_cfg_mgr.h>
+#include <d2srv/testutils/nc_test_utils.h>
 #include <dns/messagerenderer.h>
-#include <nc_test_utils.h>
 
 #include <gtest/gtest.h>
 
index 5b79604203823898ab2103a715288d52132ccbf7..f557e2410dd940e6004f4019bfbc29bf193d6d9d 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS = . tests
+SUBDIRS = . testutils tests
 
 AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
 AM_CPPFLAGS += $(BOOST_INCLUDES)
@@ -15,9 +15,13 @@ libkea_d2srv_la_SOURCES += d2_cfg_mgr.cc d2_cfg_mgr.h
 libkea_d2srv_la_SOURCES += d2_config.cc d2_config.h
 libkea_d2srv_la_SOURCES += d2_log.cc d2_log.h
 libkea_d2srv_la_SOURCES += d2_messages.cc d2_messages.h
+libkea_d2srv_la_SOURCES += d2_update_message.cc d2_update_message.h
 libkea_d2srv_la_SOURCES += d2_simple_parser.cc d2_simple_parser.h
 libkea_d2srv_la_SOURCES += d2_stats.cc d2_stats.h
 libkea_d2srv_la_SOURCES += d2_tsig_key.cc d2_tsig_key.h
+libkea_d2srv_la_SOURCES += d2_zone.cc d2_zone.h
+libkea_d2srv_la_SOURCES += dns_client.cc dns_client.h
+libkea_d2srv_la_SOURCES += nc_trans.cc nc_trans.h
 EXTRA_DIST += d2_messages.mes
 
 libkea_d2srv_la_CXXFLAGS = $(AM_CXXFLAGS)
similarity index 99%
rename from src/bin/d2/d2_update_message.cc
rename to src/lib/d2srv/d2_update_message.cc
index 115663fa80d3efbe79e9f43e32f93a751365a05e..4a94a58dcb5f60810eb094dbed6ab1904fa57429 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <config.h>
 
-#include <d2/d2_update_message.h>
+#include <d2srv/d2_update_message.h>
 #include <dns/messagerenderer.h>
 #include <dns/name.h>
 #include <dns/opcode.h>
similarity index 99%
rename from src/bin/d2/d2_update_message.h
rename to src/lib/d2srv/d2_update_message.h
index ad01a9ce6907ed4c40dc49911e992d68260eb223..91d379a2e04adeca2a5a9e034a16e7a010227a4a 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef D2_UPDATE_MESSAGE_H
 #define D2_UPDATE_MESSAGE_H
 
-#include <d2/d2_zone.h>
+#include <d2srv/d2_zone.h>
 #include <dns/message.h>
 #include <dns/name.h>
 #include <dns/rcode.h>
similarity index 96%
rename from src/bin/d2/d2_zone.cc
rename to src/lib/d2srv/d2_zone.cc
index e029d17d018480f31eaec5415114b789a94faab2..3eef2441a7727d2b255cea4eabcca074483c0eb1 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <config.h>
 
-#include <d2/d2_zone.h>
+#include <d2srv/d2_zone.h>
 
 namespace isc {
 namespace d2 {
similarity index 100%
rename from src/bin/d2/d2_zone.h
rename to src/lib/d2srv/d2_zone.h
similarity index 99%
rename from src/bin/d2/dns_client.cc
rename to src/lib/d2srv/dns_client.cc
index de929bc549abe505fac8a168fe041a5062a57f62..4d407c724cc42d90d63f836e37b2efbe59265fe0 100644 (file)
@@ -5,8 +5,9 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-#include <d2/dns_client.h>
+
 #include <d2srv/d2_log.h>
+#include <d2srv/dns_client.h>
 #include <dns/messagerenderer.h>
 #include <stats/stats_mgr.h>
 #include <limits>
similarity index 99%
rename from src/bin/d2/dns_client.h
rename to src/lib/d2srv/dns_client.h
index fb2412523d78eb8705b62fec08e80c815d2b56cd..2cfd8a8cf2b341c8daeb1016c931ad55e58dc937 100644 (file)
@@ -7,13 +7,11 @@
 #ifndef DNS_CLIENT_H
 #define DNS_CLIENT_H
 
-#include <d2/d2_update_message.h>
-
 #include <asiolink/io_service.h>
-#include <util/buffer.h>
-
 #include <asiodns/io_fetch.h>
 #include <d2srv/d2_tsig_key.h>
+#include <d2srv/d2_update_message.h>
+#include <util/buffer.h>
 
 namespace isc {
 namespace d2 {
similarity index 99%
rename from src/bin/d2/nc_trans.cc
rename to src/lib/d2srv/nc_trans.cc
index 6f5c8ebb9f0bdc667e2beaa6b1c37f9c63d5f491..32407e04372fec44222ebe23563d1cee7901e44d 100644 (file)
@@ -6,8 +6,8 @@
 
 #include <config.h>
 
-#include <d2/nc_trans.h>
 #include <d2srv/d2_log.h>
+#include <d2srv/nc_trans.h>
 #include <dns/qid_gen.h>
 #include <dns/rdata.h>
 #include <hooks/hooks.h>
similarity index 99%
rename from src/bin/d2/nc_trans.h
rename to src/lib/d2srv/nc_trans.h
index 503d9a0f83a870f1aeeec47fe784fb8ebe927417..cfbc9ec45cea8cbe99e5257e1262bd7c09cf7221 100644 (file)
@@ -10,7 +10,7 @@
 /// @file nc_trans.h This file defines the class NameChangeTransaction.
 
 #include <asiolink/io_service.h>
-#include <d2/dns_client.h>
+#include <d2srv/dns_client.h>
 #include <d2srv/d2_cfg_mgr.h>
 #include <d2srv/d2_tsig_key.h>
 #include <dhcp_ddns/ncr_msg.h>
index caede036f9ecb048c501cb163ffcb711b33d15c1..436cb21ee1479f6dddff3121ccc3ea7731620bd3 100644 (file)
@@ -20,13 +20,19 @@ TESTS += libd2srv_unittests
 
 libd2srv_unittests_SOURCES  = run_unittests.cc
 libd2srv_unittests_SOURCES += d2_tsig_key_unittest.cc
+libd2srv_unittests_SOURCES += d2_update_message_unittests.cc
+libd2srv_unittests_SOURCES += d2_zone_unittests.cc
+libd2srv_unittests_SOURCES += dns_client_unittests.cc
+libd2srv_unittests_SOURCES += nc_trans_unittests.cc
 
 libd2srv_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
 libd2srv_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
 
 libd2srv_unittests_LDADD  = $(top_builddir)/src/lib/d2srv/libkea-d2srv.la
+libd2srv_unittests_LDADD += $(top_builddir)/src/lib/d2srv/testutils/libd2srvtest.la
 libd2srv_unittests_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
 libd2srv_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
+libd2srv_unittests_LDADD += $(top_builddir)/src/lib/asiodns/libkea-asiodns.la
 libd2srv_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
 libd2srv_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
 libd2srv_unittests_LDADD += $(top_builddir)/src/lib/http/libkea-http.la
similarity index 99%
rename from src/bin/d2/tests/d2_update_message_unittests.cc
rename to src/lib/d2srv/tests/d2_update_message_unittests.cc
index 092b23f9e60b2cce060e76b4781678d27b3408b3..6f0cfca7cf9d52fbfb540f520ab514fce444b37f 100644 (file)
@@ -6,9 +6,9 @@
 
 #include <config.h>
 
-#include <d2/d2_update_message.h>
-#include <d2/d2_zone.h>
 #include <d2srv/d2_config.h>
+#include <d2srv/d2_update_message.h>
+#include <d2srv/d2_zone.h>
 #include <dns/messagerenderer.h>
 #include <dns/rdata.h>
 #include <dns/rdataclass.h>
similarity index 99%
rename from src/bin/d2/tests/d2_zone_unittests.cc
rename to src/lib/d2srv/tests/d2_zone_unittests.cc
index 486bed4798532b70550d3ffe8af8ffb0d8b52831..23bff13075b13ae47fc488920d2ff7f3a903dff5 100644 (file)
@@ -5,7 +5,7 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-#include <d2/d2_zone.h>
+#include <d2srv/d2_zone.h>
 #include <gtest/gtest.h>
 #include <sstream>
 
similarity index 99%
rename from src/bin/d2/tests/dns_client_unittests.cc
rename to src/lib/d2srv/tests/dns_client_unittests.cc
index fc0420cc9116891ddf0bc792e8010e75c1a631a9..a5e39c15d7b42a52e0e743316448f1d7a62aa266 100644 (file)
@@ -6,14 +6,14 @@
 
 #include <config.h>
 
-#include <d2/dns_client.h>
+#include <d2srv/dns_client.h>
 #include <dns/opcode.h>
 #include <asiodns/io_fetch.h>
 #include <asiodns/logger.h>
 #include <asiolink/interval_timer.h>
+#include <d2srv/testutils/nc_test_utils.h>
+#include <d2srv/testutils/stats_test_utils.h>
 #include <dns/messagerenderer.h>
-#include <nc_test_utils.h>
-#include <stats_test_utils.h>
 
 #include <boost/asio/ip/udp.hpp>
 #include <boost/asio/socket_base.hpp>
similarity index 99%
rename from src/bin/d2/tests/nc_trans_unittests.cc
rename to src/lib/d2srv/tests/nc_trans_unittests.cc
index 1471006a14f15468c72d128e22673117319d89ca..16e02dcffff6d8edd2eadb32240b1a1b881795ac 100644 (file)
@@ -8,13 +8,13 @@
 #include <asiolink/asio_wrapper.h>
 #include <asiolink/io_service.h>
 #include <asiolink/interval_timer.h>
-#include <d2/nc_trans.h>
+#include <d2srv/nc_trans.h>
+#include <d2srv/testutils/nc_test_utils.h>
 #include <dns/opcode.h>
 #include <dns/messagerenderer.h>
 #include <log/logger_support.h>
 #include <log/macros.h>
 #include <util/buffer.h>
-#include <nc_test_utils.h>
 
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <gtest/gtest.h>
diff --git a/src/lib/d2srv/testutils/Makefile.am b/src/lib/d2srv/testutils/Makefile.am
new file mode 100644 (file)
index 0000000..c7ae2ad
--- /dev/null
@@ -0,0 +1,23 @@
+SUBDIRS = .
+
+AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES)
+
+AM_CXXFLAGS = $(KEA_CXXFLAGS)
+
+CLEANFILES = *.gcno *.gcda
+
+if HAVE_GTEST
+
+noinst_LTLIBRARIES = libd2srvtest.la
+
+libd2srvtest_la_SOURCES  = nc_test_utils.cc nc_test_utils.h
+libd2srvtest_la_SOURCES += stats_test_utils.cc stats_test_utils.h
+
+libd2srvtest_la_CXXFLAGS = $(AM_CXXFLAGS)
+libd2srvtest_la_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
+
+libd2srvtest_la_LIBADD  = $(top_builddir)/src/lib/d2srv/libkea-d2srv.la
+libd2srvtest_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
+
+endif
similarity index 99%
rename from src/bin/d2/tests/nc_test_utils.cc
rename to src/lib/d2srv/testutils/nc_test_utils.cc
index 358387bdc7821742c76292891a77d06e944c8d29..abcbd0bd5b24ca05f5ab643aa72a998ee1adc583 100644 (file)
@@ -8,9 +8,9 @@
 #include <asiolink/asio_wrapper.h>
 #include <asiolink/udp_endpoint.h>
 #include <d2srv/d2_cfg_mgr.h>
+#include <d2srv/testutils/nc_test_utils.h>
 #include <dns/messagerenderer.h>
 #include <dns/opcode.h>
-#include <nc_test_utils.h>
 #include <util/encode/base64.h>
 
 #include <gtest/gtest.h>
similarity index 99%
rename from src/bin/d2/tests/nc_test_utils.h
rename to src/lib/d2srv/testutils/nc_test_utils.h
index 4cfff4cb92cacaa6f09d0784deb25292dde071e8..e670a983822ca90f4fe1df0f0d94ef027bdf9e0a 100644 (file)
@@ -11,7 +11,8 @@
 
 #include <asiolink/io_service.h>
 #include <asiolink/interval_timer.h>
-#include <d2/nc_trans.h>
+#include <d2srv/d2_update_message.h>
+#include <d2srv/nc_trans.h>
 
 #include <boost/asio/ip/udp.hpp>
 #include <boost/asio/socket_base.hpp>
similarity index 96%
rename from src/bin/d2/tests/stats_test_utils.cc
rename to src/lib/d2srv/testutils/stats_test_utils.cc
index 7c8f6df6e328a997fe59e9ab35337ce3f1249628..c01c461cfdb6f40ff967a62a181b4e1ac925ef19 100644 (file)
@@ -6,7 +6,7 @@
 #include <config.h>
 
 #include <d2srv/d2_stats.h>
-#include <stats_test_utils.h>
+#include <d2srv/testutils/stats_test_utils.h>
 
 using namespace isc::data;
 using namespace isc::stats;