From: Tomek Mrugalski Date: Tue, 9 Aug 2016 14:36:48 +0000 (+0200) Subject: [4271] Messages are now more terse. X-Git-Tag: trac4631_base~25^2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=77848fb77ee1e593cf0eabe844a6b8a4f095f39b;p=thirdparty%2Fkea.git [4271] Messages are now more terse. --- diff --git a/src/lib/eval/eval_messages.mes b/src/lib/eval/eval_messages.mes index 10e7af5f60..2db350f964 100644 --- a/src/lib/eval/eval_messages.mes +++ b/src/lib/eval/eval_messages.mes @@ -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. diff --git a/src/lib/eval/tests/token_unittest.cc b/src/lib/eval/tests/token_unittest.cc index 04d5d1f303..b65c8d99b7 100644 --- a/src/lib/eval/tests/token_unittest.cc +++ b/src/lib/eval/tests/token_unittest.cc @@ -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. diff --git a/src/lib/eval/token.cc b/src/lib/eval/token.cc index a2b5cd8f60..3f479193a0 100644 --- a/src/lib/eval/token.cc +++ b/src/lib/eval/token.cc @@ -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;