mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 14:05:33 +00:00
[#103,!277] Implemented CBControlBase::reset function.
This commit is contained in:
@@ -94,6 +94,15 @@ public:
|
|||||||
databaseConfigDisconnect();
|
databaseConfigDisconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @brief Resets the state of this object.
|
||||||
|
///
|
||||||
|
/// Disconnects the configuration backends resets the recorded last
|
||||||
|
/// audit entry time.
|
||||||
|
void reset() {
|
||||||
|
databaseConfigDisconnect();
|
||||||
|
last_audit_entry_time_ = getInitialAuditEntryTime();
|
||||||
|
}
|
||||||
|
|
||||||
/// @brief (Re)connects to the specified configuration backends.
|
/// @brief (Re)connects to the specified configuration backends.
|
||||||
///
|
///
|
||||||
/// This method disconnects from any existing configuration backends
|
/// This method disconnects from any existing configuration backends
|
||||||
|
@@ -381,6 +381,14 @@ TEST_F(CBControlBaseTest, getMgr) {
|
|||||||
EXPECT_EQ(TEST_INSTANCE_ID, mgr.getInstanceId());
|
EXPECT_EQ(TEST_INSTANCE_ID, mgr.getInstanceId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This test verifies that last audit entry time is reset upon the
|
||||||
|
// call to CBControlBase::reset().
|
||||||
|
TEST_F(CBControlBaseTest, reset) {
|
||||||
|
cb_ctl_.setLastAuditEntryTime(timestamps_["tomorrow"]);
|
||||||
|
cb_ctl_.reset();
|
||||||
|
EXPECT_EQ(cb_ctl_.getInitialAuditEntryTime(), cb_ctl_.getLastAuditEntryTime());
|
||||||
|
}
|
||||||
|
|
||||||
// This test verifies that it is correctly determined whether the
|
// This test verifies that it is correctly determined whether the
|
||||||
// server should fetch the particular configuration element.
|
// server should fetch the particular configuration element.
|
||||||
TEST_F(CBControlBaseTest, fetchConfigElement) {
|
TEST_F(CBControlBaseTest, fetchConfigElement) {
|
||||||
|
Reference in New Issue
Block a user