|
@@ -27,6 +27,9 @@
|
|
|
using namespace isc::dhcp;
|
|
|
|
|
|
namespace {
|
|
|
+
|
|
|
+/// @brief A Fixture class dedicated to testing of the Pkt4o6 class that
|
|
|
+/// represents a DHCPv4-over-DHCPv6 packet.
|
|
|
class Pkt4o6Test : public ::testing::Test {
|
|
|
protected:
|
|
|
Pkt4o6Test() :
|
|
@@ -48,6 +51,7 @@ protected:
|
|
|
OptionBuffer buffer4_; // wire-format data buffer of pkt4_
|
|
|
};
|
|
|
|
|
|
+// This test verifies that the constructors are working as expected.
|
|
|
TEST_F(Pkt4o6Test, construct) {
|
|
|
// Construct 4o6 packet, unpack the data to examine it
|
|
|
boost::scoped_ptr<Pkt4o6> pkt4o6(new Pkt4o6(buffer4_, pkt6_));
|
|
@@ -68,6 +72,8 @@ TEST_F(Pkt4o6Test, construct) {
|
|
|
EXPECT_EQ(DHCPDISCOVER, pkt4o6->getType());
|
|
|
}
|
|
|
|
|
|
+// This test verifies that the pack() method handles the building
|
|
|
+// process correctly.
|
|
|
TEST_F(Pkt4o6Test, pack) {
|
|
|
// prepare unpacked DHCPv4 packet (see the note in constructor test)
|
|
|
pkt4_.reset(new Pkt4(&buffer4_[0], buffer4_.size()));
|
|
@@ -95,4 +101,6 @@ TEST_F(Pkt4o6Test, pack) {
|
|
|
EXPECT_EQ(0, memcmp(&cp[8], &buffer4_[0], buffer4_.size()));
|
|
|
}
|
|
|
|
|
|
+/// @todo: Add a test that handles actual DHCP4o6 traffic capture
|
|
|
+/// once we get it. We should add the capture to pkt_captures{4,6}.cc
|
|
|
}
|