mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 21:45:37 +00:00
[#1403] ha-sync-complete-notify command created
Implemented creator for the ha-sync-complete-notify command.
This commit is contained in:
@@ -221,6 +221,13 @@ CommandCreator::createMaintenanceNotify(const bool cancel, const HAServerType& s
|
|||||||
return (command);
|
return (command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ConstElementPtr
|
||||||
|
CommandCreator::createSyncCompleteNotify(const HAServerType& server_type) {
|
||||||
|
auto command = config::createCommand("ha-sync-complete-notify");
|
||||||
|
insertService(command, server_type);
|
||||||
|
return (command);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CommandCreator::insertLeaseExpireTime(ElementPtr& lease) {
|
CommandCreator::insertLeaseExpireTime(ElementPtr& lease) {
|
||||||
if ((lease->getType() != Element::map) ||
|
if ((lease->getType() != Element::map) ||
|
||||||
|
@@ -165,6 +165,13 @@ public:
|
|||||||
static data::ConstElementPtr
|
static data::ConstElementPtr
|
||||||
createMaintenanceNotify(const bool cancel, const HAServerType& server_type);
|
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:
|
private:
|
||||||
|
|
||||||
/// @brief Replaces "cltt" with "expire" value within the lease.
|
/// @brief Replaces "cltt" with "expire" value within the lease.
|
||||||
|
@@ -500,4 +500,19 @@ TEST(CommandCreatorTest, createMaintenanceNotify6) {
|
|||||||
EXPECT_FALSE(cancel->boolValue());
|
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"));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user