auto found_network = networks->getByName("one");
if (fetchConfigElement("dhcp4_shared_network") &&
(getTimestamp("dhcp4_shared_network") > lb_modification_time)) {
- EXPECT_TRUE(found_network);
+ ASSERT_TRUE(found_network);
EXPECT_TRUE(found_network->hasFetchGlobalsFn());
} else {
/// 0 and 0x32.
CfgHostsTest();
+ /// @brief Destructor.
+ ///
+ /// This destructor resets global state after tests are run.
+ ~CfgHostsTest();
+
/// @brief Increases last byte of an address.
///
/// @param address Address to be increased.
}
}
+CfgHostsTest::~CfgHostsTest() {
+ CfgMgr::instance().setFamily(AF_INET);
+}
+
IOAddress
CfgHostsTest::increase(const IOAddress& address, const uint8_t num) const {
std::vector<uint8_t> vec = address.toBytes();
// and not the original configuration.
EXPECT_EQ(*new_cfg, *updated_config);
EXPECT_NE(*original_config, *updated_config);
+
+ // Revert to default configuration.
+ ASSERT_NO_THROW(CfgMgr::instance().setD2ClientConfig(original_config));
}
// This test verifies that the configuration staging, commit and rollback works