]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#4184] Checkpoint: fixed UTs
authorFrancis Dupont <fdupont@isc.org>
Thu, 11 Dec 2025 14:22:24 +0000 (15:22 +0100)
committerFrancis Dupont <fdupont@isc.org>
Thu, 11 Dec 2025 22:34:26 +0000 (23:34 +0100)
src/hooks/dhcp/high_availability/tests/ha_impl_unittest.cc

index 8adf1f9e0692b4985dcc3ccb3785810a785ac109..c2705f37f993ff3709bf8630244092125f344813 100644 (file)
@@ -655,9 +655,9 @@ TEST_F(HAImplTest, subnet4SelectDropNotInScope) {
     ASSERT_EQ(1, query4->getClasses().size());
     EXPECT_TRUE(query4->inClass("HA_server3"));
 
-    // Drop statistics should not increase when the server doesn't serve the
-    // particular scope.
-    EXPECT_EQ(0, getStatistic("pkt4-receive-drop"));
+    // Drop statistics should have been increased.
+    EXPECT_EQ(1, getStatistic("pkt4-not-for-us"));
+    EXPECT_EQ(1, getStatistic("pkt4-receive-drop"));
 }
 
 // Tests that the subnet4_select drops a packet when no subnet has been selected.
@@ -702,6 +702,7 @@ TEST_F(HAImplTest, subnet4SelectNoSubnet) {
     EXPECT_TRUE(query4->getClasses().empty());
 
     // Drop statistics should have been increased.
+    EXPECT_EQ(1, getStatistic("pkt4-not-for-us"));
     EXPECT_EQ(1, getStatistic("pkt4-receive-drop"));
 }
 
@@ -1106,9 +1107,9 @@ TEST_F(HAImplTest, subnet6SelectDropNotInScope) {
     ASSERT_EQ(1, query6->getClasses().size());
     EXPECT_TRUE(query6->inClass("HA_server3"));
 
-    // Drop statistics should not increase when the server doesn't serve the
-    // particular scope.
-    EXPECT_EQ(0, getStatistic("pkt6-receive-drop"));
+    // Drop statistics should have been increased.
+    EXPECT_EQ(1, getStatistic("pkt6-not-for-us"));
+    EXPECT_EQ(1, getStatistic("pkt6-receive-drop"));
 }
 
 // Tests that the subnet6_select drops a packet when no subnet has been selected.
@@ -1153,6 +1154,7 @@ TEST_F(HAImplTest, subnet6SelectNoSubnet) {
     EXPECT_TRUE(query6->getClasses().empty());
 
     // Drop statistics should have been increased.
+    EXPECT_EQ(1, getStatistic("pkt6-not-for-us"));
     EXPECT_EQ(1, getStatistic("pkt6-receive-drop"));
 }