Commit 5a2f4345 authored by Francis Dupont's avatar Francis Dupont
Browse files

[5227] Updated optionStandardDefOverride test and regen

parent 34122093
......@@ -2163,15 +2163,11 @@ TEST_F(Dhcp4ParserTest, optionStandardDefOverride) {
checkResult(status, 1);
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 =
"{ \"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<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));
const uint8_t foo2_expected[] = {
0x01
......
......@@ -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"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment