]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5150a] Fixed some missing stuff after rebase
authorFrancis Dupont <fdupont@isc.org>
Tue, 21 Mar 2017 18:55:51 +0000 (19:55 +0100)
committerFrancis Dupont <fdupont@isc.org>
Tue, 21 Mar 2017 18:55:51 +0000 (19:55 +0100)
src/bin/shell/tests/shell_process_tests.sh.in
src/lib/process/d_controller.cc

index 33deb2e5e4e403fa6ff5d16eb9c552b62d9b0a8e..47da9a56eec7493d4501475c8d2c1dab7c3ca109 100644 (file)
@@ -178,7 +178,7 @@ version_test() {
 
 version_test "shell.version"
 shell_command_test "shell.list-commands" "list-commands" \
-    "[ { \"arguments\": [ \"build-report\", \"config-test\", \"list-commands\", \"shutdown\", \"version-get\" ], \"result\": 0 } ]" ""
+    "[ { \"arguments\": [ \"build-report\", \"config-get\", \"config-test\", \"config-write\", \"list-commands\", \"shutdown\", \"version-get\" ], \"result\": 0 } ]" ""
 shell_command_test "shell.bogus" "give-me-a-beer" \
     "[ { \"result\": 1, \"text\": \"'give-me-a-beer' command not supported.\" } ]" ""
 shell_command_test "shell.empty-config-test" "config-test" \
index 5b112d4331148e903b8954f78ab04cfdab4ad3f5..3f8c97d4d463532c02fe3bb196ede3553e667472 100644 (file)
@@ -489,22 +489,23 @@ DControllerBase::configWriteHandler(const std::string&,
 
 ConstElementPtr
 DControllerBase::configTestHandler(const std::string&, ConstElementPtr args) {
-    const int status_code = CONTROL_RESULT_SUCCESS; // 1 indicates an error
-    ConstElementPtr dhcp4;
+    const int status_code = COMMAND_ERROR; // 1 indicates an error
+    ConstElementPtr module_config;
+    std::string module = getAppName();
     std::string message;
 
     // Command arguments are expected to be:
-    // { "Dhcp4": { ... }, "Logging": { ... } }
-    // The Lnogging component is technically optional. If it's not supplied
+    // { "Module": { ... }, "Logging": { ... } }
+    // The Logging component is technically optional. If it's not supplied
     // logging will revert to default logging.
     if (!args) {
         message = "Missing mandatory 'arguments' parameter.";
     } else {
-        dhcp4 = args->get("Dhcp4");
-        if (!dhcp4) {
-            message = "Missing mandatory 'Dhcp4' parameter.";
-        } else if (dhcp4->getType() != Element::map) {
-            message = "'Dhcp4' parameter expected to be a map.";
+      module_config = args->get(module);
+        if (!module_config) {
+            message = "Missing mandatory '" + module + "' parameter.";
+        } else if (module_config->getType() != Element::map) {
+            message = "'" + module + "' parameter expected to be a map.";
         }
     }
 
@@ -521,7 +522,7 @@ DControllerBase::configTestHandler(const std::string&, ConstElementPtr args) {
     isc::dhcp::CfgMgr::instance().rollback();
 
     // Now we check the server proper.
-    return (checkConfig(dhcp4));
+    return (checkConfig(module_config));
 }
 
 ConstElementPtr