]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[30-implement-control-socket-for-ddns-2] Updated CA
authorFrancis Dupont <fdupont@isc.org>
Thu, 27 Dec 2018 23:12:04 +0000 (00:12 +0100)
committerFrancis Dupont <fdupont@isc.org>
Thu, 3 Jan 2019 09:05:03 +0000 (04:05 -0500)
src/bin/agent/ca_command_mgr.cc
src/bin/agent/tests/ca_command_mgr_unittests.cc

index 6386527b4cb038c6981edfc365d6a84dfbb41342..3371bf53e6c8fbc994e38c0eb4d417e8f0e6e5a2 100644 (file)
@@ -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()));
             }
index ba692c457377d1f0c0cfb7019402dd1ced87b402..f8a7833a7142f270d12db229619fb1aa275837ba 100644 (file)
@@ -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) {