diff --git a/src/bin/dhcp4/tests/config_parser_unittest.cc b/src/bin/dhcp4/tests/config_parser_unittest.cc index 14a935e23d..577480b8e5 100644 --- a/src/bin/dhcp4/tests/config_parser_unittest.cc +++ b/src/bin/dhcp4/tests/config_parser_unittest.cc @@ -1370,6 +1370,10 @@ TEST_F(Dhcp4ParserTest, nextServerGlobal) { Subnet4Ptr subnet = CfgMgr::instance().getStagingCfg()-> getCfgSubnets4()->selectSubnet(IOAddress("192.0.2.200")); ASSERT_TRUE(subnet); + // Reset the fetch global function to staging (vs current) config. + subnet->setFetchGlobalsFn([]() -> ConstElementPtr { + return (CfgMgr::instance().getStagingCfg()->getConfiguredGlobals()); + }); EXPECT_EQ("1.2.3.4", subnet->getSiaddr().get().toText()); EXPECT_EQ("foo", subnet->getSname().get()); EXPECT_EQ("bar", subnet->getFilename().get()); @@ -1634,10 +1638,18 @@ TEST_F(Dhcp4ParserTest, matchClientIdNoGlobal) { CfgSubnets4Ptr cfg = CfgMgr::instance().getStagingCfg()->getCfgSubnets4(); Subnet4Ptr subnet1 = cfg->selectSubnet(IOAddress("192.0.2.1")); ASSERT_TRUE(subnet1); + // Reset the fetch global function to staging (vs current) config. + subnet1->setFetchGlobalsFn([]() -> ConstElementPtr { + return (CfgMgr::instance().getStagingCfg()->getConfiguredGlobals()); + }); EXPECT_TRUE(subnet1->getMatchClientId()); Subnet4Ptr subnet2 = cfg->selectSubnet(IOAddress("192.0.3.1")); ASSERT_TRUE(subnet2); + // Reset the fetch global function to staging (vs current) config. + subnet2->setFetchGlobalsFn([]() -> ConstElementPtr { + return (CfgMgr::instance().getStagingCfg()->getConfiguredGlobals()); + }); EXPECT_FALSE(subnet2->getMatchClientId()); } @@ -1672,10 +1684,18 @@ TEST_F(Dhcp4ParserTest, matchClientIdGlobal) { CfgSubnets4Ptr cfg = CfgMgr::instance().getStagingCfg()->getCfgSubnets4(); Subnet4Ptr subnet1 = cfg->selectSubnet(IOAddress("192.0.2.1")); ASSERT_TRUE(subnet1); + // Reset the fetch global function to staging (vs current) config. + subnet1->setFetchGlobalsFn([]() -> ConstElementPtr { + return (CfgMgr::instance().getStagingCfg()->getConfiguredGlobals()); + }); EXPECT_FALSE(subnet1->getMatchClientId()); Subnet4Ptr subnet2 = cfg->selectSubnet(IOAddress("192.0.3.1")); ASSERT_TRUE(subnet2); + // Reset the fetch global function to staging (vs current) config. + subnet2->setFetchGlobalsFn([]() -> ConstElementPtr { + return (CfgMgr::instance().getStagingCfg()->getConfiguredGlobals()); + }); EXPECT_TRUE(subnet2->getMatchClientId()); } @@ -1709,10 +1729,18 @@ TEST_F(Dhcp4ParserTest, authoritativeNoGlobal) { CfgSubnets4Ptr cfg = CfgMgr::instance().getStagingCfg()->getCfgSubnets4(); Subnet4Ptr subnet1 = cfg->selectSubnet(IOAddress("192.0.2.1")); ASSERT_TRUE(subnet1); + // Reset the fetch global function to staging (vs current) config. + subnet1->setFetchGlobalsFn([]() -> ConstElementPtr { + return (CfgMgr::instance().getStagingCfg()->getConfiguredGlobals()); + }); EXPECT_TRUE(subnet1->getAuthoritative()); Subnet4Ptr subnet2 = cfg->selectSubnet(IOAddress("192.0.3.1")); ASSERT_TRUE(subnet2); + // Reset the fetch global function to staging (vs current) config. + subnet2->setFetchGlobalsFn([]() -> ConstElementPtr { + return (CfgMgr::instance().getStagingCfg()->getConfiguredGlobals()); + }); EXPECT_FALSE(subnet2->getAuthoritative()); } @@ -1747,10 +1775,18 @@ TEST_F(Dhcp4ParserTest, authoritativeGlobal) { CfgSubnets4Ptr cfg = CfgMgr::instance().getStagingCfg()->getCfgSubnets4(); Subnet4Ptr subnet1 = cfg->selectSubnet(IOAddress("192.0.2.1")); ASSERT_TRUE(subnet1); + // Reset the fetch global function to staging (vs current) config. + subnet1->setFetchGlobalsFn([]() -> ConstElementPtr { + return (CfgMgr::instance().getStagingCfg()->getConfiguredGlobals()); + }); EXPECT_FALSE(subnet1->getAuthoritative()); Subnet4Ptr subnet2 = cfg->selectSubnet(IOAddress("192.0.3.1")); ASSERT_TRUE(subnet2); + // Reset the fetch global function to staging (vs current) config. + subnet2->setFetchGlobalsFn([]() -> ConstElementPtr { + return (CfgMgr::instance().getStagingCfg()->getConfiguredGlobals()); + }); EXPECT_TRUE(subnet2->getAuthoritative()); } diff --git a/src/bin/dhcp4/tests/get_config_unittest.cc b/src/bin/dhcp4/tests/get_config_unittest.cc index 944d7028da..d172803d18 100644 --- a/src/bin/dhcp4/tests/get_config_unittest.cc +++ b/src/bin/dhcp4/tests/get_config_unittest.cc @@ -2265,11 +2265,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -2356,11 +2353,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -2450,13 +2444,10 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" " \"max-valid-lifetime\": 5000,\n" " \"min-valid-lifetime\": 3000,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -2545,11 +2536,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -2573,11 +2561,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 2,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -2601,11 +2586,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 3,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -2629,11 +2611,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 4,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -2722,11 +2701,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1024,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -2750,11 +2726,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 100,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -2778,11 +2751,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -2806,11 +2776,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 34,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -2899,12 +2866,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" -" \"boot-file-name\": \"bar\",\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"1.2.3.4\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -2919,7 +2882,6 @@ const char* UNPARSED_CONFIGS[] = { " \"renew-timer\": 1000,\n" " \"reservation-mode\": \"all\",\n" " \"reservations\": [ ],\n" -" \"server-hostname\": \"foo\",\n" " \"subnet\": \"192.0.2.0/24\",\n" " \"t1-percent\": 0.5,\n" " \"t2-percent\": 0.875,\n" @@ -2994,11 +2956,9 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"boot-file-name\": \"bar\",\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" " \"next-server\": \"1.2.3.4\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" @@ -3089,11 +3049,9 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"boot-file-name\": \"bootfile.efi\",\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" " \"next-server\": \"1.2.3.4\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" @@ -3184,11 +3142,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -3277,11 +3232,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -3370,11 +3322,9 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" " \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -3398,11 +3348,9 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 2,\n" " \"match-client-id\": false,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -3491,11 +3439,9 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" " \"match-client-id\": false,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -3519,11 +3465,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 2,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -3615,8 +3558,6 @@ const char* UNPARSED_CONFIGS[] = { " \"authoritative\": true,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -3643,8 +3584,6 @@ const char* UNPARSED_CONFIGS[] = { " \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 2,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -3736,8 +3675,6 @@ const char* UNPARSED_CONFIGS[] = { " \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -3761,11 +3698,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": true,\n" " \"calculate-tee-times\": false,\n" " \"id\": 2,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -3856,13 +3790,10 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" " \"max-valid-lifetime\": 5,\n" " \"min-valid-lifetime\": 3,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -3951,11 +3882,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -3983,11 +3911,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 2,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -4080,11 +4005,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -4703,11 +4625,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -4796,11 +4715,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [\n" " {\n" " \"always-send\": false,\n" @@ -4933,11 +4849,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -5179,11 +5092,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -5281,11 +5191,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [\n" " {\n" " \"always-send\": false,\n" @@ -5391,11 +5298,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [\n" " {\n" " \"always-send\": false,\n" @@ -5428,11 +5332,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 2,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [\n" " {\n" " \"always-send\": false,\n" @@ -5530,11 +5431,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -5640,11 +5538,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -5772,11 +5667,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -6009,11 +5901,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -6117,11 +6006,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -6229,11 +6115,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -6450,11 +6333,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -6545,11 +6425,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -6640,11 +6517,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -6733,11 +6607,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -6826,11 +6697,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -6919,12 +6787,9 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"client-class\": \"alpha\",\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -6948,12 +6813,9 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"client-class\": \"beta\",\n" " \"id\": 2,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -6977,12 +6839,9 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"client-class\": \"gamma\",\n" " \"id\": 3,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -7006,11 +6865,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 4,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -7099,11 +6955,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -7207,11 +7060,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 123,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -7235,11 +7085,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 234,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -7318,11 +7165,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 542,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -7469,11 +7313,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 234,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -7582,11 +7423,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -7610,11 +7448,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 2,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -7638,11 +7473,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 3,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -7666,11 +7498,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 4,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -7759,11 +7588,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -7787,11 +7613,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 2,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -8128,11 +7951,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -8221,11 +8041,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"2001:db8::123/45\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -8314,11 +8131,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"ethX\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -8407,11 +8221,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"ethX\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"2001:db8::543/21\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -8500,11 +8311,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"vlan123\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -8619,11 +8427,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -8712,11 +8517,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -8805,11 +8607,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -8899,11 +8698,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -8997,11 +8793,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 1,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -9229,11 +9022,9 @@ const char* UNPARSED_CONFIGS[] = { " \"shared-networks\": [\n" " {\n" " \"comment\": \"A shared network\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"match-client-id\": true,\n" " \"name\": \"foo\",\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"relay\": {\n" " \"ip-addresses\": [ ]\n" @@ -9245,11 +9036,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 100,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -9419,11 +9207,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 123,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -9447,11 +9232,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 542,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -9534,11 +9316,9 @@ const char* UNPARSED_CONFIGS[] = { " \"server-tag\": \"\",\n" " \"shared-networks\": [\n" " {\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": true,\n" " \"match-client-id\": true,\n" " \"name\": \"foo\",\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"relay\": {\n" " \"ip-addresses\": [ ]\n" @@ -9549,11 +9329,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 100,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -9575,11 +9352,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": true,\n" " \"id\": 200,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" @@ -9608,11 +9382,8 @@ const char* UNPARSED_CONFIGS[] = { " \"4o6-interface\": \"\",\n" " \"4o6-interface-id\": \"\",\n" " \"4o6-subnet\": \"\",\n" -" \"authoritative\": false,\n" " \"calculate-tee-times\": false,\n" " \"id\": 300,\n" -" \"match-client-id\": true,\n" -" \"next-server\": \"0.0.0.0\",\n" " \"option-data\": [ ],\n" " \"pools\": [\n" " {\n" diff --git a/src/bin/dhcp6/tests/get_config_unittest.cc b/src/bin/dhcp6/tests/get_config_unittest.cc index 54068e6b3a..46b326e9a2 100644 --- a/src/bin/dhcp6/tests/get_config_unittest.cc +++ b/src/bin/dhcp6/tests/get_config_unittest.cc @@ -8210,7 +8210,6 @@ const char* UNPARSED_CONFIGS[] = { " }\n" " ],\n" " \"preferred-lifetime\": 3600,\n" -" \"rapid-commit\": false,\n" " \"relay\": {\n" " \"ip-addresses\": [ ]\n" " },\n" diff --git a/src/lib/dhcpsrv/parsers/simple_parser4.cc b/src/lib/dhcpsrv/parsers/simple_parser4.cc index ae6ec2de0a..a5e888e3a5 100644 --- a/src/lib/dhcpsrv/parsers/simple_parser4.cc +++ b/src/lib/dhcpsrv/parsers/simple_parser4.cc @@ -254,17 +254,12 @@ const SimpleDefaults SimpleParser4::SHARED_SUBNET4_DEFAULTS = { /// This list is also used for inheriting from global to shared networks /// and from shared networks to subnets within it. const ParamsList SimpleParser4::INHERIT_TO_SUBNET4 = { - "boot-file-name", "client-class", "interface", - "match-client-id", - "authoritative", - "next-server", "rebind-timer", "relay", "renew-timer", "reservation-mode", - "server-hostname", "valid-lifetime", "min-valid-lifetime", "max-valid-lifetime", diff --git a/src/lib/dhcpsrv/parsers/simple_parser6.cc b/src/lib/dhcpsrv/parsers/simple_parser6.cc index be6a799833..26b6526f62 100644 --- a/src/lib/dhcpsrv/parsers/simple_parser6.cc +++ b/src/lib/dhcpsrv/parsers/simple_parser6.cc @@ -237,11 +237,9 @@ const SimpleDefaults SimpleParser6::SHARED_NETWORK6_DEFAULTS = { const ParamsList SimpleParser6::INHERIT_TO_SUBNET6 = { "client-class", "interface", - "interface-id", "preferred-lifetime", "min-preferred-lifetime", "max-preferred-lifetime", - "rapid-commit", "rebind-timer", "relay", "renew-timer",