diff --git a/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc b/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc index c39c56a69c..0785757a60 100644 --- a/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc +++ b/src/bin/dhcp4/tests/dhcp4_srv_unittest.cc @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -155,6 +156,14 @@ public: unlink(SRVID_FILE); } + virtual ~Dhcpv4SrvTest() { + + // Remove all registered hook points (it must be done even for tests that + // do not use hooks as the base class - Dhcpv4Srv calls allocation engine + // that registers hooks) + isc::hooks::ServerHooks::getServerHooks().reset(); + } + /// @brief Add 'Parameter Request List' option to the packet. /// /// This function PRL option comprising the following option codes: diff --git a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc index 277b7497f5..b40122d176 100644 --- a/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc +++ b/src/bin/dhcp6/tests/dhcp6_srv_unittest.cc @@ -111,7 +111,7 @@ public: virtual ~NakedDhcpv6Srv() { // Remove all registered hook points (it must be done even for tests that - // do not use hooks as the base class - Dhcpv6Srv registers hooks + // do not use hooks as the base class - Dhcpv6Srv registers hooks) ServerHooks::getServerHooks().reset(); // Close the lease database