mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-02 15:05:16 +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
|
// This should change the staging configuration so as it becomes a current
|
||||||
// one.
|
// one.
|
||||||
|
auto before = boost::posix_time::second_clock::universal_time();
|
||||||
cfg_mgr.commit();
|
cfg_mgr.commit();
|
||||||
|
auto after = boost::posix_time::second_clock::universal_time();
|
||||||
const_config = cfg_mgr.getCurrentCfg();
|
const_config = cfg_mgr.getCurrentCfg();
|
||||||
ASSERT_TRUE(const_config);
|
ASSERT_TRUE(const_config);
|
||||||
// Sequence id equal to 1 indicates that the current configuration points
|
// Sequence id equal to 1 indicates that the current configuration points
|
||||||
// to the configuration that used to be a staging configuration previously.
|
// to the configuration that used to be a staging configuration previously.
|
||||||
EXPECT_EQ(1, const_config->getSequence());
|
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
|
// Create a new staging configuration. It should be assigned a new
|
||||||
// sequence id.
|
// sequence id.
|
||||||
|
Reference in New Issue
Block a user