From: Francis Dupont Date: Sun, 9 Jul 2017 09:02:17 +0000 (+0200) Subject: [5227] Updated optionStandardDefOverride test and regen X-Git-Tag: trac5226_base~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5a2f43451d15fbb05784443fc11ba6dc62392da3;p=thirdparty%2Fkea.git [5227] Updated optionStandardDefOverride test and regen --- diff --git a/src/bin/dhcp4/tests/config_parser_unittest.cc b/src/bin/dhcp4/tests/config_parser_unittest.cc index 7097fd055a..2101054538 100644 --- a/src/bin/dhcp4/tests/config_parser_unittest.cc +++ b/src/bin/dhcp4/tests/config_parser_unittest.cc @@ -2163,15 +2163,11 @@ TEST_F(Dhcp4ParserTest, optionStandardDefOverride) { checkResult(status, 1); EXPECT_TRUE(errorContainsPosition(status, "")); - /// @todo The option 213 is a standard DHCPv4 option. However, at - /// this point there is no definition for this option in - /// libdhcp++, so it should be allowed to define it from the - /// configuration interface. This test will have to be removed - /// once definitions for remaining standard options are created. + /// There is no definition for unassigned option 170. config = "{ \"option-def\": [ {" - " \"name\": \"access-network-domain-name\"," - " \"code\": 213," + " \"name\": \"unassigned-option-170\"," + " \"code\": 170," " \"type\": \"string\"," " \"space\": \"dhcp4\"" " } ]" @@ -2186,12 +2182,12 @@ TEST_F(Dhcp4ParserTest, optionStandardDefOverride) { checkResult(status, 0); def = CfgMgr::instance().getStagingCfg()-> - getCfgOptionDef()->get(DHCP4_OPTION_SPACE, 213); + getCfgOptionDef()->get(DHCP4_OPTION_SPACE, 170); ASSERT_TRUE(def); // Check the option data. - EXPECT_EQ("access-network-domain-name", def->getName()); - EXPECT_EQ(213, def->getCode()); + EXPECT_EQ("unassigned-option-170", def->getName()); + EXPECT_EQ(170, def->getCode()); EXPECT_EQ(OPT_STRING_TYPE, def->getType()); EXPECT_FALSE(def->getArrayType()); @@ -2820,7 +2816,7 @@ TEST_F(Dhcp4ParserTest, optionDataSinglePool) { // Expect a single option with the code equal to 100. ASSERT_EQ(1, std::distance(range.first, range.second)); const uint8_t foo_expected[] = { - 0xAB, 0xCD, 0xEF, 0x01, 0x05 + 0xAB, 0xCD, 0xEF, 0x01, 0x05 }; // Check if option is valid in terms of code and carried data. testOption(*range.first, 56, foo_expected, sizeof(foo_expected)); @@ -2893,7 +2889,7 @@ TEST_F(Dhcp4ParserTest, optionDataMultiplePools) { // Expect a single option with the code equal to 100. ASSERT_EQ(1, std::distance(range1.first, range1.second)); const uint8_t foo_expected[] = { - 0xAB, 0xCD, 0xEF, 0x01, 0x05 + 0xAB, 0xCD, 0xEF, 0x01, 0x05 }; // Check if option is valid in terms of code and carried data. testOption(*range1.first, 56, foo_expected, sizeof(foo_expected)); @@ -2909,8 +2905,8 @@ TEST_F(Dhcp4ParserTest, optionDataMultiplePools) { const OptionContainerTypeIndex& idx2 = options2->get<1>(); std::pair range2 = - idx2.equal_range(23); + OptionContainerTypeIndex::const_iterator> range2 = + idx2.equal_range(23); ASSERT_EQ(1, std::distance(range2.first, range2.second)); const uint8_t foo2_expected[] = { 0x01 diff --git a/src/bin/dhcp4/tests/get_config_unittest.cc b/src/bin/dhcp4/tests/get_config_unittest.cc index c66cdbf2ca..c6d0998b46 100644 --- a/src/bin/dhcp4/tests/get_config_unittest.cc +++ b/src/bin/dhcp4/tests/get_config_unittest.cc @@ -533,8 +533,8 @@ const char* EXTRACTED_CONFIGS[] = { "{\n" " \"option-def\": [\n" " {\n" -" \"code\": 213,\n" -" \"name\": \"access-network-domain-name\",\n" +" \"code\": 170,\n" +" \"name\": \"unassigned-option-170\",\n" " \"space\": \"dhcp4\",\n" " \"type\": \"string\"\n" " }\n" @@ -3210,9 +3210,9 @@ const char* UNPARSED_CONFIGS[] = { " \"option-def\": [\n" " {\n" " \"array\": false,\n" -" \"code\": 213,\n" +" \"code\": 170,\n" " \"encapsulate\": \"\",\n" -" \"name\": \"access-network-domain-name\",\n" +" \"name\": \"unassigned-option-170\",\n" " \"record-types\": \"\",\n" " \"space\": \"dhcp4\",\n" " \"type\": \"string\"\n"