]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[904-add-ability-to-force-a-cb-update-remotely] Addressed last comments
authorFrancis Dupont <fdupont@isc.org>
Fri, 25 Oct 2019 20:47:24 +0000 (22:47 +0200)
committerFrancis Dupont <fdupont@isc.org>
Mon, 28 Oct 2019 09:33:38 +0000 (10:33 +0100)
13 files changed:
doc/sphinx/arm/ctrl-channel.rst
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp4/dhcp4_messages.cc
src/bin/dhcp4/dhcp4_messages.h
src/bin/dhcp4/dhcp4_messages.mes
src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
src/bin/dhcp6/ctrl_dhcp6_srv.cc
src/bin/dhcp6/ctrl_dhcp6_srv.h
src/bin/dhcp6/dhcp6_messages.cc
src/bin/dhcp6/dhcp6_messages.h
src/bin/dhcp6/dhcp6_messages.mes
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
src/bin/dhcp6/tests/kea_controller_unittest.cc

index f5e0b5452d151f98b164e6ae7cf4e5caf22d7325..4c609704b4aca8413bc8d7f01b8cb26867256a81 100644 (file)
@@ -549,7 +549,7 @@ the DHCPv4 or DHCPv6 server (:ref:`cb-sharing` explains the server tag concept)
 .. _command-config-backend-pull:
 
 The config-backend-pull Command:
---------------------------
+--------------------------~~~~~~
 
 The ``config-backend-pull`` command triggers the polling of Config Backends
 (which should be configured for this command to do something)
index 08f9bc0615e909bef6d4729ba4afec88e504a1c2..923daef33df34f2a9103c6b289bb628dbe374a22 100644 (file)
@@ -564,7 +564,7 @@ ControlledDhcpv4Srv::commandConfigBackendPullHandler(const std::string&,
         auto mode = CBControlDHCPv4::FetchMode::FETCH_UPDATE;
         server_->getCBControl()->databaseConfigFetch(srv_cfg, mode);
     } catch (const std::exception& ex) {
-        LOG_ERROR(dhcp4_logger, DHCP4_CB_PULL_FAIL)
+        LOG_ERROR(dhcp4_logger, DHCP4_CB_PULL_FETCH_UPDATES_FAIL)
             .arg(ex.what());
         return (createAnswer(CONTROL_RESULT_ERROR,
                              "Server update failed: " + string(ex.what())));
@@ -1076,14 +1076,15 @@ ControlledDhcpv4Srv::cbFetchUpdates(const SrvConfigPtr& srv_cfg,
         (*failure_count) = 0;
 
     } catch (const std::exception& ex) {
-        LOG_ERROR(dhcp4_logger, DHCP4_CB_FETCH_UPDATES_FAIL)
+        LOG_ERROR(dhcp4_logger, DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL)
             .arg(ex.what());
 
         // We allow at most 10 consecutive failures after which we stop
         // making further attempts to fetch the configuration updates.
         // Let's return without re-scheduling the timer.
         if (++(*failure_count) > 10) {
-            LOG_ERROR(dhcp4_logger, DHCP4_CB_FETCH_UPDATES_RETRIES_EXHAUSTED);
+            LOG_ERROR(dhcp4_logger,
+                      DHCP4_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED);
             return;
         }
     }
index 4935291624ddda7b0c7bdab31123b61a977fcfca..ab88a09c6d5a4f4c88635ccb2d2a1b0194b1a354 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Fri Oct 25 2019 18:13
+// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Fri Oct 25 2019 22:42
 
 #include <cstddef>
 #include <log/message_types.h>
@@ -13,9 +13,9 @@ extern const isc::log::MessageID DHCP4_BUFFER_RECEIVED = "DHCP4_BUFFER_RECEIVED"
 extern const isc::log::MessageID DHCP4_BUFFER_RECEIVE_FAIL = "DHCP4_BUFFER_RECEIVE_FAIL";
 extern const isc::log::MessageID DHCP4_BUFFER_UNPACK = "DHCP4_BUFFER_UNPACK";
 extern const isc::log::MessageID DHCP4_BUFFER_WAIT_SIGNAL = "DHCP4_BUFFER_WAIT_SIGNAL";
-extern const isc::log::MessageID DHCP4_CB_FETCH_UPDATES_FAIL = "DHCP4_CB_FETCH_UPDATES_FAIL";
-extern const isc::log::MessageID DHCP4_CB_FETCH_UPDATES_RETRIES_EXHAUSTED = "DHCP4_CB_FETCH_UPDATES_RETRIES_EXHAUSTED";
-extern const isc::log::MessageID DHCP4_CB_PULL_FAIL = "DHCP4_CB_PULL_FAIL";
+extern const isc::log::MessageID DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL = "DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL";
+extern const isc::log::MessageID DHCP4_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED = "DHCP4_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED";
+extern const isc::log::MessageID DHCP4_CB_PULL_FETCH_UPDATES_FAIL = "DHCP4_CB_PULL_FETCH_UPDATES_FAIL";
 extern const isc::log::MessageID DHCP4_CLASS_ASSIGNED = "DHCP4_CLASS_ASSIGNED";
 extern const isc::log::MessageID DHCP4_CLASS_UNCONFIGURED = "DHCP4_CLASS_UNCONFIGURED";
 extern const isc::log::MessageID DHCP4_CLASS_UNDEFINED = "DHCP4_CLASS_UNDEFINED";
@@ -151,9 +151,9 @@ const char* values[] = {
     "DHCP4_BUFFER_RECEIVE_FAIL", "error on attempt to receive packet: %1",
     "DHCP4_BUFFER_UNPACK", "parsing buffer received from %1 to %2 over interface %3",
     "DHCP4_BUFFER_WAIT_SIGNAL", "signal received while waiting for next packet, next waiting signal is %1",
-    "DHCP4_CB_FETCH_UPDATES_FAIL", "error on attempt to fetch configuration updates from the configuration backend(s): %1",
-    "DHCP4_CB_FETCH_UPDATES_RETRIES_EXHAUSTED", "maximum number of configuration fetch attempts: 10, has been exhausted without success",
-    "DHCP4_CB_PULL_FAIL", "error on pull configuration updates from the configuration backend(s): %1",
+    "DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL", "error on periodic attempt to fetch configuration updates from the configuration backend(s): %1",
+    "DHCP4_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED", "maximum number of configuration fetch attempts: 10, has been exhausted without success",
+    "DHCP4_CB_PULL_FETCH_UPDATES_FAIL", "error on pull attempt to fetch configuration updates from the configuration backend(s): %1",
     "DHCP4_CLASS_ASSIGNED", "%1: client packet has been assigned to the following class(es): %2",
     "DHCP4_CLASS_UNCONFIGURED", "%1: client packet belongs to an unconfigured class: %2",
     "DHCP4_CLASS_UNDEFINED", "required class %1 has no definition",
index 577771ced11dc9c5bf2822b08d10125341e92cf0..1b9bee80eef6cfc2b9e5b4af904376512b66fb7e 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Fri Oct 25 2019 18:13
+// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Fri Oct 25 2019 22:42
 
 #ifndef DHCP4_MESSAGES_H
 #define DHCP4_MESSAGES_H
@@ -14,9 +14,9 @@ extern const isc::log::MessageID DHCP4_BUFFER_RECEIVED;
 extern const isc::log::MessageID DHCP4_BUFFER_RECEIVE_FAIL;
 extern const isc::log::MessageID DHCP4_BUFFER_UNPACK;
 extern const isc::log::MessageID DHCP4_BUFFER_WAIT_SIGNAL;
-extern const isc::log::MessageID DHCP4_CB_FETCH_UPDATES_FAIL;
-extern const isc::log::MessageID DHCP4_CB_FETCH_UPDATES_RETRIES_EXHAUSTED;
-extern const isc::log::MessageID DHCP4_CB_PULL_FAIL;
+extern const isc::log::MessageID DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL;
+extern const isc::log::MessageID DHCP4_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED;
+extern const isc::log::MessageID DHCP4_CB_PULL_FETCH_UPDATES_FAIL;
 extern const isc::log::MessageID DHCP4_CLASS_ASSIGNED;
 extern const isc::log::MessageID DHCP4_CLASS_UNCONFIGURED;
 extern const isc::log::MessageID DHCP4_CLASS_UNDEFINED;
index d88d26cf920378a01e3e1704fe586b4e93f82656..1fc6c19d4fb7e0b782150a6fb65145da7b5d9dcf 100644 (file)
@@ -46,23 +46,23 @@ by the process. The signal will be handled before the server starts
 waiting for next packets. The argument specifies the next signal to
 be handled by the server.
 
-% DHCP4_CB_FETCH_UPDATES_FAIL error on attempt to fetch configuration updates from the configuration backend(s): %1
+% DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL error on periodic attempt to fetch configuration updates from the configuration backend(s): %1
 This error message is issued when the server attempted to fetch
-configuration updates from the database and this attempt failed.
+configuration updates from the database and this periodic attempt failed.
 The server will re-try according to the configured value of the
 config-fetch-wait-time parameter. The sole argument contains the
 reason for failure.
 
-% DHCP4_CB_FETCH_UPDATES_RETRIES_EXHAUSTED maximum number of configuration fetch attempts: 10, has been exhausted without success
+% DHCP4_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED maximum number of configuration fetch attempts: 10, has been exhausted without success
 This error indicates that the server has made a number of unsuccessful
-attempts to fetch configuration updates from a configuration backend.
+periodic attempts to fetch configuration updates from a configuration backend.
 The server will continue to operate but won't make any further attempts
 to fetch configuration updates. The administrator must fix the configuration
 in the database and reload (or restart) the server.
 
-% DHCP4_CB_PULL_FAIL error on pull configuration updates from the configuration backend(s): %1
-This error message is issued when the server attempted to pull
-configuration updates from the database and this attempt failed.
+% DHCP4_CB_PULL_FETCH_UPDATES_FAIL error on pull attempt to fetch configuration updates from the configuration backend(s): %1
+This error message is issued when the server attempted to fetch
+configuration updates from the database and this pull attempt failed.
 The sole argument which is returned to the config-backend-pull command
 caller too contains the reason for failure.
 
index 3e78609c380ec2d716203ae538755dd8c26c482d..029055ac3d80a8a5fbc45dc675435ef944959917 100644 (file)
@@ -479,13 +479,13 @@ TEST_F(CtrlChannelDhcpv4SrvTest, commandsRegistration) {
 
     EXPECT_TRUE(command_list.find("\"list-commands\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"build-report\"") != string::npos);
+    EXPECT_TRUE(command_list.find("\"config-backend-pull\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"config-get\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"config-set\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"config-write\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"leases-reclaim\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"libreload\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"server-tag-get\"") != string::npos);
-    EXPECT_TRUE(command_list.find("\"config-backend-pull\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"shutdown\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"statistic-get\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"statistic-get-all\"") != string::npos);
@@ -1149,6 +1149,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, listCommands) {
 
     // We expect the server to report at least the following commands:
     checkListCommands(rsp, "build-report");
+    checkListCommands(rsp, "config-backend-pull");
     checkListCommands(rsp, "config-get");
     checkListCommands(rsp, "config-reload");
     checkListCommands(rsp, "config-set");
@@ -1159,7 +1160,6 @@ TEST_F(CtrlChannelDhcpv4SrvTest, listCommands) {
     checkListCommands(rsp, "libreload");
     checkListCommands(rsp, "version-get");
     checkListCommands(rsp, "server-tag-get");
-    checkListCommands(rsp, "config-backend-pull");
     checkListCommands(rsp, "shutdown");
     checkListCommands(rsp, "statistic-get");
     checkListCommands(rsp, "statistic-get-all");
index 9f86128b4857a48aa08551a802f6a3562bd3cbe1..13093ddf5dd94d31bc833f67de5b17f0db28bb2b 100644 (file)
@@ -545,8 +545,8 @@ ControlledDhcpv6Srv::commandServerTagGetHandler(const std::string&,
 }
 
 ConstElementPtr
-ControlledDhcpv6Srv::commandServerUpdateHandler(const std::string&,
-                                                      ConstElementPtr) {
+ControlledDhcpv6Srv::commandConfigBackendPullHandler(const std::string&,
+                                                     ConstElementPtr) {
     auto ctl_info = CfgMgr::instance().getCurrentCfg()->getConfigControlInfo();
     if (!ctl_info) {
         return (createAnswer(CONTROL_RESULT_EMPTY, "No config backend."));
@@ -564,8 +564,7 @@ ControlledDhcpv6Srv::commandServerUpdateHandler(const std::string&,
         auto mode = CBControlDHCPv6::FetchMode::FETCH_UPDATE;
         server_->getCBControl()->databaseConfigFetch(srv_cfg, mode);
     } catch (const std::exception& ex) {
-        LOG_ERROR(dhcp6_logger, DHCP6_CB_FETCH_UPDATES_FAIL)
-            .arg("server-update command")
+        LOG_ERROR(dhcp6_logger, DHCP6_CB_PULL_FETCH_UPDATES_FAIL)
             .arg(ex.what());
         return (createAnswer(CONTROL_RESULT_ERROR,
                              "Server update failed: " + string(ex.what())));
@@ -630,8 +629,8 @@ ControlledDhcpv6Srv::processCommand(const std::string& command,
         } else if (command == "server-tag-get") {
             return (srv->commandServerTagGetHandler(command, args));
 
-        } else if (command == "server-update") {
-            return (srv->commandServerUpdateHandler(command, args));
+        } else if (command == "config-backend-pull") {
+            return (srv->commandConfigBackendPullHandler(command, args));
 
         }
 
@@ -859,6 +858,9 @@ ControlledDhcpv6Srv::ControlledDhcpv6Srv(uint16_t server_port,
     CommandMgr::instance().registerCommand("build-report",
         boost::bind(&ControlledDhcpv6Srv::commandBuildReportHandler, this, _1, _2));
 
+    CommandMgr::instance().registerCommand("config-backend-pull",
+        boost::bind(&ControlledDhcpv6Srv::commandConfigBackendPullHandler, this, _1, _2));
+
     CommandMgr::instance().registerCommand("config-get",
         boost::bind(&ControlledDhcpv6Srv::commandConfigGetHandler, this, _1, _2));
 
@@ -883,9 +885,6 @@ ControlledDhcpv6Srv::ControlledDhcpv6Srv(uint16_t server_port,
     CommandMgr::instance().registerCommand("server-tag-get",
         boost::bind(&ControlledDhcpv6Srv::commandServerTagGetHandler, this, _1, _2));
 
-    CommandMgr::instance().registerCommand("server-update",
-        boost::bind(&ControlledDhcpv6Srv::commandServerUpdateHandler, this, _1, _2));
-
     CommandMgr::instance().registerCommand("libreload",
         boost::bind(&ControlledDhcpv6Srv::commandLibReloadHandler, this, _1, _2));
 
@@ -950,6 +949,7 @@ ControlledDhcpv6Srv::~ControlledDhcpv6Srv() {
 
         // Deregister any registered commands (please keep in alphabetic order)
         CommandMgr::instance().deregisterCommand("build-report");
+        CommandMgr::instance().deregisterCommand("config-backend-pull");
         CommandMgr::instance().deregisterCommand("config-get");
         CommandMgr::instance().deregisterCommand("config-set");
         CommandMgr::instance().deregisterCommand("config-reload");
@@ -960,7 +960,6 @@ ControlledDhcpv6Srv::~ControlledDhcpv6Srv() {
         CommandMgr::instance().deregisterCommand("leases-reclaim");
         CommandMgr::instance().deregisterCommand("libreload");
         CommandMgr::instance().deregisterCommand("server-tag-get");
-        CommandMgr::instance().deregisterCommand("server-update");
         CommandMgr::instance().deregisterCommand("shutdown");
         CommandMgr::instance().deregisterCommand("statistic-get");
         CommandMgr::instance().deregisterCommand("statistic-get-all");
@@ -1095,7 +1094,7 @@ ControlledDhcpv6Srv::cbFetchUpdates(const SrvConfigPtr& srv_cfg,
         (*failure_count) = 0;
 
     } catch (const std::exception& ex) {
-        LOG_ERROR(dhcp6_logger, DHCP6_CB_FETCH_UPDATES_FAIL)
+        LOG_ERROR(dhcp6_logger, DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL)
             .arg("periodic poll")
             .arg(ex.what());
 
@@ -1103,7 +1102,8 @@ ControlledDhcpv6Srv::cbFetchUpdates(const SrvConfigPtr& srv_cfg,
         // making further attempts to fetch the configuration updates.
         // Let's return without re-scheduling the timer.
         if (++(*failure_count) > 10) {
-            LOG_ERROR(dhcp6_logger, DHCP6_CB_FETCH_UPDATES_RETRIES_EXHAUSTED);
+            LOG_ERROR(dhcp6_logger,
+                      DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED);
             return;
         }
     }
index 0be001c30e384cc2e817c74480dfde3ffe6a0093..fbe72523374a2424e7685c6deab8f2e54f9fefed 100644 (file)
@@ -303,9 +303,9 @@ private:
     commandServerTagGetHandler(const std::string& command,
                                isc::data::ConstElementPtr args);
 
-    /// @brief handler for server-update command
+    /// @brief handler for config-backend-pull command
     ///
-    /// This method handles the server-update command, which updates
+    /// This method handles the config-backend-pull command, which updates
     /// the server configuration from the Config Backends immediately.
     ///
     /// @param command (parameter ignored)
@@ -313,8 +313,8 @@ private:
     ///
     /// @return status of the command/
     isc::data::ConstElementPtr
-    commandServerUpdateHandler(const std::string& command,
-                               isc::data::ConstElementPtr args);
+    commandConfigBackendPullHandler(const std::string& command,
+                                    isc::data::ConstElementPtr args);
 
     /// @brief Reclaims expired IPv6 leases and reschedules timer.
     ///
index 1c47f130c69431bd0aab44a403ef7c2ea70ae350..3c5fc074e902f06a00381df7902858e57a6ed4a8 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Fri Oct 25 2019 16:41
+// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Fri Oct 25 2019 22:42
 
 #include <cstddef>
 #include <log/message_types.h>
@@ -14,8 +14,9 @@ extern const isc::log::MessageID DHCP6_ALREADY_RUNNING = "DHCP6_ALREADY_RUNNING"
 extern const isc::log::MessageID DHCP6_BUFFER_RECEIVED = "DHCP6_BUFFER_RECEIVED";
 extern const isc::log::MessageID DHCP6_BUFFER_UNPACK = "DHCP6_BUFFER_UNPACK";
 extern const isc::log::MessageID DHCP6_BUFFER_WAIT_SIGNAL = "DHCP6_BUFFER_WAIT_SIGNAL";
-extern const isc::log::MessageID DHCP6_CB_FETCH_UPDATES_FAIL = "DHCP6_CB_FETCH_UPDATES_FAIL";
-extern const isc::log::MessageID DHCP6_CB_FETCH_UPDATES_RETRIES_EXHAUSTED = "DHCP6_CB_FETCH_UPDATES_RETRIES_EXHAUSTED";
+extern const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL = "DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL";
+extern const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED = "DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED";
+extern const isc::log::MessageID DHCP6_CB_PULL_FETCH_UPDATES_FAIL = "DHCP6_CB_PULL_FETCH_UPDATES_FAIL";
 extern const isc::log::MessageID DHCP6_CLASS_ASSIGNED = "DHCP6_CLASS_ASSIGNED";
 extern const isc::log::MessageID DHCP6_CLASS_UNCONFIGURED = "DHCP6_CLASS_UNCONFIGURED";
 extern const isc::log::MessageID DHCP6_CLASS_UNDEFINED = "DHCP6_CLASS_UNDEFINED";
@@ -157,8 +158,9 @@ const char* values[] = {
     "DHCP6_BUFFER_RECEIVED", "received buffer from %1:%2 to %3:%4 over interface %5",
     "DHCP6_BUFFER_UNPACK", "parsing buffer received from %1 to %2 over interface %3",
     "DHCP6_BUFFER_WAIT_SIGNAL", "signal received while waiting for next packet, next waiting signal is %1",
-    "DHCP6_CB_FETCH_UPDATES_FAIL", "error on attempt to fetch configuration updates from the configuration backend(s): %1",
-    "DHCP6_CB_FETCH_UPDATES_RETRIES_EXHAUSTED", "maximum number of configuration fetch attempts: 10, has been exhausted without success",
+    "DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL", "error on periodic attempt to fetch configuration updates from the configuration backend(s): %1",
+    "DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED", "maximum number of configuration fetch attempts: 10, has been exhausted without success",
+    "DHCP6_CB_PULL_FETCH_UPDATES_FAIL", "error on pull attempt to fetch configuration updates from the configuration backend(s): %1",
     "DHCP6_CLASS_ASSIGNED", "%1: client packet has been assigned to the following class(es): %2",
     "DHCP6_CLASS_UNCONFIGURED", "%1: client packet belongs to an unconfigured class: %2",
     "DHCP6_CLASS_UNDEFINED", "required class %1 has no definition",
index c5a99b6e5b446175c93b5cf824205a3ff4e47cf8..3d708d369fec0b64bdf67543631104c854de4d54 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Fri Oct 25 2019 16:41
+// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Fri Oct 25 2019 22:42
 
 #ifndef DHCP6_MESSAGES_H
 #define DHCP6_MESSAGES_H
@@ -15,8 +15,9 @@ extern const isc::log::MessageID DHCP6_ALREADY_RUNNING;
 extern const isc::log::MessageID DHCP6_BUFFER_RECEIVED;
 extern const isc::log::MessageID DHCP6_BUFFER_UNPACK;
 extern const isc::log::MessageID DHCP6_BUFFER_WAIT_SIGNAL;
-extern const isc::log::MessageID DHCP6_CB_FETCH_UPDATES_FAIL;
-extern const isc::log::MessageID DHCP6_CB_FETCH_UPDATES_RETRIES_EXHAUSTED;
+extern const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL;
+extern const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED;
+extern const isc::log::MessageID DHCP6_CB_PULL_FETCH_UPDATES_FAIL;
 extern const isc::log::MessageID DHCP6_CLASS_ASSIGNED;
 extern const isc::log::MessageID DHCP6_CLASS_UNCONFIGURED;
 extern const isc::log::MessageID DHCP6_CLASS_UNDEFINED;
index d6e08f49abec31a3f090c65d91c529417cd6247d..304a1c68f6f89a113765da783784a188781b66c6 100644 (file)
@@ -53,22 +53,26 @@ by the process. The signal will be handled before the server starts
 waiting for next packets. The argument specifies the next signal to
 be handled by the server.
 
-% DHCP6_CB_FETCH_UPDATES_FAIL error on attempt to fetch configuration updates from the configuration backend(s): %1
+% DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL error on periodic attempt to fetch configuration updates from the configuration backend(s): %1
 This error message is issued when the server attempted to fetch
-configuration updates from the database and this attempt failed.
-If the error happens during periodic poll, the server will re-try
-according to the configured value of the config-fetch-wait-time
-parameter. The arguments contain the fetch context, i.e. during
-periodic poll or by the server-update command, and the reason for
-failure.
-
-% DHCP6_CB_FETCH_UPDATES_RETRIES_EXHAUSTED maximum number of configuration fetch attempts: 10, has been exhausted without success
+configuration updates from the database and this periodic attempt failed.
+The server will re-try according to the configured value of the
+config-fetch-wait-time parameter. The sole argument contains the
+reason for failure.
+
+% DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED maximum number of configuration fetch attempts: 10, has been exhausted without success
 This error indicates that the server has made a number of unsuccessful
-attempts to fetch configuration updates from a configuration backend.
+periodic attempts to fetch configuration updates from a configuration backend.
 The server will continue to operate but won't make any further attempts
 to fetch configuration updates. The administrator must fix the configuration
 in the database and reload (or restart) the server.
 
+% DHCP6_CB_PULL_FETCH_UPDATES_FAIL error on pull attempt to fetch configuration updates from the configuration backend(s): %1
+This error message is issued when the server attempted to fetch
+configuration updates from the database and this pull attempt failed.
+The sole argument which is returned to the config-backend-pull command
+caller too contains the reason for failure.
+
 % DHCP6_CLASS_ASSIGNED %1: client packet has been assigned to the following class(es): %2
 This debug message informs that incoming packet has been assigned to specified
 class or classes. This is a normal behavior and indicates successful operation.
index 06fcbba27a817bad3f9d00e9794c98253d7ebc93..44890b1b2ca378122e417486a3b84860f647db3d 100644 (file)
@@ -498,13 +498,13 @@ TEST_F(CtrlDhcpv6SrvTest, commandsRegistration) {
 
     EXPECT_TRUE(command_list.find("\"list-commands\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"build-report\"") != string::npos);
+    EXPECT_TRUE(command_list.find("\"config-backend-pull\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"config-get\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"config-set\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"config-write\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"leases-reclaim\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"libreload\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"server-tag-get\"") != string::npos);
-    EXPECT_TRUE(command_list.find("\"server-update\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"shutdown\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"statistic-get\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"statistic-get-all\"") != string::npos);
@@ -938,15 +938,15 @@ TEST_F(CtrlChannelDhcpv6SrvTest, serverTagGet) {
     expected = "{ \"arguments\": { \"server-tag\": \"foobar\" }, \"result\": 0 }";
 }
 
-// This test verifies that the DHCP server handles server-update command
-TEST_F(CtrlChannelDhcpv6SrvTest, serverUpdate) {
+// This test verifies that the DHCP server handles config-backend-pull command
+TEST_F(CtrlChannelDhcpv6SrvTest, configBackendPull) {
     createUnixChannelServer();
 
     std::string response;
     std::string expected;
 
-    // Send the server-update command. Note there is no configured backed.
-    sendUnixCommand("{ \"command\": \"server-update\" }", response);
+    // Send the config-backend-pull command. Note there is no configured backed.
+    sendUnixCommand("{ \"command\": \"config-backend-pull\" }", response);
     expected = "{ \"result\": 3, \"text\": \"No config backend.\" }";
     EXPECT_EQ(expected, response);
 }
@@ -1180,6 +1180,7 @@ TEST_F(CtrlChannelDhcpv6SrvTest, listCommands) {
 
     // We expect the server to report at least the following commands:
     checkListCommands(rsp, "build-report");
+    checkListCommands(rsp, "config-backend-pull");
     checkListCommands(rsp, "config-get");
     checkListCommands(rsp, "config-reload");
     checkListCommands(rsp, "config-set");
@@ -1190,7 +1191,6 @@ TEST_F(CtrlChannelDhcpv6SrvTest, listCommands) {
     checkListCommands(rsp, "libreload");
     checkListCommands(rsp, "version-get");
     checkListCommands(rsp, "server-tag-get");
-    checkListCommands(rsp, "server-update");
     checkListCommands(rsp, "shutdown");
     checkListCommands(rsp, "statistic-get");
     checkListCommands(rsp, "statistic-get-all");
index 6eebbe68abdd61bb34ccf31839a2d35195da0289..7837afc27aeafa674a77a193e6577d35ac496ea6 100644 (file)
@@ -257,7 +257,7 @@ public:
             EXPECT_EQ(cb_control->getDatabaseConfigFetchCalls(), 1);
 
             ConstElementPtr result =
-                ControlledDhcpv6Srv::processCommand("server-update",
+                ControlledDhcpv6Srv::processCommand("config-backend-pull",
                                                     ConstElementPtr());
             EXPECT_EQ(cb_control->getDatabaseConfigFetchCalls(), 2);
             std::string expected;
@@ -878,20 +878,20 @@ TEST_F(JSONFileBackendTest, configBackendTimerWithThrow) {
     testConfigBackendTimer(1, true);
 }
 
-// This test verifies that the server will be updated by the server-update
-// command.
+// This test verifies that the server will be updated by the
+// config-backend-pull command.
 TEST_F(JSONFileBackendTest, configBackendCommand) {
     testConfigBackendTimer(0, false, true);
 }
 
-// This test verifies that the server will be updated by the server-update
-// command even when updates fail.
+// This test verifies that the server will be updated by the
+// config-backend-pull command even when updates fail.
 TEST_F(JSONFileBackendTest, configBackendCommandWithThrow) {
     testConfigBackendTimer(0, true, true);
 }
 
-// This test verifies that the server will be updated by the server-update
-// command and the timer rescheduled.
+// This test verifies that the server will be updated by the
+// config-backend-pull command and the timer rescheduled.
 TEST_F(JSONFileBackendTest, configBackendCommandWithTimer) {
     testConfigBackendTimer(1, false, true);
 }