]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#464,!238] Reenabled and cleaned up old vendor test
authorTomek Mrugalski <tomasz@isc.org>
Fri, 15 Feb 2019 12:45:02 +0000 (13:45 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Tue, 19 Feb 2019 11:15:37 +0000 (12:15 +0100)
src/bin/dhcp4/tests/vendor_opts_unittest.cc

index cb702fbddc8bb3bae54bb33425b1d7c7759b3e59..583b5fc4c392caa29702eaf75aa1217b96ef096d 100644 (file)
@@ -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