KEA_ADMIN = f'@TOP_BUILD_DIR@/src/bin/admin/kea-admin'
KEA_LFC = f'@TOP_BUILD_DIR@/src/bin/lfc/kea-lfc'
TEST_CA_DIR = f'@TOP_SOURCE_DIR@/src/lib/asiolink/testutils/ca'
+DATABASE_SCRIPTS_DIR = f'@TOP_BUILD_DIR@/src/share/database/scripts'
+RUN_STATE_DIR = get_option('localstatedir')
+PREFIX = get_option('prefix')
+DHCP_DATA_DIR = f'@PREFIX@/@RUN_STATE_DIR@/run/kea'
# TODO: Control it via a build option.
FUZZING_IN_CI = false
#### System-specific Compiler Flags
-PREFIX = get_option('prefix')
if SYSTEM == 'darwin'
add_project_arguments('-D__APPLE_USE_RFC_3542', language: 'cpp')
add_project_link_arguments(f'-Wl,-rpath,@PREFIX@/lib', language: 'cpp')
+if not gtest.found()
+ subdir_done()
+endif
+
kea_asiodns_tests = executable(
'kea-asiodns-tests',
'io_fetch_unittest.cc',
subdir('tests')
kea_asiolink_headers = [
'addr_utilities.h',
- 'asiolink.h',
'asio_wrapper.h',
+ 'asiolink.h',
'botan_tls.h',
'botan_wrapper.h',
'common_tls.h',
'tls_socket.h',
'udp_endpoint.h',
'udp_socket.h',
+ 'unix_domain_socket.h',
'unix_domain_socket_acceptor.h',
'unix_domain_socket_endpoint.h',
- 'unix_domain_socket.h',
]
install_headers(
kea_asiolink_headers,
+if not gtest.found()
+ subdir_done()
+endif
+
CURRENT_BUILD_DIR = meson.current_build_dir()
configure_file(
input: 'process_spawn_app.sh.in',
+if not gtest.found()
+ subdir_done()
+endif
+
kea_asiolink_testutils_lib = static_library(
'kea-asiolink-testutils',
'test_tls.cc',
+if not gtest.found()
+ subdir_done()
+endif
+
kea_cc_tests = executable(
'kea-cc-tests',
'command_interpreter_unittests.cc',
'base_command_mgr.h',
'client_connection.h',
'cmd_http_listener.h',
- 'cmd_response_creator_factory.h',
'cmd_response_creator.h',
+ 'cmd_response_creator_factory.h',
'cmds_impl.h',
'command_mgr.h',
'config_log.h',
'hooked_command_mgr.h',
'http_command_config.h',
'http_command_mgr.h',
- 'http_command_response_creator_factory.h',
'http_command_response_creator.h',
+ 'http_command_response_creator_factory.h',
'timeouts.h',
'unix_command_config.h',
'unix_command_mgr.h',
+if not gtest.found()
+ subdir_done()
+endif
+
kea_config_backend_tests = executable(
'kea-config_backend-tests',
'config_backend_mgr_unittest.cc',
+if not gtest.found()
+ subdir_done()
+endif
+
kea_cryptolink_tests = executable(
'kea-cryptolink-tests',
'crypto_unittests.cc',
'audit_entry.h',
'backend_selector.h',
'database_connection.h',
- 'dbaccess_parser.h',
'db_exceptions.h',
'db_log.h',
'db_messages.h',
- 'server_collection.h',
+ 'dbaccess_parser.h',
'server.h',
+ 'server_collection.h',
'server_selector.h',
]
install_headers(
+if not gtest.found()
+ subdir_done()
+endif
+
kea_database_tests = executable(
'kea-database-tests',
'audit_entry_unittest.cc',
+if not gtest.found()
+ subdir_done()
+endif
+
kea_database_testutils_lib = static_library(
'kea-database-testutils',
'schema.cc',
'dhcp4.h',
'dhcp6.h',
'docsis3_option_defs.h',
- 'duid_factory.h',
'duid.h',
+ 'duid_factory.h',
'hwaddr.h',
- 'iface_mgr_error_handler.h',
'iface_mgr.h',
+ 'iface_mgr_error_handler.h',
'libdhcp++.h',
'opaque_data_tuple.h',
+ 'option.h',
'option4_addrlst.h',
'option4_client_fqdn.h',
'option4_dnr.h',
'option6_auth.h',
'option6_client_fqdn.h',
'option6_dnr.h',
- 'option6_iaaddr.h',
'option6_ia.h',
+ 'option6_iaaddr.h',
'option6_iaprefix.h',
'option6_pdexclude.h',
'option6_status_code.h',
'option_custom.h',
'option_data_types.h',
'option_definition.h',
- 'option.h',
- 'option_int_array.h',
'option_int.h',
+ 'option_int_array.h',
'option_opaque_data_tuples.h',
- 'option_space_container.h',
'option_space.h',
+ 'option_space_container.h',
'option_string.h',
- 'option_vendor_class.h',
'option_vendor.h',
+ 'option_vendor_class.h',
'packet_queue.h',
+ 'packet_queue_mgr.h',
'packet_queue_mgr4.h',
'packet_queue_mgr6.h',
- 'packet_queue_mgr.h',
'packet_queue_ring.h',
+ 'pkt.h',
'pkt4.h',
'pkt4o6.h',
'pkt6.h',
+ 'pkt_filter.h',
'pkt_filter6.h',
'pkt_filter_bpf.h',
- 'pkt_filter.h',
- 'pkt_filter_inet6.h',
'pkt_filter_inet.h',
+ 'pkt_filter_inet6.h',
'pkt_filter_lpf.h',
- 'pkt.h',
'pkt_template.h',
'protocol_util.h',
'socket_info.h',
+if not gtest.found()
+ subdir_done()
+endif
+
kea_dhcp_ddns_tests = executable(
'kea-dhcp_ddns-tests',
'ncr_udp_unittests.cc',
'timer_mgr.cc',
'tracking_lease_mgr.cc',
cpp_args: [
- f'-DDHCP_DATA_DIR="@TOP_BUILD_DIR@"',
+ f'-DDHCP_DATA_DIR="@DHCP_DATA_DIR@"',
f'-DKEA_LFC_EXECUTABLE="@KEA_LFC@"',
],
dependencies: [crypto],
)
LIBS_BUILT_SO_FAR = [kea_dhcpsrv_lib] + LIBS_BUILT_SO_FAR
kea_dhcpsrv_headers = [
- 'allocation_state.h',
- 'allocator.h',
'alloc_engine.h',
'alloc_engine_log.h',
'alloc_engine_messages.h',
+ 'allocation_state.h',
+ 'allocator.h',
'base_host_data_source.h',
'cache_host_data_source.h',
'callout_handle_store.h',
+ 'cb_ctl_dhcp.h',
'cb_ctl_dhcp4.h',
'cb_ctl_dhcp6.h',
- 'cb_ctl_dhcp.h',
'cfg_4o6.h',
'cfg_consistency.h',
'cfg_db_access.h',
'cfg_hosts_util.h',
'cfg_iface.h',
'cfg_mac_source.h',
- 'cfgmgr.h',
'cfg_multi_threading.h',
- 'cfg_option_def.h',
'cfg_option.h',
+ 'cfg_option_def.h',
'cfg_rsoo.h',
'cfg_shared_networks.h',
'cfg_subnets4.h',
'cfg_subnets6.h',
+ 'cfgmgr.h',
'client_class_def.h',
'config_backend_dhcp4.h',
'config_backend_dhcp4_mgr.h',
'flq_allocator.h',
'fuzz_log.h',
'fuzz_messages.h',
+ 'host.h',
'host_container.h',
'host_data_source_factory.h',
- 'host.h',
'host_mgr.h',
'hosts_log.h',
'hosts_messages.h',
'iterative_allocation_state.h',
'iterative_allocator.h',
'key_from_key.h',
+ 'lease.h',
'lease_file_loader.h',
'lease_file_stats.h',
- 'lease.h',
- 'lease_mgr_factory.h',
'lease_mgr.h',
+ 'lease_mgr_factory.h',
'memfile_lease_limits.h',
'memfile_lease_mgr.h',
'memfile_lease_storage.h',
'parsers/dhcp_queue_control_parser.h',
'parsers/duid_config_parser.h',
'parsers/expiration_config_parser.h',
- 'parsers/host_reservations_list_parser.h',
'parsers/host_reservation_parser.h',
+ 'parsers/host_reservations_list_parser.h',
'parsers/ifaces_config_parser.h',
'parsers/multi_threading_config_parser.h',
'parsers/option_data_parser.h',
'parsers/sanity_checks_parser.h',
- 'parsers/shared_networks_list_parser.h',
'parsers/shared_network_parser.h',
+ 'parsers/shared_networks_list_parser.h',
'parsers/simple_parser4.h',
'parsers/simple_parser6.h',
'pool.h',
'master_lexer.h',
'master_lexer_inputsource.h',
'master_lexer_state.h',
- 'master_loader_callbacks.h',
'master_loader.h',
+ 'master_loader_callbacks.h',
'message.h',
'messagerenderer.h',
'name.h',
'opcode.h',
'question.h',
'rcode.h',
- 'rdataclass.h',
'rdata.h',
+ 'rdataclass.h',
'rrclass.h',
'rrparamregistry.h',
'rrset.h',
'rrtype.h',
'serial.h',
'time_utils.h',
- 'tsigerror.h',
'tsig.h',
+ 'tsigerror.h',
'tsigkey.h',
'tsigrecord.h',
'txt_like.h',
+if not gtest.found()
+ subdir_done()
+endif
+
kea_dns_tests = executable(
'kea-dns-tests',
'dns_exceptions_unittest.cc',
subdir('tests')
kea_eval_headers = [
'dependency.h',
- 'eval_context_decl.h',
'eval_context.h',
+ 'eval_context_decl.h',
'eval_log.h',
'eval_messages.h',
'evaluate.h',
+if not gtest.found()
+ subdir_done()
+endif
+
kea_eval_tests = executable(
'kea-eval-tests',
'boolean_unittest.cc',
+if not gtest.found()
+ subdir_done()
+endif
+
kea_exceptions_tests = executable(
'kea-exceptions-tests',
'exceptions_unittest.cc',
)
LIBS_BUILT_SO_FAR = [kea_hooks_lib] + LIBS_BUILT_SO_FAR
kea_hooks_headers = [
- 'callout_handle_associate.h',
'callout_handle.h',
+ 'callout_handle_associate.h',
'callout_manager.h',
- 'hooks_config.h',
'hooks.h',
+ 'hooks_config.h',
'hooks_log.h',
'hooks_manager.h',
'hooks_messages.h',
'hooks_parser.h',
'libinfo.h',
'library_handle.h',
- 'library_manager_collection.h',
'library_manager.h',
+ 'library_manager_collection.h',
'parking_lots.h',
'pointer_converter.h',
'server_hooks.h',
'auth_config.h',
'auth_log.h',
'auth_messages.h',
- 'basic_auth_config.h',
'basic_auth.h',
+ 'basic_auth_config.h',
'cfg_http_header.h',
'client.h',
'connection.h',
'listener_impl.h',
'post_request.h',
'post_request_json.h',
- 'request_context.h',
'request.h',
+ 'request_context.h',
'request_parser.h',
+ 'response.h',
'response_context.h',
- 'response_creator_factory.h',
'response_creator.h',
- 'response.h',
+ 'response_creator_factory.h',
'response_json.h',
'response_parser.h',
'url.h',
+if not gtest.found()
+ subdir_done()
+endif
+
kea_log_interprocess_tests = executable(
'kea-log-interprocess-tests',
'interprocess_sync_file_unittest.cc',
+if not gtest.found()
+ subdir_done()
+endif
+
kea_log_tests = executable(
'kea-log-tests',
'buffer_appender_unittest.cc',
+if not gtest.found()
+ subdir_done()
+endif
+
libs_testutils = [
kea_mysql_testutils_lib,
kea_database_testutils_lib,
-DATABASE_SCRIPTS_DIR = f'@TOP_BUILD_DIR@/src/share/database/scripts'
+if not gtest.found()
+ subdir_done()
+endif
+
kea_mysql_testutils_lib = static_library(
'kea-mysql-testutils',
'mysql_schema.cc',
+if not gtest.found()
+ subdir_done()
+endif
+
libs_testutils = [
kea_pgsql_testutils_lib,
kea_database_testutils_lib,
-DATABASE_SCRIPTS_DIR = f'@TOP_BUILD_DIR@/src/share/database/scripts'
+if not gtest.found()
+ subdir_done()
+endif
+
kea_pgsql_testutils_lib = static_library(
'kea-pgsql-testutils',
'pgsql_schema.cc',
'log_parser.cc',
'process_messages.cc',
'redact_config.cc',
- cpp_args: [f'-DDATA_DIR="@TOP_BUILD_DIR@"'],
+ cpp_args: [f'-DDATA_DIR="@DHCP_DATA_DIR@"'],
dependencies: [boost],
include_directories: [include_directories('.')] + INCLUDES,
install: true,
+if not gtest.found()
+ subdir_done()
+endif
+
kea_stats_tests = executable(
'kea-stats-tests',
'context_unittest.cc',
LIBS_BUILT_SO_FAR = [kea_tcp_lib] + LIBS_BUILT_SO_FAR
kea_tcp_headers = [
'mt_tcp_listener_mgr.h',
- 'tcp_connection_acceptor.h',
'tcp_connection.h',
+ 'tcp_connection_acceptor.h',
'tcp_connection_pool.h',
'tcp_listener.h',
'tcp_log.h',
+if not gtest.found()
+ subdir_done()
+endif
+
kea_testutils_lib = static_library(
'kea-testutils',
'io_utils.cc',
+if not gtest.found()
+ subdir_done()
+endif
+
kea_util_tests = executable(
'kea-util-tests',
'bigint_unittest.cc',
+if not gtest.found()
+ subdir_done()
+endif
+
kea_util_unittests_lib = static_library(
'kea-util-unittests',
'check_valgrind.cc',
)
LIBS_BUILT_SO_FAR = [kea_yang_lib] + LIBS_BUILT_SO_FAR
kea_yang_headers = [
- 'adaptor_config.h',
'adaptor.h',
+ 'adaptor_config.h',
'adaptor_host.h',
'adaptor_option.h',
'adaptor_pool.h',
'adaptor_subnet.h',
'netconf_error.h',
+ 'translator.h',
'translator_class.h',
'translator_config.h',
'translator_control_socket.h',
'translator_database.h',
- 'translator.h',
'translator_host.h',
'translator_logger.h',
'translator_option_data.h',
output: 'dhcpdb_drop.mysql',
copy: true,
)
-# configure upgrade scripts
+upgrade_scripts = [
+ 'upgrade_001.0_to_002.0.sh',
+ 'upgrade_002.0_to_003.0.sh',
+ 'upgrade_003.0_to_004.0.sh',
+ 'upgrade_004.0_to_004.1.sh',
+ 'upgrade_004.1_to_005.0.sh',
+ 'upgrade_005.0_to_005.1.sh',
+ 'upgrade_005.1_to_005.2.sh',
+ 'upgrade_005.2_to_006.0.sh',
+ 'upgrade_006.0_to_007.0.sh',
+ 'upgrade_007.0_to_008.0.sh',
+ 'upgrade_008.0_to_008.1.sh',
+ 'upgrade_008.1_to_008.2.sh',
+ 'upgrade_008.2_to_009.0.sh',
+ 'upgrade_009.0_to_009.1.sh',
+ 'upgrade_009.1_to_009.2.sh',
+ 'upgrade_009.2_to_009.3.sh',
+ 'upgrade_009.3_to_009.4.sh',
+ 'upgrade_009.4_to_009.5.sh',
+ 'upgrade_009.5_to_009.6.sh',
+ 'upgrade_009.6_to_010.0.sh',
+ 'upgrade_010_to_011.sh',
+ 'upgrade_011_to_012.sh',
+ 'upgrade_012_to_013.sh',
+ 'upgrade_013_to_014.sh',
+ 'upgrade_014_to_015.sh',
+ 'upgrade_015_to_016.sh',
+ 'upgrade_016_to_017.sh',
+ 'upgrade_017_to_018.sh',
+ 'upgrade_018_to_019.sh',
+ 'upgrade_019_to_020.sh',
+ 'upgrade_020_to_021.sh',
+ 'upgrade_021_to_022.sh',
+ 'upgrade_022_to_023.sh',
+ 'upgrade_023_to_024.sh',
+ 'upgrade_024_to_025.sh',
+ 'upgrade_025_to_026.sh',
+ 'upgrade_026_to_027.sh',
+ 'upgrade_027_to_028.sh',
+]
+foreach file : upgrade_scripts
+ configure_file(
+ input: file + '.in',
+ output: file,
+ configuration: mysql_script_conf_data,
+ )
+endforeach
# install
-postgresql_script_conf_data = configuration_data()
-postgresql_script_conf_data.set('prefix', get_option('prefix'))
-postgresql_script_conf_data.set('abs_top_builddir', TOP_BUILD_DIR)
-postgresql_script_conf_data.set(
- 'datarootdir',
- '${prefix}/' + get_option('datadir'),
-)
-postgresql_script_conf_data.set('PACKAGE_NAME', 'kea')
+pgsql_script_conf_data = configuration_data()
+pgsql_script_conf_data.set('prefix', get_option('prefix'))
+pgsql_script_conf_data.set('abs_top_builddir', TOP_BUILD_DIR)
+pgsql_script_conf_data.set('datarootdir', '${prefix}/' + get_option('datadir'))
+pgsql_script_conf_data.set('PACKAGE_NAME', 'kea')
configure_file(
input: 'wipe_data.sh.in',
output: 'wipe_data.sh',
- configuration: postgresql_script_conf_data,
+ configuration: pgsql_script_conf_data,
)
configure_file(
input: 'dhcpdb_create.pgsql',
output: 'dhcpdb_drop.pgsql',
copy: true,
)
-# configure upgrade scripts
+upgrade_scripts = [
+ 'upgrade_001.0_to_002.0.sh',
+ 'upgrade_002.0_to_003.0.sh',
+ 'upgrade_003.0_to_003.1.sh',
+ 'upgrade_003.1_to_003.2.sh',
+ 'upgrade_003.2_to_003.3.sh',
+ 'upgrade_003.3_to_004.0.sh',
+ 'upgrade_004.0_to_005.0.sh',
+ 'upgrade_005.0_to_005.1.sh',
+ 'upgrade_005.1_to_006.0.sh',
+ 'upgrade_006.0_to_006.1.sh',
+ 'upgrade_006.1_to_006.2.sh',
+ 'upgrade_006.2_to_007.0.sh',
+ 'upgrade_007_to_008.sh',
+ 'upgrade_008_to_009.sh',
+ 'upgrade_009_to_010.sh',
+ 'upgrade_010_to_011.sh',
+ 'upgrade_011_to_012.sh',
+ 'upgrade_012_to_013.sh',
+ 'upgrade_013_to_014.sh',
+ 'upgrade_014_to_015.sh',
+ 'upgrade_015_to_016.sh',
+ 'upgrade_016_to_017.sh',
+ 'upgrade_017_to_018.sh',
+ 'upgrade_018_to_019.sh',
+ 'upgrade_019_to_020.sh',
+ 'upgrade_020_to_021.sh',
+ 'upgrade_021_to_022.sh',
+ 'upgrade_022_to_023.sh',
+ 'upgrade_023_to_024.sh',
+ 'upgrade_024_to_025.sh',
+ 'upgrade_025_to_026.sh',
+ 'upgrade_026_to_027.sh',
+ 'upgrade_027_to_028.sh',
+]
+foreach file : upgrade_scripts
+ configure_file(
+ input: file + '.in',
+ output: file,
+ configuration: pgsql_script_conf_data,
+ )
+endforeach
# install