Commit 0a35cbe7 authored by Francis Dupont's avatar Francis Dupont

[30-implement-control-socket-for-ddns-2] Updated CA

parent fe841603
...@@ -118,12 +118,12 @@ CtrlAgentCommandMgr::handleCommandInternal(std::string cmd_name, ...@@ -118,12 +118,12 @@ CtrlAgentCommandMgr::handleCommandInternal(std::string cmd_name,
s << text->stringValue(); s << text->stringValue();
s << " You did not include \"service\" parameter in the command," s << " You did not include \"service\" parameter in the command,"
" which indicates that Kea Control Agent should process this" " 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" " aimed to send this command to one of the DHCP servers you"
" should include the \"service\" parameter in your request, e.g." " should include the \"service\" parameter in your request, e.g."
" \"service\": [ \"dhcp4\" ] to forward the command to the DHCPv4" " \"service\": [ \"dhcp4\" ] to forward the command to the DHCPv4"
" server, or \"service\": [ \"dhcp4\", \"dhcp6\" ] to forward it to" " server, or \"service\": [ \"dhcp4\", \"dhcp6\", \"d2\" ] to forward it to"
" both DHCPv4 and DHCPv6 servers etc."; " DHCPv4, DHCPv6 and D2 servers etc.";
answer->set(CONTROL_TEXT, Element::create(s.str())); answer->set(CONTROL_TEXT, Element::create(s.str()));
} }
......
...@@ -296,6 +296,11 @@ TEST_F(CtrlAgentCommandMgrTest, forwardToDHCPv6Server) { ...@@ -296,6 +296,11 @@ TEST_F(CtrlAgentCommandMgrTest, forwardToDHCPv6Server) {
testForward("dhcp6", "dhcp6", isc::config::CONTROL_RESULT_SUCCESS); 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. /// Check that the same command is forwarded to multiple servers.
TEST_F(CtrlAgentCommandMgrTest, forwardToBothDHCPServers) { TEST_F(CtrlAgentCommandMgrTest, forwardToBothDHCPServers) {
configureControlSocket("dhcp6"); configureControlSocket("dhcp6");
...@@ -304,6 +309,16 @@ TEST_F(CtrlAgentCommandMgrTest, forwardToBothDHCPServers) { ...@@ -304,6 +309,16 @@ TEST_F(CtrlAgentCommandMgrTest, forwardToBothDHCPServers) {
isc::config::CONTROL_RESULT_SUCCESS, -1, 2); 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 /// Check that the command may forwarded to the second server even if
/// forwarding to a first server fails. /// forwarding to a first server fails.
TEST_F(CtrlAgentCommandMgrTest, failForwardToServer) { TEST_F(CtrlAgentCommandMgrTest, failForwardToServer) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment