diff options
author | Razvan Becheriu <razvan@isc.org> | 2023-10-14 07:42:17 +0200 |
---|---|---|
committer | Andrei Pavel <andrei@isc.org> | 2023-10-17 11:35:55 +0200 |
commit | bd70361ef9b74b36565bb6d9a6233b7425efe981 (patch) | |
tree | abdb64db235e3f1f8b2b988b9d6dc2e8ac104cbd /src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc | |
parent | [#3017] added testing framework for using dummy test interfaces (diff) | |
download | kea-bd70361ef9b74b36565bb6d9a6233b7425efe981.tar.xz kea-bd70361ef9b74b36565bb6d9a6233b7425efe981.zip |
[#3017] create checkDetectIfaces to do persistent checks
Diffstat (limited to 'src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc')
-rw-r--r-- | src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc b/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc index a47ca2c581..963cfd12b2 100644 --- a/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc +++ b/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc @@ -121,7 +121,8 @@ public: } reset(); IfaceMgr::instance().setTestMode(false); - IfaceMgr::instance().setDetectCallback(isc::dhcp::IfaceMgr::DetectCallback()); + IfaceMgr::instance().setDetectCallback(std::bind(&IfaceMgr::checkDetectIfaces, + IfaceMgr::instancePtr().get(), ph::_1)); } /// @brief Destructor @@ -135,7 +136,8 @@ public: server_.reset(); IfaceMgr::instance().setTestMode(false); - IfaceMgr::instance().setDetectCallback(isc::dhcp::IfaceMgr::DetectCallback()); + IfaceMgr::instance().setDetectCallback(std::bind(&IfaceMgr::checkDetectIfaces, + IfaceMgr::instancePtr().get(), ph::_1)); IfaceMgr::instance().clearIfaces(); IfaceMgr::instance().closeSockets(); IfaceMgr::instance().detectIfaces(); @@ -1623,7 +1625,8 @@ TEST_F(CtrlChannelDhcpv4SrvTest, configReloadValid) { // file is loaded correctly. TEST_F(CtrlChannelDhcpv4SrvTest, configReloadDetectInterfaces) { interfaces_ = "\"eth0\""; - IfacePtr eth0 = IfaceMgrTestConfig::createIface("eth0", 0); + IfacePtr eth0 = IfaceMgrTestConfig::createIface("eth0", ETH0_INDEX, + "11:22:33:44:55:66"); auto detectIfaces = [&](bool update_only) { if (!update_only) { eth0->addAddress(IOAddress("10.0.0.1")); @@ -1662,7 +1665,8 @@ TEST_F(CtrlChannelDhcpv4SrvTest, configReloadDetectInterfaces) { f << cfg_txt; f.close(); - IfacePtr eth1 = IfaceMgrTestConfig::createIface("eth1", 1); + IfacePtr eth1 = IfaceMgrTestConfig::createIface("eth1", ETH1_INDEX, + "AA:BB:CC:DD:EE:FF"); auto detectUpdateIfaces = [&](bool update_only) { if (!update_only) { eth1->addAddress(IOAddress("192.0.2.3")); |