mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 05:55:28 +00:00
[#1041] Added getLastCommitTime unit test
This commit is contained in:
committed by
Marcin Siodelski
parent
51a472788c
commit
eddc1628a6
@@ -461,12 +461,19 @@ TEST_F(CfgMgrTest, staging) {
|
||||
|
||||
// This should change the staging configuration so as it becomes a current
|
||||
// one.
|
||||
auto before = boost::posix_time::second_clock::universal_time();
|
||||
cfg_mgr.commit();
|
||||
auto after = boost::posix_time::second_clock::universal_time();
|
||||
const_config = cfg_mgr.getCurrentCfg();
|
||||
ASSERT_TRUE(const_config);
|
||||
// Sequence id equal to 1 indicates that the current configuration points
|
||||
// to the configuration that used to be a staging configuration previously.
|
||||
EXPECT_EQ(1, const_config->getSequence());
|
||||
// Last commit timestamp should be between before and after.
|
||||
auto reload = const_config->getLastCommitTime();
|
||||
ASSERT_FALSE(reload.is_not_a_date_time());
|
||||
EXPECT_LE(before, reload);
|
||||
EXPECT_GE(after, reload);
|
||||
|
||||
// Create a new staging configuration. It should be assigned a new
|
||||
// sequence id.
|
||||
|
Reference in New Issue
Block a user