diff options
author | Marcin Siodelski <marcin@isc.org> | 2015-11-25 16:44:46 +0100 |
---|---|---|
committer | Marcin Siodelski <marcin@isc.org> | 2015-11-25 16:44:46 +0100 |
commit | 3f53001245c1214f298a6a1d42b4c680ec2fcaae (patch) | |
tree | 88b43e5d8c3261db723e90ba3a76452a85fd2127 /src/bin/dhcp6/tests | |
parent | [4204] Whitespace may surround option name in expressions. (diff) | |
download | kea-3f53001245c1214f298a6a1d42b4c680ec2fcaae.tar.xz kea-3f53001245c1214f298a6a1d42b4c680ec2fcaae.zip |
[4204] Remove runtime option defs if "option-def" is not in config.
Diffstat (limited to 'src/bin/dhcp6/tests')
-rw-r--r-- | src/bin/dhcp6/tests/config_parser_unittest.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/bin/dhcp6/tests/config_parser_unittest.cc b/src/bin/dhcp6/tests/config_parser_unittest.cc index 4ab9e9a4f1..98bce31fd4 100644 --- a/src/bin/dhcp6/tests/config_parser_unittest.cc +++ b/src/bin/dhcp6/tests/config_parser_unittest.cc @@ -1583,6 +1583,12 @@ TEST_F(Dhcp6ParserTest, optionDefIpv6Address) { ConstElementPtr status; EXPECT_NO_THROW(status = configureDhcp6Server(srv_, json)); ASSERT_TRUE(status); + checkResult(status, 0); + + // We need to commit option definitions because later in this test we + // will be checking if they get removed when "option-def" parameter + // is removed from a configuration. + LibDHCP::commitRuntimeOptionDefs(); // The option definition should now be available in the CfgMgr. def = CfgMgr::instance().getStagingCfg()->getCfgOptionDef()->get("isc", 100); @@ -1602,6 +1608,16 @@ TEST_F(Dhcp6ParserTest, optionDefIpv6Address) { // be equal. EXPECT_TRUE(def_libdhcp != def); EXPECT_TRUE(*def_libdhcp == *def); + + // Let's apply empty configuration. This removes the option definitions + // configuration and should result in removal of the option 100 from the + // libdhcp++. + config = "{ }"; + json = Element::fromJSON(config); + ASSERT_NO_THROW(status = configureDhcp6Server(srv_, json)); + checkResult(status, 0); + + EXPECT_FALSE(LibDHCP::getRuntimeOptionDef("isc", 100)); } // The goal of this test is to check whether an option definition |