]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[4271] Messages are now more terse.
authorTomek Mrugalski <tomasz@isc.org>
Tue, 9 Aug 2016 14:36:48 +0000 (16:36 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Tue, 9 Aug 2016 14:36:48 +0000 (16:36 +0200)
src/lib/eval/eval_messages.mes
src/lib/eval/tests/token_unittest.cc
src/lib/eval/token.cc

index 10e7af5f605b0ee381706241b12d15ed864b3edd..2db350f96403c988a527b8fe89032700b39000ce 100644 (file)
@@ -112,49 +112,49 @@ This debug message indicates that the expression has been evaluated
 to said value. This message is mostly useful during debugging of the
 client classification expressions.
 
-% EVAL_DEBUG_VENDOR_NO_OPTION Vendor option (code %1) missing, pushing result %2
+% EVAL_DEBUG_VENDOR_NO_OPTION Option with code %1 missing, pushing result %2
 This debug message indicates that the expression has been evaluated
 and vendor option was not found. This message is mostly useful during
 debugging of the client classification expressions.
 
-% EVAL_DEBUG_VENDOR_ENTERPRISE_ID_MISMATCH Vendor option was found, but does not have expected enterprise-id (was looking for %1, option had %2), pushing result %3
+% EVAL_DEBUG_VENDOR_ENTERPRISE_ID_MISMATCH Was looking for %1, option had %2, pushing result %3
 This debug message indicates that the expression has been evaluated
 and vendor option was found, but has different enterprise-id than specified
 in the expression. This message is mostly useful during debugging of the
 client classification expressions.
 
-% EVAL_DEBUG_VENDOR_ENTERPRISE_ID Vendor option found, pushing enterprise-id %1 as result %2
+% EVAL_DEBUG_VENDOR_ENTERPRISE_ID Pushing enterprise-id %1 as result %2
 This debug message indicates that the expression has been evaluated and vendor
 option was found and its enterprise-id is being reported. This message is mostly
 useful during debugging of the client classification expressions.
 
-% EVAL_DEBUG_VENDOR_EXISTS Vendor option exists, pushing result %1
+% EVAL_DEBUG_VENDOR_EXISTS Option with enterprise-id %1 found, pushing result %2
 This debug message indicates that the expression has been evaluated and vendor
 option was found. This message is mostly useful during debugging of the client
 classification expressions.
 
-% EVAL_DEBUG_VENDOR_CLASS_NO_OPTION Vendor class option (code %1) missing, pushing result %2
+% EVAL_DEBUG_VENDOR_CLASS_NO_OPTION Option with code %1 missing, pushing result %2
 This debug message indicates that the expression has been evaluated
 and vendor class option was not found. This message is mostly useful during
 debugging of the client classification expressions.
 
-% EVAL_DEBUG_VENDOR_CLASS_ENTERPRISE_ID_MISMATCH Vendor class option was found, but does not have expected enterprise-id (was looking for %1, option had %2), pushing result %3
+% EVAL_DEBUG_VENDOR_CLASS_ENTERPRISE_ID_MISMATCH Was looking for %1, option had %2, pushing result %3
 This debug message indicates that the expression has been evaluated
 and vendor class option was found, but has different enterprise-id than specified
 in the expression. This message is mostly useful during debugging of the
 client classification expressions.
 
-% EVAL_DEBUG_VENDOR_CLASS_ENTERPRISE_ID Vendor class option found, pushing enterprise-id %1 as result %2
+% EVAL_DEBUG_VENDOR_CLASS_ENTERPRISE_ID Pushing enterprise-id %1 as result %2
 This debug message indicates that the expression has been evaluated and vendor
 class option was found and its enterprise-id is being reported. This message is mostly
 useful during debugging of the client classification expressions.
 
-% EVAL_DEBUG_VENDOR_CLASS_EXISTS Vendor class option exists, pushing result %1
+% EVAL_DEBUG_VENDOR_CLASS_EXISTS Option with enterprise-id %1 found, pushing result %2
 This debug message indicates that the expression has been evaluated and vendor
 class option was found. This message is mostly useful during debugging of the
 client classification expressions.
 
-% EVAL_DEBUG_VENDOR_CLASS_DATA Vendor class data %1 (out of %2 received) is pushed as %3
+% EVAL_DEBUG_VENDOR_CLASS_DATA Data %1 (out of %2 received) in vendor class found pushing as %3
 This debug message indicates that vendor class option was found and passed
 enterprise-id checks and has sufficient number of data chunks. Total numer
 of chunks and value pushed are reported as debugging aid.
index 04d5d1f303f16687da4770183133bb0893b7a3df..b65c8d99b79de127616ab6bb28014589afc91ea3 100644 (file)
@@ -1923,6 +1923,17 @@ TEST_F(TokenTest, vendor4SpecificVendorExists) {
 
     // Case 3: option present and has matchin enterprise-id, should suceed
     testVendorExists(Option::V4, 4491, 4491, "true");
+
+
+    addString("EVAL_DEBUG_VENDOR_NO_OPTION Option with code 125 missing, "
+              "pushing result false");
+    addString("EVAL_DEBUG_VENDOR_ENTERPRISE_ID_MISMATCH Was looking for 4491, "
+              "option had 1234, pushing result false");
+    addString("EVAL_DEBUG_VENDOR_EXISTS Option with enterprise-id 4491 "
+              "found, pushing result true");
+
+    logCheckVerbose(true);
+    EXPECT_TRUE(checkFile());
 }
 
 // This test verifies if expression vendor[4491].exist works properly in DHCPv6.
index a2b5cd8f60da12f5130952c75c90fd301c7dafb2..3f479193a0f8999aff6285b3593cd992bf8af344 100644 (file)
@@ -696,6 +696,7 @@ void TokenVendor::evaluate(Pkt& pkt, ValueStack& values) {
         // We already passed all the checks: the option is there and has specified
         // enterprise-id.
         LOG_DEBUG(eval_logger, EVAL_DBG_STACK, EVAL_DEBUG_VENDOR_EXISTS)
+            .arg(vendor->getVendorId())
             .arg("true");
         values.push("true");
         return;
@@ -801,6 +802,7 @@ void TokenVendorClass::evaluate(Pkt& pkt, ValueStack& values) {
         // We already passed all the checks: the option is there and has specified
         // enterprise-id.
         LOG_DEBUG(eval_logger, EVAL_DBG_STACK, EVAL_DEBUG_VENDOR_CLASS_EXISTS)
+            .arg(vendor->getVendorId())
             .arg("true");
         values.push("true");
         return;