]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1671] addressed review comments
authorRazvan Becheriu <razvan@isc.org>
Mon, 20 Mar 2023 17:00:21 +0000 (19:00 +0200)
committerAndrei Pavel <andrei@isc.org>
Tue, 21 Mar 2023 06:39:52 +0000 (08:39 +0200)
12 files changed:
doc/sphinx/arm/agent.rst
doc/sphinx/arm/ddns.rst
doc/sphinx/arm/dhcp4-srv.rst
doc/sphinx/arm/dhcp6-srv.rst
doc/sphinx/arm/ext-netconf.rst
doc/sphinx/arm/hooks-lease-cmds.rst
doc/sphinx/man/kea-dhcp4.8.rst
doc/sphinx/man/kea-dhcp6.8.rst
src/bin/dhcp4/json_config_parser.cc
src/bin/dhcp4/tests/dhcp4_process_tests.sh.in
src/bin/dhcp6/json_config_parser.cc
src/bin/dhcp6/tests/dhcp6_process_tests.sh.in

index 3dc0118d24c30f29b5ae1d3bc9a305d64043708a..86c6df681e0c1bd88d3f64d9b87de3b065d5c22e 100644 (file)
@@ -179,7 +179,7 @@ password these values can be read from files. The syntax was extended by:
 -  The ``directory`` authentication parameter which handles the common
    part of file paths. By default the value is the empty string.
 
--  The``password-file`` client parameter which with the ``directory``
+-  The ``password-file`` client parameter which with the ``directory``
    parameter specifies the path of a file where the password or when no
    user ID is given the whole basic HTTP authentication secret before
    encoding can be read.
@@ -388,25 +388,22 @@ Starting and Stopping the Control Agent
    is a copy of the ``config.report`` file produced by ``./configure``;
    it is embedded in the executable binary.
 
-The ``config.report`` file may also be accessed directly, via the
-following command. The binary ``path`` may be found in the install
-directory or in the ``.libs`` subdirectory in the source tree. For
-example: ``kea/src/lib/process/.libs/``.
+   The contents of the ``config.report`` file may also be accessed by examining
+   certain libraries in the installation tree or in the source tree.
 
-::
-
-   strings path/libkea-process.so | sed -n 's/;;;; //p'
+   .. code-block:: shell
 
-::
+    # from installation using libkea-process.so
+    $ strings ${prefix}/lib/libkea-process.so | sed -n 's/;;;; //p'
 
-   strings path/libkea-process.a | sed -n 's/;;;; //p'
+    # from sources using libkea-process.so
+    $ strings src/lib/process/.libs/libkea-process.so | sed -n 's/;;;; //p'
 
-The libcfgrpt.a library can also be used from the source tree with path:
-``src/lib/process/cfgrpt/.libs/``.
-
-::
+    # from sources using libkea-process.a
+    $ strings src/lib/process/.libs/libkea-process.a | sed -n 's/;;;; //p'
 
-   strings path/libcfgrpt.a | sed -n 's/;;;; //p'
+    # from sources using libcfgrpt.a
+    $ strings src/lib/process/cfgrpt/.libs/libcfgrpt.a | sed -n 's/;;;; //p'
 
 The CA is started by running its binary and specifying the configuration
 file it should use. For example:
index 8e2bd844aea31d8dd429e55878626b11e82ba123..85373edefe7c94ae94fb0bc1145f968e5414061c 100644 (file)
@@ -138,25 +138,22 @@ directly. It accepts the following command-line switches:
    messages to standard output and errors to standard error when testing
    the configuration.
 
-The ``config.report`` file may also be accessed directly, via the
-following command. The binary ``path`` may be found in the install
-directory or in the ``.libs`` subdirectory in the source tree. For
-example: ``kea/src/lib/process/.libs/``.
+   The contents of the ``config.report`` file may also be accessed by examining
+   certain libraries in the installation tree or in the source tree.
 
-::
-
-   strings path/libkea-process.so | sed -n 's/;;;; //p'
+   .. code-block:: shell
 
-::
+    # from installation using libkea-process.so
+    $ strings ${prefix}/lib/libkea-process.so | sed -n 's/;;;; //p'
 
-   strings path/libkea-process.a | sed -n 's/;;;; //p'
+    # from sources using libkea-process.so
+    $ strings src/lib/process/.libs/libkea-process.so | sed -n 's/;;;; //p'
 
-The libcfgrpt.a library can also be used from the source tree with path:
-``src/lib/process/cfgrpt/.libs/``.
-
-::
+    # from sources using libkea-process.a
+    $ strings src/lib/process/.libs/libkea-process.a | sed -n 's/;;;; //p'
 
-   strings path/libcfgrpt.a | sed -n 's/;;;; //p'
+    # from sources using libcfgrpt.a
+    $ strings src/lib/process/cfgrpt/.libs/libcfgrpt.a | sed -n 's/;;;; //p'
 
 Upon startup, the module loads its configuration and begins listening
 for NCRs based on that configuration.
index ee74e38b39be9a7d856ab0d12762158d1cd3dbe8..8ddf548f9e6f77efbb445474857787840f66adc9 100644 (file)
@@ -43,9 +43,10 @@ the following command-line switches:
    server.
 
 -  ``-T file`` - specifies a configuration file to be tested. ``kea-dhcp4``
-   loads it, checks it, and exits. It performs extra checks beside ``-t`` is
-   doing, like establising database connections (lease db, host db, CB db,
-   forensic logging db), hook libraries loading and configuration parsing, etc.
+   loads it, checks it, and exits. It performs extra checks beside what ``-t``
+   is doing, like establising database connections (lease backend,
+   host reservations backend, configuration backend and forensic logging
+   backend), hook libraries loading and configuration parsing, etc.
    It does not open unix or TCP/UDP sockets, neither does it open or rotate
    files, as all these actions could interfere with a running process on the
    same machine.
@@ -60,25 +61,22 @@ the following command-line switches:
    is a copy of the ``config.report`` file produced by ``./configure``;
    it is embedded in the executable binary.
 
-The ``config.report`` file may also be accessed directly, via the
-following command. The binary ``path`` may be found in the install
-directory or in the ``.libs`` subdirectory in the source tree. For
-example: ``kea/src/lib/process/.libs/``.
+   The contents of the ``config.report`` file may also be accessed by examining
+   certain libraries in the installation tree or in the source tree.
 
-::
-
-   strings path/libkea-process.so | sed -n 's/;;;; //p'
+   .. code-block:: shell
 
-::
+    # from installation using libkea-process.so
+    $ strings ${prefix}/lib/libkea-process.so | sed -n 's/;;;; //p'
 
-   strings path/libkea-process.a | sed -n 's/;;;; //p'
+    # from sources using libkea-process.so
+    $ strings src/lib/process/.libs/libkea-process.so | sed -n 's/;;;; //p'
 
-The libcfgrpt.a library can also be used from the source tree with path:
-``src/lib/process/cfgrpt/.libs/``.
-
-::
+    # from sources using libkea-process.a
+    $ strings src/lib/process/.libs/libkea-process.a | sed -n 's/;;;; //p'
 
-   strings path/libcfgrpt.a | sed -n 's/;;;; //p'
+    # from sources using libcfgrpt.a
+    $ strings src/lib/process/cfgrpt/.libs/libcfgrpt.a | sed -n 's/;;;; //p'
 
 On startup, the server detects available network interfaces and
 attempts to open UDP sockets on all interfaces listed in the
index d8ca1203a844f80f3910e59b5c67fdfa30a38a0a..3c8762f35801be97e0cf583e170b4df8993963d9 100644 (file)
@@ -42,10 +42,11 @@ the following command-line switches:
    comprehensive; certain checks are possible only when running the
    server.
 
--  ``-T file`` - specifies a configuration file to be tested. ``kea-dhcp4``
-   loads it, checks it, and exits. It performs extra checks beside ``-t`` is
-   doing, like establising database connections (lease db, host db, CB db,
-   forensic logging db), hook libraries loading and configuration parsing, etc.
+-  ``-T file`` - specifies a configuration file to be tested. ``kea-dhcp6``
+   loads it, checks it, and exits. It performs extra checks beside what ``-t``
+   is doing, like establising database connections (lease backend,
+   host reservations backend, configuration backend and forensic logging
+   backend), hook libraries loading and configuration parsing, etc.
    It does not open unix or TCP/UDP sockets, neither does it open or rotate
    files, as all these actions could interfere with a running process on the
    same machine.
@@ -60,25 +61,22 @@ the following command-line switches:
    is a copy of the ``config.report`` file produced by ``./configure``;
    it is embedded in the executable binary.
 
-The ``config.report`` file may also be accessed directly, via the
-following command. The binary ``path`` may be found in the install
-directory or in the ``.libs`` subdirectory in the source tree. For
-example: ``kea/src/lib/process/.libs/``.
+   The contents of the ``config.report`` file may also be accessed by examining
+   certain libraries in the installation tree or in the source tree.
 
-::
-
-   strings path/libkea-process.so | sed -n 's/;;;; //p'
+   .. code-block:: shell
 
-::
+    # from installation using libkea-process.so
+    $ strings ${prefix}/lib/libkea-process.so | sed -n 's/;;;; //p'
 
-   strings path/libkea-process.a | sed -n 's/;;;; //p'
+    # from sources using libkea-process.so
+    $ strings src/lib/process/.libs/libkea-process.so | sed -n 's/;;;; //p'
 
-The libcfgrpt.a library can also be used from the source tree with path:
-``src/lib/process/cfgrpt/.libs/``.
-
-::
+    # from sources using libkea-process.a
+    $ strings src/lib/process/.libs/libkea-process.a | sed -n 's/;;;; //p'
 
-   strings path/libcfgrpt.a | sed -n 's/;;;; //p'
+    # from sources using libcfgrpt.a
+    $ strings src/lib/process/cfgrpt/.libs/libcfgrpt.a | sed -n 's/;;;; //p'
 
 On startup, the server detects available network interfaces and
 attempts to open UDP sockets on all interfaces listed in the
@@ -1100,8 +1098,8 @@ gives the range of addresses in the pool.
 It is possible to define more than one pool in a subnet; continuing the
 previous example, further assume that 2001:db8:1:0:5::/80 should also be
 managed by the server. It could be written as 2001:db8:1:0:5:: to
-2001:db8:1::5:ffff:ffff:ffff, but typing so many ``f``s is cumbersome. It
-can be expressed more simply as 2001:db8:1:0:5::/80. Both formats are
+2001:db8:1::5:ffff:ffff:ffff, but typing so many ``f`` characters is cumbersome.
+It can be expressed more simply as 2001:db8:1:0:5::/80. Both formats are
 supported by ``Dhcp6`` and can be mixed in the pool list. For example,
 the following pools could be defined:
 
index f4bc9922cf4636d75841df4131da136a09182596..1118dbe2fe2e2dd30351ca5f7e5e06d97f41b935 100644 (file)
@@ -686,25 +686,22 @@ Starting and Stopping the NETCONF Agent
    is a copy of the ``config.report`` file produced by ``./configure``;
    it is embedded in the executable binary.
 
-The ``config.report`` file may also be accessed directly, via the
-following command. The binary ``path`` may be found in the install
-directory or in the ``.libs`` subdirectory in the source tree. For
-example: ``kea/src/lib/process/.libs/``.
+   The contents of the ``config.report`` file may also be accessed by examining
+   certain libraries in the installation tree or in the source tree.
 
-::
-
-   strings path/libkea-process.so | sed -n 's/;;;; //p'
+   .. code-block:: shell
 
-::
+    # from installation using libkea-process.so
+    $ strings ${prefix}/lib/libkea-process.so | sed -n 's/;;;; //p'
 
-   strings path/libkea-process.a | sed -n 's/;;;; //p'
+    # from sources using libkea-process.so
+    $ strings src/lib/process/.libs/libkea-process.so | sed -n 's/;;;; //p'
 
-The libcfgrpt.a library can also be used from the source tree with path:
-``src/lib/process/cfgrpt/.libs/``.
-
-::
+    # from sources using libkea-process.a
+    $ strings src/lib/process/.libs/libkea-process.a | sed -n 's/;;;; //p'
 
-   strings path/libcfgrpt.a | sed -n 's/;;;; //p'
+    # from sources using libcfgrpt.a
+    $ strings src/lib/process/cfgrpt/.libs/libcfgrpt.a | sed -n 's/;;;; //p'
 
 .. _operation-example:
 
index a818230965ac49d00d4f11887664a858ebb5023c..9a5f90712aa017b4cbf59b844182e6789dc7bd31 100644 (file)
@@ -783,7 +783,7 @@ The ``lease4-del``, ``lease6-del`` Commands
 
 ``lease4-del`` and ``lease6-del`` can be used to delete a lease from the lease database.
 There are two types of parameters these commands support, similar to the
-``lease4-get``and ``lease6-get`` commands: (``address``) for both v4 and v6, (``subnet-id``,
+``lease4-get`` and ``lease6-get`` commands: (``address``) for both v4 and v6, (``subnet-id``,
 ``identifier-type``, ``identifier``) for v4, and (``subnet-id``, ``identifier-type``,
 ``identifier``, ``type``, ``IAID``) for v6. The first type of query is used when the
 address (either IPv4 or IPv6) is known, but the details of the lease are
index 1061720dd0a873d163db52b882eaf37e0dbfa2cc..ee01e622fefe4112c4b9b508d62f9b6f9f73b017 100644 (file)
@@ -51,8 +51,9 @@ The arguments are as follows:
 
 ``-T config-file``
    Checks the configuration file and reports the first error, if any.
-   It performs extra checks beside ``-t`` is doing, like establising database
-   connections (lease db, host db, CB db, forensic logging db), hook libraries
+   It performs extra checks beside what ``-t`` is doing, like establising
+   database connections (lease backend, host reservations backend, configuration
+   backend and forensic logging backend), hook libraries
    loading and configuration parsing, etc. It does not open unix or TCP/UDP
    sockets, neither does it open or rotate files, as all these actions could
    interfere with a running process on the same machine.
index 86e2dc1d4fcc65bbb0ba8066c5c63794d9e38d61..696f67114b8b4cc71fac7261fe9dd13b6c0c127b 100644 (file)
@@ -51,8 +51,9 @@ The arguments are as follows:
 
 ``-T config-file``
    Checks the configuration file and reports the first error, if any.
-   It performs extra checks beside ``-t`` is doing, like establising database
-   connections (lease db, host db, CB db, forensic logging db), hook libraries
+   It performs extra checks beside what ``-t`` is doing, like establising
+   database connections (lease backend, host reservations backend, configuration
+   backend and forensic logging backend), hook libraries
    loading and configuration parsing, etc. It does not open unix or TCP/UDP
    sockets, neither does it open or rotate files, as all these actions could
    interfere with a running process on the same machine.
index b60f0d033c52da1ebc2f38156e1d1efa99fe7892..5891e157d17c2af650efa4628571aa200e557f69 100644 (file)
@@ -757,7 +757,45 @@ configureDhcp4Server(Dhcpv4Srv& server, isc::data::ConstElementPtr config_set,
     SrvConfigPtr srv_config;
 
     if (status_code == CONTROL_RESULT_SUCCESS) {
-        if (!check_only) {
+        if (check_only) {
+            if (extra_checks) {
+                // Re-open lease and host database with new parameters.
+                try {
+                    // Get the staging configuration.
+                    srv_config = CfgMgr::instance().getStagingCfg();
+
+                    CfgDbAccessPtr cfg_db = CfgMgr::instance().getStagingCfg()->getCfgDbAccess();
+                    string params = "universe=4 persist=false";
+                    if (cfg_db->getExtendedInfoTablesEnabled()) {
+                        params += " extended-info-tables=true";
+                    }
+                    cfg_db->setAppendedParameters(params);
+                    cfg_db->createManagers();
+                } catch (const std::exception& ex) {
+                    answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, ex.what());
+                    status_code = CONTROL_RESULT_ERROR;
+                }
+
+                if (status_code == CONTROL_RESULT_SUCCESS) {
+                    std::ostringstream err;
+                    // Configure DHCP packet queueing
+                    try {
+                        data::ConstElementPtr qc;
+                        qc = CfgMgr::instance().getStagingCfg()->getDHCPQueueControl();
+                        if (IfaceMgr::instance().configureDHCPPacketQueue(AF_INET, qc)) {
+                            LOG_INFO(dhcp4_logger, DHCP4_CONFIG_PACKET_QUEUE)
+                                     .arg(IfaceMgr::instance().getPacketQueue4()->getInfoStr());
+                        }
+
+                    } catch (const std::exception& ex) {
+                        err << "Error setting packet queue controls after server reconfiguration: "
+                            << ex.what();
+                        answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str());
+                        status_code = CONTROL_RESULT_ERROR;
+                    }
+                }
+            }
+        } else {
             string parameter_name;
             ElementPtr mutable_cfg;
 
@@ -805,25 +843,6 @@ configureDhcp4Server(Dhcpv4Srv& server, isc::data::ConstElementPtr config_set,
                                                    " processing error");
                 status_code = CONTROL_RESULT_ERROR;
             }
-        } else {
-            if (extra_checks) {
-                // Re-open lease and host database with new parameters.
-                try {
-                    // Get the staging configuration.
-                    srv_config = CfgMgr::instance().getStagingCfg();
-
-                    CfgDbAccessPtr cfg_db = CfgMgr::instance().getStagingCfg()->getCfgDbAccess();
-                    string params = "universe=4 persist=false";
-                    if (cfg_db->getExtendedInfoTablesEnabled()) {
-                        params += " extended-info-tables=true";
-                    }
-                    cfg_db->setAppendedParameters(params);
-                    cfg_db->createManagers();
-                } catch (const std::exception& ex) {
-                    answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, ex.what());
-                    status_code = CONTROL_RESULT_ERROR;
-                }
-            }
         }
     }
 
@@ -897,13 +916,9 @@ configureDhcp4Server(Dhcpv4Srv& server, isc::data::ConstElementPtr config_set,
     // Moved from the commit block to add the config backend indication.
     if (status_code == CONTROL_RESULT_SUCCESS && (!check_only || extra_checks)) {
         try {
-            if (extra_checks) {
-                server.getCBControl()->databaseConfigConnect(srv_config);
-            } else {
-                // If there are config backends, fetch and merge into staging config
-                server.getCBControl()->databaseConfigFetch(srv_config,
-                                                           CBControlDHCPv4::FetchMode::FETCH_ALL);
-            }
+            // If there are config backends, fetch and merge into staging config
+            server.getCBControl()->databaseConfigFetch(srv_config,
+                                                       CBControlDHCPv4::FetchMode::FETCH_ALL);
         } catch (const isc::Exception& ex) {
             std::ostringstream err;
             err << "during update from config backend database: " << ex.what();
index 82f250299f7ec3b8bff2bcd641fc320252638cf7..e7aa68790b775bd9a54b89fe793faf2a1fc9113f 100644 (file)
@@ -289,22 +289,16 @@ syntax_check_test() {
     local test_name="${1}"
     local config="${2}"
     local expected_code="${3}"
-    local extra_check="${4}"
+    local check_type="${4}"
 
     # Log the start of the test and print test name.
     test_start "${test_name}"
     # Create correct configuration file.
     create_config "${config}"
     # Check it
-    if [ "${extra_check}" -eq 1 ]; then
-        printf "Running command %s.\n" "\"${bin_path}/${bin} -T ${CFG_FILE}\""
-        run_command \
-            "${bin_path}/${bin}" -T "${CFG_FILE}"
-    else
-        printf "Running command %s.\n" "\"${bin_path}/${bin} -t ${CFG_FILE}\""
-        run_command \
-            "${bin_path}/${bin}" -t "${CFG_FILE}"
-    fi
+    printf "Running command %s.\n" "\"${bin_path}/${bin} ${check_type} ${CFG_FILE}\""
+    run_command \
+        "${bin_path}/${bin}" "${check_type}" "${CFG_FILE}"
     if [ "${EXIT_CODE}" -ne "${expected_code}" ]; then
         printf 'ERROR: expected exit code %s, got %s\n' "${expected_code}" "${EXIT_CODE}"
         clean_exit 1
@@ -583,9 +577,9 @@ shutdown_test "dhcpv4.sigint_test" 2
 version_test "dhcpv4.version"
 logger_vars_test "dhcpv4.variables"
 lfc_timer_test
-syntax_check_test "dhcpv4.syntax_check_success" "${CONFIG}" 0 0
-syntax_check_test "dhcpv4.syntax_check_bad_syntax" "${CONFIG_BAD_SYNTAX}" 1 0
-syntax_check_test "dhcpv4.syntax_check_bad_values" "${CONFIG_BAD_VALUES}" 1 0
-syntax_check_test "dhcpv4.syntax_check_hooks_load_fail" "${INVALID_CONFIG_HOOKS_LOAD}" 1 1
-syntax_check_test "dhcpv4.syntax_check_hooks_callout_fail" "${INVALID_CONFIG_HOOKS_CALLOUT_FAIL}" 1 1
+syntax_check_test "dhcpv4.syntax_check_success" "${CONFIG}" 0 -t
+syntax_check_test "dhcpv4.syntax_check_bad_syntax" "${CONFIG_BAD_SYNTAX}" 1 -t
+syntax_check_test "dhcpv4.syntax_check_bad_values" "${CONFIG_BAD_VALUES}" 1 -t
+syntax_check_test "dhcpv4.syntax_check_hooks_load_fail" "${INVALID_CONFIG_HOOKS_LOAD}" 1 -T
+syntax_check_test "dhcpv4.syntax_check_hooks_callout_fail" "${INVALID_CONFIG_HOOKS_CALLOUT_FAIL}" 1 -T
 password_redact_test "dhcpv4.password_redact_test" "$(kea_dhcp_config 4)" 0
index 96cb4630d81f6dd99ff87e5773fce869f2e88937..f7151afda100a2bf0fa455f544c3190bb39915d5 100644 (file)
@@ -886,7 +886,45 @@ configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set,
     SrvConfigPtr srv_config;
 
     if (status_code == CONTROL_RESULT_SUCCESS) {
-        if (!check_only) {
+        if (check_only) {
+            if (extra_checks) {
+                // Re-open lease and host database with new parameters.
+                try {
+                    // Get the staging configuration.
+                    srv_config = CfgMgr::instance().getStagingCfg();
+
+                    CfgDbAccessPtr cfg_db = CfgMgr::instance().getStagingCfg()->getCfgDbAccess();
+                    string params = "universe=6 persist=false";
+                    if (cfg_db->getExtendedInfoTablesEnabled()) {
+                        params += " extended-info-tables=true";
+                    }
+                    cfg_db->setAppendedParameters(params);
+                    cfg_db->createManagers();
+                } catch (const std::exception& ex) {
+                    answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, ex.what());
+                    status_code = CONTROL_RESULT_ERROR;
+                }
+
+                if (status_code == CONTROL_RESULT_SUCCESS) {
+                    std::ostringstream err;
+                    // Configure DHCP packet queueing
+                    try {
+                        data::ConstElementPtr qc;
+                        qc = CfgMgr::instance().getStagingCfg()->getDHCPQueueControl();
+                        if (IfaceMgr::instance().configureDHCPPacketQueue(AF_INET6, qc)) {
+                            LOG_INFO(dhcp6_logger, DHCP6_CONFIG_PACKET_QUEUE)
+                                     .arg(IfaceMgr::instance().getPacketQueue6()->getInfoStr());
+                        }
+
+                    } catch (const std::exception& ex) {
+                        err << "Error setting packet queue controls after server reconfiguration: "
+                            << ex.what();
+                        answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str());
+                        status_code = CONTROL_RESULT_ERROR;
+                    }
+                }
+            }
+        } else {
             string parameter_name;
             ElementPtr mutable_cfg;
 
@@ -934,25 +972,6 @@ configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set,
                                                    " processing error");
                 status_code = CONTROL_RESULT_ERROR;
             }
-        } else {
-            if (extra_checks) {
-                // Re-open lease and host database with new parameters.
-                try {
-                    // Get the staging configuration.
-                    srv_config = CfgMgr::instance().getStagingCfg();
-
-                    CfgDbAccessPtr cfg_db = CfgMgr::instance().getStagingCfg()->getCfgDbAccess();
-                    string params = "universe=6 persist=false";
-                    if (cfg_db->getExtendedInfoTablesEnabled()) {
-                        params += " extended-info-tables=true";
-                    }
-                    cfg_db->setAppendedParameters(params);
-                    cfg_db->createManagers();
-                } catch (const std::exception& ex) {
-                    answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, ex.what());
-                    status_code = CONTROL_RESULT_ERROR;
-                }
-            }
         }
     }
 
@@ -1026,13 +1045,9 @@ configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set,
     // Moved from the commit block to add the config backend indication.
     if (status_code == CONTROL_RESULT_SUCCESS && (!check_only || extra_checks)) {
         try {
-            if (extra_checks) {
-                server.getCBControl()->databaseConfigConnect(srv_config);
-            } else {
-                // If there are config backends, fetch and merge into staging config
-                server.getCBControl()->databaseConfigFetch(srv_config,
-                                                           CBControlDHCPv6::FetchMode::FETCH_ALL);
-            }
+            // If there are config backends, fetch and merge into staging config
+            server.getCBControl()->databaseConfigFetch(srv_config,
+                                                       CBControlDHCPv6::FetchMode::FETCH_ALL);
         } catch (const isc::Exception& ex) {
             std::ostringstream err;
             err << "during update from config backend database: " << ex.what();
index 9cd2bc6bc8b22117cb9dabe840ac122d7f7a98f2..cf8252c13618dd565f9363090c49213cb044d956 100644 (file)
@@ -306,22 +306,16 @@ syntax_check_test() {
     local test_name="${1}"
     local config="${2}"
     local expected_code="${3}"
-    local extra_check="${4}"
+    local check_type="${4}"
 
     # Log the start of the test and print test name.
     test_start "${test_name}"
     # Create correct configuration file.
     create_config "${config}"
     # Check it
-    if [ "${extra_check}" -eq 1 ]; then
-        printf "Running command %s.\n" "\"${bin_path}/${bin} -T ${CFG_FILE}\""
-        run_command \
-            "${bin_path}/${bin}" -T "${CFG_FILE}"
-    else
-        printf "Running command %s.\n" "\"${bin_path}/${bin} -t ${CFG_FILE}\""
-        run_command \
-            "${bin_path}/${bin}" -t "${CFG_FILE}"
-    fi
+    printf "Running command %s.\n" "\"${bin_path}/${bin} ${check_type} ${CFG_FILE}\""
+    run_command \
+        "${bin_path}/${bin}" "${check_type}" "${CFG_FILE}"
     if [ "${EXIT_CODE}" -ne "${expected_code}" ]; then
         printf 'ERROR: expected exit code %s, got %s\n' "${expected_code}" "${EXIT_CODE}"
         clean_exit 1
@@ -603,9 +597,9 @@ shutdown_test "dhcpv6.sigint_test" 2
 version_test "dhcpv6.version"
 logger_vars_test "dhcpv6.variables"
 lfc_timer_test
-syntax_check_test "dhcpv6.syntax_check_success" "${CONFIG}" 0 0
-syntax_check_test "dhcpv6.syntax_check_bad_syntax" "${CONFIG_BAD_SYNTAX}" 1 0
-syntax_check_test "dhcpv6.syntax_check_bad_values" "${CONFIG_BAD_VALUES}" 1 0
-syntax_check_test "dhcpv6.syntax_check_hooks_load_fail" "${INVALID_CONFIG_HOOKS_LOAD}" 1 1
-syntax_check_test "dhcpv6.syntax_check_hooks_callout_fail" "${INVALID_CONFIG_HOOKS_CALLOUT_FAIL}" 1 1
+syntax_check_test "dhcpv6.syntax_check_success" "${CONFIG}" 0 -t
+syntax_check_test "dhcpv6.syntax_check_bad_syntax" "${CONFIG_BAD_SYNTAX}" 1 -t
+syntax_check_test "dhcpv6.syntax_check_bad_values" "${CONFIG_BAD_VALUES}" 1 -t
+syntax_check_test "dhcpv6.syntax_check_hooks_load_fail" "${INVALID_CONFIG_HOOKS_LOAD}" 1 -T
+syntax_check_test "dhcpv6.syntax_check_hooks_callout_fail" "${INVALID_CONFIG_HOOKS_CALLOUT_FAIL}" 1 -T
 password_redact_test "dhcpv6.password_redact_test" "$(kea_dhcp_config 6)" 0