Parcourir la source

[5111] Replaced hypen with underscore in command_processed hook name

Thomas Markwalder il y a 7 ans
Parent
commit
831db83567

+ 1 - 1
src/lib/config/base_command_mgr.cc

@@ -18,7 +18,7 @@ namespace isc {
 namespace config {
 
 BaseCommandMgr::BaseCommandMgr() {
-    hook_index_command_processed_ = HooksManager::registerHook("command-processed");
+    hook_index_command_processed_ = HooksManager::registerHook("command_processed");
     registerCommand("list-commands", boost::bind(&BaseCommandMgr::listCommandsHandler,
                                                  this, _1, _2));
 }

+ 6 - 6
src/lib/config/tests/command_mgr_unittests.cc

@@ -465,13 +465,13 @@ TEST_F(CommandMgrTest, unixCreateTooLong) {
                  SocketError);
 }
 
-// This test verifies that a registered callout for the command-processed
+// This test verifies that a registered callout for the command_processed
 // hookpoint is invoked and passed the correct information.
 TEST_F(CommandMgrTest, commandProcessedHook) {
     // Register callout so as we can check that it is called before
     // processing the command by the manager.
     HooksManager::preCalloutsLibraryHandle().registerCallout(
-        "command-processed", command_processed_callout);
+        "command_processed", command_processed_callout);
 
     // Install local handler
     EXPECT_NO_THROW(CommandMgr::instance().registerCommand("my-command",
@@ -494,7 +494,7 @@ TEST_F(CommandMgrTest, commandProcessedHook) {
     EXPECT_EQ("{ \"result\": 123, \"text\": \"test error message\" }",
               answer->str());
 
-    // Make sure invoked the command-processed callout
+    // Make sure invoked the command_processed callout
     EXPECT_EQ("command_processed_handler", callout_name_);
 
     // Verify the callout could extract all the context arguments
@@ -503,13 +503,13 @@ TEST_F(CommandMgrTest, commandProcessedHook) {
               processed_log_);
 }
 
-// This test verifies that a registered callout for the command-processed
+// This test verifies that a registered callout for the command_processed
 // hookpoint is invoked and can replace the command response content.
 TEST_F(CommandMgrTest, commandProcessedHookReplaceResponse) {
     // Register callout so as we can check that it is called before
     // processing the command by the manager.
     HooksManager::preCalloutsLibraryHandle().registerCallout(
-        "command-processed", command_processed_callout);
+        "command_processed", command_processed_callout);
 
     // Install local handler
     EXPECT_NO_THROW(CommandMgr::instance().registerCommand("my-command",
@@ -532,7 +532,7 @@ TEST_F(CommandMgrTest, commandProcessedHookReplaceResponse) {
     EXPECT_EQ("{ \"result\": 777, \"text\": \"replaced response text\" }",
               answer->str());
 
-    // Make sure invoked the command-processed callout
+    // Make sure invoked the command_processed callout
     EXPECT_EQ("command_processed_handler", callout_name_);
 
     // Verify the callout could extract all the context arguments