]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3477] Applied new patch
authorFrancis Dupont <fdupont@isc.org>
Fri, 20 Sep 2024 12:17:22 +0000 (14:17 +0200)
committerFrancis Dupont <fdupont@isc.org>
Fri, 20 Sep 2024 12:17:22 +0000 (14:17 +0200)
src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc

index 9539d58b70a8ca2ad5c6fd98adc859258e8dc8e5..169e6aa2e40320324f5e12646ec965330c5871e0 100644 (file)
@@ -118,7 +118,7 @@ public:
         if (env) {
             socket_path_ = string(env) + "/kea4.sock";
         } else {
-            socket_path_ = sandbox.join("kea4.sock");
+            socket_path_ = sandbox.join("/kea4.sock");
         }
         reset();
         IfaceMgr::instance().setTestMode(false);
@@ -1068,6 +1068,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, serverTagGet) {
     // Retry...
     sendUnixCommand("{ \"command\": \"server-tag-get\" }", response);
     expected = "{ \"arguments\": { \"server-tag\": \"foobar\" }, \"result\": 0 }";
+    EXPECT_EQ(expected, response);
 }
 
 // This test verifies that the DHCP server handles status-get commands
index 9469bc0f1569787eae61efa6392e268d381a493c..cf08d146df70ac40d6a3a8267093e7219d807bde 100644 (file)
 #include <log/logger_support.h>
 #include <stats/stats_mgr.h>
 #include <util/multi_threading_mgr.h>
+#include <util/chrono_time_utils.h>
 #include <testutils/io_utils.h>
 #include <testutils/unix_control_client.h>
 #include <testutils/sandbox.h>
-#include <util/chrono_time_utils.h>
 
 #include "marker_file.h"
 #include "test_libraries.h"
@@ -460,6 +460,8 @@ TEST_F(CtrlDhcpv6SrvTest, commands) {
     result = CommandMgr::instance().processCommand(createCommand("shutdown", params));
     comment = parseAnswer(rcode, result);
     EXPECT_EQ(0, rcode); // expect success
+    // Exit value should default to 0.
+    EXPECT_EQ(0, server_->getExitValue());
 
     // Case 3: send shutdown command with exit-value parameter.
     ConstElementPtr x(new isc::data::IntElement(77));
@@ -473,8 +475,6 @@ TEST_F(CtrlDhcpv6SrvTest, commands) {
     EXPECT_EQ(77, srv->getExitValue());
 }
 
-typedef std::map<std::string, isc::data::ConstElementPtr> ElementMap;
-
 // This test checks which commands are registered by the DHCPv6 server.
 TEST_F(CtrlDhcpv6SrvTest, commandsRegistration) {
 
@@ -607,8 +607,8 @@ TEST_F(CtrlChannelDhcpv6SrvTest, controlChannelStats) {
     };
 
     std::ostringstream s;
-    bool first = true;
     s << "{ \"arguments\": { ";
+    bool first = true;
     for (auto const& st : initial_stats) {
         if (!first) {
             s << ", ";