mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 05:27:55 +00:00
[#103,!277] Implemented CBControlBase::reset function.
This commit is contained in:
parent
96c63ac17a
commit
67eaad645f
@ -94,6 +94,15 @@ public:
|
||||
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.
|
||||
///
|
||||
/// This method disconnects from any existing configuration backends
|
||||
|
@ -381,6 +381,14 @@ TEST_F(CBControlBaseTest, getMgr) {
|
||||
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
|
||||
// server should fetch the particular configuration element.
|
||||
TEST_F(CBControlBaseTest, fetchConfigElement) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user