CfgMgr::instance().getStagingCfg()->getDeclinePeriod());
}
+/// Check that an incorrect decline-probation-period value will be caught.
+TEST_F(Dhcp4ParserTest, declineTimerError) {
+ ConstElementPtr status;
+
+ string config = "{ " + genIfaceConfig() + "," +
+ "\"decline-probation-period\": \"soon\","
+ "\"subnet4\": [ ]"
+ "}";
+
+ ElementPtr json = Element::fromJSON(config);
+
+ EXPECT_NO_THROW(status = configureDhcp4Server(*srv_, json));
+
+ // returned value should be 1 (error)
+ checkResult(status, 1);
+
+ // Check that the error contains error position.
+ EXPECT_TRUE(errorContainsPosition(status, "<string>"));
+}
}
CfgMgr::instance().getStagingCfg()->getDeclinePeriod());
}
+/// Check that an incorrect decline-probation-period value will be caught.
+TEST_F(Dhcp6ParserTest, declineTimerError) {
+ ConstElementPtr status;
+
+ string config = "{ " + genIfaceConfig() + "," +
+ "\"decline-probation-period\": \"soon\","
+ "\"subnet6\": [ ]"
+ "}";
+
+ ElementPtr json = Element::fromJSON(config);
+
+ EXPECT_NO_THROW(status = configureDhcp6Server(srv_, json));
+
+ // returned value should be 1 (error)
+ checkResult(status, 1);
+
+ // Check that the error contains error position.
+ EXPECT_TRUE(errorContainsPosition(status, "<string>"));
+}
};