Commit 9a981e50 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰 Committed by Francis Dupont
Browse files

[#898] Unit-tests now check for DHCP class

parent 989188af
......@@ -5,7 +5,7 @@ BOOTP support
.. note::
This is library is still in experimental phase. Use with care!
This is library is still in experimental phase. Use with care!
This hooks library adds support for BOOTP with vendor information extensions
......
......@@ -90,6 +90,12 @@ public:
} else {
EXPECT_EQ(type, pkt->getType());
}
if (dhcp) {
EXPECT_TRUE(pkt->inClass("DHCP"));
} else {
EXPECT_FALSE(pkt->inClass("DHCP"));
}
}
/// @brief Callout manager accessed by this CalloutHandle.
......@@ -118,7 +124,7 @@ TEST_F(BootpTest, dhcpOffer) {
TEST_F(BootpTest, bootReply) {
// The constructor does not allow to directly create a BOOTREPLY packet.
Pkt4Ptr pkt(new Pkt4(DHCPOFFER, 12345));
pkt->setType(DHCP_NOTYPE);
//pkt->setType(DHCP_NOTYPE);
pkt->delOption(DHO_DHCP_MESSAGE_TYPE);
ASSERT_EQ(BOOTREPLY, pkt->getOp());
calloutsCall(pkt, false);
......@@ -128,7 +134,7 @@ TEST_F(BootpTest, bootReply) {
TEST_F(BootpTest, bootRequest) {
// The constructor does not allow to directly create a BOOTREQUEST packet.
Pkt4Ptr pkt(new Pkt4(DHCPDISCOVER, 12345));
pkt->setType(DHCP_NOTYPE);
// pkt->setType(DHCP_NOTYPE);
pkt->delOption(DHO_DHCP_MESSAGE_TYPE);
ASSERT_EQ(BOOTREQUEST, pkt->getOp());
calloutsCall(pkt, true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment