|
@@ -2163,15 +2163,11 @@ TEST_F(Dhcp4ParserTest, optionStandardDefOverride) {
|
|
checkResult(status, 1);
|
|
checkResult(status, 1);
|
|
EXPECT_TRUE(errorContainsPosition(status, "<string>"));
|
|
EXPECT_TRUE(errorContainsPosition(status, "<string>"));
|
|
|
|
|
|
- /// @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 =
|
|
config =
|
|
"{ \"option-def\": [ {"
|
|
"{ \"option-def\": [ {"
|
|
- " \"name\": \"access-network-domain-name\","
|
|
|
|
- " \"code\": 213,"
|
|
|
|
|
|
+ " \"name\": \"unassigned-option-170\","
|
|
|
|
+ " \"code\": 170,"
|
|
" \"type\": \"string\","
|
|
" \"type\": \"string\","
|
|
" \"space\": \"dhcp4\""
|
|
" \"space\": \"dhcp4\""
|
|
" } ]"
|
|
" } ]"
|
|
@@ -2186,12 +2182,12 @@ TEST_F(Dhcp4ParserTest, optionStandardDefOverride) {
|
|
checkResult(status, 0);
|
|
checkResult(status, 0);
|
|
|
|
|
|
def = CfgMgr::instance().getStagingCfg()->
|
|
def = CfgMgr::instance().getStagingCfg()->
|
|
- getCfgOptionDef()->get(DHCP4_OPTION_SPACE, 213);
|
|
|
|
|
|
+ getCfgOptionDef()->get(DHCP4_OPTION_SPACE, 170);
|
|
ASSERT_TRUE(def);
|
|
ASSERT_TRUE(def);
|
|
|
|
|
|
// Check the option data.
|
|
// 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_EQ(OPT_STRING_TYPE, def->getType());
|
|
EXPECT_FALSE(def->getArrayType());
|
|
EXPECT_FALSE(def->getArrayType());
|
|
|
|
|
|
@@ -2820,7 +2816,7 @@ TEST_F(Dhcp4ParserTest, optionDataSinglePool) {
|
|
// Expect a single option with the code equal to 100.
|
|
// Expect a single option with the code equal to 100.
|
|
ASSERT_EQ(1, std::distance(range.first, range.second));
|
|
ASSERT_EQ(1, std::distance(range.first, range.second));
|
|
const uint8_t foo_expected[] = {
|
|
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.
|
|
// Check if option is valid in terms of code and carried data.
|
|
testOption(*range.first, 56, foo_expected, sizeof(foo_expected));
|
|
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.
|
|
// Expect a single option with the code equal to 100.
|
|
ASSERT_EQ(1, std::distance(range1.first, range1.second));
|
|
ASSERT_EQ(1, std::distance(range1.first, range1.second));
|
|
const uint8_t foo_expected[] = {
|
|
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.
|
|
// Check if option is valid in terms of code and carried data.
|
|
testOption(*range1.first, 56, foo_expected, sizeof(foo_expected));
|
|
testOption(*range1.first, 56, foo_expected, sizeof(foo_expected));
|
|
@@ -2909,8 +2905,8 @@ TEST_F(Dhcp4ParserTest, optionDataMultiplePools) {
|
|
|
|
|
|
const OptionContainerTypeIndex& idx2 = options2->get<1>();
|
|
const OptionContainerTypeIndex& idx2 = options2->get<1>();
|
|
std::pair<OptionContainerTypeIndex::const_iterator,
|
|
std::pair<OptionContainerTypeIndex::const_iterator,
|
|
- OptionContainerTypeIndex::const_iterator> range2 =
|
|
|
|
- idx2.equal_range(23);
|
|
|
|
|
|
+ OptionContainerTypeIndex::const_iterator> range2 =
|
|
|
|
+ idx2.equal_range(23);
|
|
ASSERT_EQ(1, std::distance(range2.first, range2.second));
|
|
ASSERT_EQ(1, std::distance(range2.first, range2.second));
|
|
const uint8_t foo2_expected[] = {
|
|
const uint8_t foo2_expected[] = {
|
|
0x01
|
|
0x01
|