From: Marcin Siodelski Date: Tue, 10 Nov 2015 09:30:19 +0000 (+0100) Subject: [4106] Additional checks on packet received over the IPC in the test. X-Git-Tag: trac4296_base~2^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=12bb372134d2fefbdedde3a9cea69dbd21543521;p=thirdparty%2Fkea.git [4106] Additional checks on packet received over the IPC in the test. --- diff --git a/src/bin/dhcp4/tests/dhcp4_dhcp4o6_ipc_unittest.cc b/src/bin/dhcp4/tests/dhcp4_dhcp4o6_ipc_unittest.cc index 149adc0901..a8b42f7aa0 100644 --- a/src/bin/dhcp4/tests/dhcp4_dhcp4o6_ipc_unittest.cc +++ b/src/bin/dhcp4/tests/dhcp4_dhcp4o6_ipc_unittest.cc @@ -13,6 +13,7 @@ // PERFORMANCE OF THIS SOFTWARE. #include +#include #include #include #include @@ -23,6 +24,7 @@ #include using namespace isc; +using namespace isc::asiolink; using namespace isc::dhcp; using namespace isc::dhcp::test; using namespace isc::util; @@ -101,6 +103,7 @@ TEST_F(Dhcp4o6IpcTest, receive) { Pkt6Ptr pkt(new Pkt6(DHCPV6_DHCPV4_QUERY, 1234)); pkt->addOption(createDHCPv4MsgOption()); pkt->setIface("eth0"); + pkt->setRemoteAddr(IOAddress("2001:db8:1::123")); ASSERT_NO_THROW(pkt->pack()); // Send and wait up to 1 second to receive it. @@ -110,6 +113,10 @@ TEST_F(Dhcp4o6IpcTest, receive) { // Make sure that the message has been received. Pkt4o6Ptr pkt_received = ipc.getReceived(); ASSERT_TRUE(pkt_received); + Pkt6Ptr pkt6_received = pkt_received->getPkt6(); + ASSERT_TRUE(pkt6_received); + EXPECT_EQ("eth0", pkt6_received->getIface()); + EXPECT_EQ("2001:db8:1::123", pkt6_received->getRemoteAddr().toText()); } } // end of anonymous namespace