From b10b004e61b064e6e01827ab674ff34cefbe1502 Mon Sep 17 00:00:00 2001 From: Tomek Mrugalski Date: Fri, 15 Feb 2019 13:45:02 +0100 Subject: [PATCH] [#464,!238] Reenabled and cleaned up old vendor test --- src/bin/dhcp4/tests/vendor_opts_unittest.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bin/dhcp4/tests/vendor_opts_unittest.cc b/src/bin/dhcp4/tests/vendor_opts_unittest.cc index cb702fbddc..583b5fc4c3 100644 --- a/src/bin/dhcp4/tests/vendor_opts_unittest.cc +++ b/src/bin/dhcp4/tests/vendor_opts_unittest.cc @@ -420,11 +420,9 @@ TEST_F(VendorOptsTest, vendorOptionsDocsisDefinitions) { /// Checks if DOCSIS client packets are classified properly /// -/// @todo: With the change in #4626 the vendorClassSpecificProcessing -/// code was removed and replaced with generic classification. One day -/// we should rewrite this test to use classes. It would check that the -/// classification system can be used for docsis packets. -TEST_F(VendorOptsTest, DISABLED_docsisClientClassification) { +/// The test has been updated to work with the updated generic +/// vendor options handling code. +TEST_F(VendorOptsTest, docsisClientClassification) { NakedDhcpv4Srv srv(0); @@ -434,9 +432,11 @@ TEST_F(VendorOptsTest, DISABLED_docsisClientClassification) { ASSERT_NO_THROW(dis1 = PktCaptures::captureRelayedDiscover()); ASSERT_NO_THROW(dis1->unpack()); + std::cout << dis1->toText() << std::endl; + srv.classifyPacket(dis1); - EXPECT_TRUE(dis1->inClass(srv.VENDOR_CLASS_PREFIX + "docsis3.0")); + EXPECT_TRUE(dis1->inClass(srv.VENDOR_CLASS_PREFIX + "docsis3.0:")); EXPECT_FALSE(dis1->inClass(srv.VENDOR_CLASS_PREFIX + "eRouter1.0")); // Let's create a relayed DISCOVER. This particular relayed DISCOVER has @@ -448,7 +448,7 @@ TEST_F(VendorOptsTest, DISABLED_docsisClientClassification) { srv.classifyPacket(dis2); EXPECT_TRUE(dis2->inClass(srv.VENDOR_CLASS_PREFIX + "eRouter1.0")); - EXPECT_FALSE(dis2->inClass(srv.VENDOR_CLASS_PREFIX + "docsis3.0")); + EXPECT_FALSE(dis2->inClass(srv.VENDOR_CLASS_PREFIX + "docsis3.0:")); } // Verifies last resort option 43 is backward compatible -- 2.47.2