Commit eddc1628 authored by Francis Dupont's avatar Francis Dupont Committed by Marcin Siodelski
Browse files

[#1041] Added getLastCommitTime unit test

parent 51a47278
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment