From: Francis Dupont Date: Thu, 27 Dec 2018 23:12:04 +0000 (+0100) Subject: [30-implement-control-socket-for-ddns-2] Updated CA X-Git-Tag: 208-move-logging-from-global-objects-to-global-params_base~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a35cbe78570143e6129f0419afe56e0898cb88a;p=thirdparty%2Fkea.git [30-implement-control-socket-for-ddns-2] Updated CA --- diff --git a/src/bin/agent/ca_command_mgr.cc b/src/bin/agent/ca_command_mgr.cc index 6386527b4c..3371bf53e6 100644 --- a/src/bin/agent/ca_command_mgr.cc +++ b/src/bin/agent/ca_command_mgr.cc @@ -118,12 +118,12 @@ CtrlAgentCommandMgr::handleCommandInternal(std::string cmd_name, s << text->stringValue(); s << " You did not include \"service\" parameter in the command," " which indicates that Kea Control Agent should process this" - " command rather than forward it to one or more DHCP servers. If you" + " command rather than forward it to one or more DHCP servers. If you" " aimed to send this command to one of the DHCP servers you" " should include the \"service\" parameter in your request, e.g." " \"service\": [ \"dhcp4\" ] to forward the command to the DHCPv4" - " server, or \"service\": [ \"dhcp4\", \"dhcp6\" ] to forward it to" - " both DHCPv4 and DHCPv6 servers etc."; + " server, or \"service\": [ \"dhcp4\", \"dhcp6\", \"d2\" ] to forward it to" + " DHCPv4, DHCPv6 and D2 servers etc."; answer->set(CONTROL_TEXT, Element::create(s.str())); } diff --git a/src/bin/agent/tests/ca_command_mgr_unittests.cc b/src/bin/agent/tests/ca_command_mgr_unittests.cc index ba692c4573..f8a7833a71 100644 --- a/src/bin/agent/tests/ca_command_mgr_unittests.cc +++ b/src/bin/agent/tests/ca_command_mgr_unittests.cc @@ -296,6 +296,11 @@ TEST_F(CtrlAgentCommandMgrTest, forwardToDHCPv6Server) { testForward("dhcp6", "dhcp6", isc::config::CONTROL_RESULT_SUCCESS); } +/// Check that control command is successfully forwarded to the D2 server. +TEST_F(CtrlAgentCommandMgrTest, forwardToD2Server) { + testForward("d2", "d2", isc::config::CONTROL_RESULT_SUCCESS); +} + /// Check that the same command is forwarded to multiple servers. TEST_F(CtrlAgentCommandMgrTest, forwardToBothDHCPServers) { configureControlSocket("dhcp6"); @@ -304,6 +309,16 @@ TEST_F(CtrlAgentCommandMgrTest, forwardToBothDHCPServers) { isc::config::CONTROL_RESULT_SUCCESS, -1, 2); } +/// Check that the same command is forwarded to all servers. +TEST_F(CtrlAgentCommandMgrTest, forwardToAllServers) { + configureControlSocket("dhcp6"); + configureControlSocket("d2"); + + testForward("dhcp4", "dhcp4,dhcp6,d2", isc::config::CONTROL_RESULT_SUCCESS, + isc::config::CONTROL_RESULT_SUCCESS, + isc::config::CONTROL_RESULT_SUCCESS, 3); +} + /// Check that the command may forwarded to the second server even if /// forwarding to a first server fails. TEST_F(CtrlAgentCommandMgrTest, failForwardToServer) {