#include <gtest/gtest.h>
#include <database/backend_selector.h>
+#include <dhcp/option_string.h>
#include <dhcp/tests/iface_mgr_test_config.h>
#include <dhcp6/dhcp6_srv.h>
#include <dhcp6/ctrl_dhcp6_srv.h>
" \"interfaces-config\": { \n"
" \"interfaces\": [\"*\" ] \n"
" }, \n"
- " \"echo-client-id\": false, \n"
" \"decline-probation-period\": 7000, \n"
" \"valid-lifetime\": 1000, \n"
" \"rebind-timer\": 800, \n"
- " \"server-hostname\": \"overwrite.me.com\", \n"
+ " \"server-tag\": \"first-server\", \n"
" \"config-control\": { \n"
" \"config-databases\": [ { \n"
" \"type\": \"memfile\", \n"
extractConfig(base_config);
// Make some globals:
- StampedValuePtr server_hostname(new StampedValue("server-hostname", "isc.example.org"));
+ StampedValuePtr server_tag(new StampedValue("server-tag", "second-server"));
StampedValuePtr decline_period(new StampedValue("decline-probation-period", Element::create(86400)));
- StampedValuePtr calc_tee_times(new StampedValue("calculate-tee-times", Element::create(bool(false))));
- StampedValuePtr t2_percent(new StampedValue("t2-percent", Element::create(0.75)));
StampedValuePtr renew_timer(new StampedValue("renew-timer", Element::create(500)));
// Let's add all of the globals to the second backend. This will verify
// we find them there.
- db2_->createUpdateGlobalParameter6(ServerSelector::ALL(), server_hostname);
+ db2_->createUpdateGlobalParameter6(ServerSelector::ALL(), server_tag);
db2_->createUpdateGlobalParameter6(ServerSelector::ALL(), decline_period);
- db2_->createUpdateGlobalParameter6(ServerSelector::ALL(), calc_tee_times);
- db2_->createUpdateGlobalParameter6(ServerSelector::ALL(), t2_percent);
db2_->createUpdateGlobalParameter6(ServerSelector::ALL(), renew_timer);
// Should parse and merge without error.
// CfgMgr::instance().commit() hasn't been called)
SrvConfigPtr staging_cfg = CfgMgr::instance().getStagingCfg();
- // echo-client-id is set explicitly in the original config, meanwhile
- // the backend config does not set it, so the explicit value wins.
- EXPECT_FALSE(staging_cfg->getEchoClientId());
-
// decline-probation-period is an explicit member that should come
// from the backend.
EXPECT_EQ(86400, staging_cfg->getDeclinePeriod());
Element::create(800)));
// Verify that the implicit globals from the backend are there.
- ASSERT_NO_FATAL_FAILURE(checkConfiguredGlobal(staging_cfg, server_hostname));
- ASSERT_NO_FATAL_FAILURE(checkConfiguredGlobal(staging_cfg, calc_tee_times));
- ASSERT_NO_FATAL_FAILURE(checkConfiguredGlobal(staging_cfg, t2_percent));
+ ASSERT_NO_FATAL_FAILURE(checkConfiguredGlobal(staging_cfg, server_tag));
ASSERT_NO_FATAL_FAILURE(checkConfiguredGlobal(staging_cfg, renew_timer));
}
" \"name\": \"dhcp-message\", \n"
" \"data\": \"0A0B0C0D\", \n"
" \"csv-format\": false \n"
- " },{ \n"
+ " },{ \n"
" \"name\": \"host-name\", \n"
" \"data\": \"old.example.com\", \n"
" \"csv-format\": true \n"
ASSERT_TRUE(found_opt.option_);
EXPECT_EQ("0x0A0B0C0D", found_opt.option_->toHexString());
- // host-name should come from the first back end,
+ // host-name should come from the first back end,
// (overwriting the original).
found_opt = options->get("dhcp6", DHO_HOST_NAME);
ASSERT_TRUE(found_opt.option_);
// CfgMgr::instance().commit() hasn't been called)
SrvConfigPtr staging_cfg = CfgMgr::instance().getStagingCfg();
- CfgSharedNetworks4Ptr networks = staging_cfg->getCfgSharedNetworks4();
+ CfgSharedNetworks6Ptr networks = staging_cfg->getCfgSharedNetworks6();
SharedNetwork6Ptr staged_network;
// SharedNetwork One should have been added from db1 config