return (command);
}
+ConstElementPtr
+CommandCreator::createSyncCompleteNotify(const HAServerType& server_type) {
+ auto command = config::createCommand("ha-sync-complete-notify");
+ insertService(command, server_type);
+ return (command);
+}
+
void
CommandCreator::insertLeaseExpireTime(ElementPtr& lease) {
if ((lease->getType() != Element::map) ||
static data::ConstElementPtr
createMaintenanceNotify(const bool cancel, const HAServerType& server_type);
+ /// @brief Creates ha-sync-complete-notify command.
+ ///
+ /// @param server_type type of the DHCP server, i.e. v4 or v6.
+ /// @return Pointer to the JSON representation of the command.
+ static data::ConstElementPtr
+ createSyncCompleteNotify(const HAServerType& server_type);
+
private:
/// @brief Replaces "cltt" with "expire" value within the lease.
EXPECT_FALSE(cancel->boolValue());
}
+// This test verifies that the ha-sync-complete-notify command sent to a
+// DHCPv4 server is correct.
+TEST(CommandCreatorTest, createSyncCompleteNotify4) {
+ ConstElementPtr command = CommandCreator::createSyncCompleteNotify(HAServerType::DHCPv4);
+ ASSERT_NO_FATAL_FAILURE(testCommandBasics(command, "ha-sync-complete-notify", "dhcp4"));
+}
+
+// This test verifies that the ha-sync-complete-notify command sent to a
+// DHCPv4 server is correct.
+TEST(CommandCreatorTest, createSyncCompleteNotify6) {
+ ConstElementPtr command = CommandCreator::createSyncCompleteNotify(HAServerType::DHCPv6);
+ ConstElementPtr arguments;
+ ASSERT_NO_FATAL_FAILURE(testCommandBasics(command, "ha-sync-complete-notify", "dhcp6"));
+}
+
}