|
@@ -38,14 +38,14 @@ const uint16_t TEST_PORT = 32000;
|
|
typedef Dhcp4o6TestIpc TestIpc;
|
|
typedef Dhcp4o6TestIpc TestIpc;
|
|
|
|
|
|
/// @brief Test fixture class for DHCPv4 endpoint of DHCPv4o6 IPC.
|
|
/// @brief Test fixture class for DHCPv4 endpoint of DHCPv4o6 IPC.
|
|
-class Dhcp4o6IpcTest : public ::testing::Test {
|
|
|
|
|
|
+class Dhcp4to6IpcTest : public ::testing::Test {
|
|
public:
|
|
public:
|
|
|
|
|
|
/// @brief Constructor
|
|
/// @brief Constructor
|
|
///
|
|
///
|
|
/// Configures IPC to use a test port. It also provides a fake
|
|
/// Configures IPC to use a test port. It also provides a fake
|
|
/// configuration of interfaces.
|
|
/// configuration of interfaces.
|
|
- Dhcp4o6IpcTest()
|
|
|
|
|
|
+ Dhcp4to6IpcTest()
|
|
: iface_mgr_test_config_(true) {
|
|
: iface_mgr_test_config_(true) {
|
|
configurePort(TEST_PORT);
|
|
configurePort(TEST_PORT);
|
|
}
|
|
}
|
|
@@ -68,12 +68,12 @@ private:
|
|
};
|
|
};
|
|
|
|
|
|
void
|
|
void
|
|
-Dhcp4o6IpcTest::configurePort(const uint16_t port) {
|
|
|
|
|
|
+Dhcp4to6IpcTest::configurePort(const uint16_t port) {
|
|
CfgMgr::instance().getStagingCfg()->setDhcp4o6Port(port);
|
|
CfgMgr::instance().getStagingCfg()->setDhcp4o6Port(port);
|
|
}
|
|
}
|
|
|
|
|
|
OptionPtr
|
|
OptionPtr
|
|
-Dhcp4o6IpcTest::createDHCPv4MsgOption() const {
|
|
|
|
|
|
+Dhcp4to6IpcTest::createDHCPv4MsgOption() const {
|
|
// Create the DHCPv4 message.
|
|
// Create the DHCPv4 message.
|
|
Pkt4Ptr pkt(new Pkt4(DHCPREQUEST, 1234));
|
|
Pkt4Ptr pkt(new Pkt4(DHCPREQUEST, 1234));
|
|
// Make a wire representation of the DHCPv4 message.
|
|
// Make a wire representation of the DHCPv4 message.
|
|
@@ -89,9 +89,9 @@ Dhcp4o6IpcTest::createDHCPv4MsgOption() const {
|
|
|
|
|
|
// This test verifies that the DHCPv4 endpoint of the DHCPv4o6 IPC can
|
|
// This test verifies that the DHCPv4 endpoint of the DHCPv4o6 IPC can
|
|
// receive messages.
|
|
// receive messages.
|
|
-TEST_F(Dhcp4o6IpcTest, receive) {
|
|
|
|
|
|
+TEST_F(Dhcp4to6IpcTest, receive) {
|
|
// Create instance of the IPC endpoint under test.
|
|
// Create instance of the IPC endpoint under test.
|
|
- Dhcp4o6Ipc& ipc = Dhcp4o6Ipc::instance();
|
|
|
|
|
|
+ Dhcp4to6Ipc& ipc = Dhcp4to6Ipc::instance();
|
|
// Create instance of the IPC endpoint being used as a source of messages.
|
|
// Create instance of the IPC endpoint being used as a source of messages.
|
|
TestIpc src_ipc(TEST_PORT, TestIpc::ENDPOINT_TYPE_V6);
|
|
TestIpc src_ipc(TEST_PORT, TestIpc::ENDPOINT_TYPE_V6);
|
|
|
|
|
|
@@ -121,9 +121,9 @@ TEST_F(Dhcp4o6IpcTest, receive) {
|
|
|
|
|
|
// This test verifies that message with multiple DHCPv4 query options
|
|
// This test verifies that message with multiple DHCPv4 query options
|
|
// is rejected.
|
|
// is rejected.
|
|
-TEST_F(Dhcp4o6IpcTest, receiveMultipleQueries) {
|
|
|
|
|
|
+TEST_F(Dhcp4to6IpcTest, receiveMultipleQueries) {
|
|
// Create instance of the IPC endpoint under test.
|
|
// Create instance of the IPC endpoint under test.
|
|
- Dhcp4o6Ipc& ipc = Dhcp4o6Ipc::instance();
|
|
|
|
|
|
+ Dhcp4to6Ipc& ipc = Dhcp4to6Ipc::instance();
|
|
// Create instance of the IPC endpoint being used as a source of messages.
|
|
// Create instance of the IPC endpoint being used as a source of messages.
|
|
TestIpc src_ipc(TEST_PORT, TestIpc::ENDPOINT_TYPE_V6);
|
|
TestIpc src_ipc(TEST_PORT, TestIpc::ENDPOINT_TYPE_V6);
|
|
|
|
|
|
@@ -147,9 +147,9 @@ TEST_F(Dhcp4o6IpcTest, receiveMultipleQueries) {
|
|
}
|
|
}
|
|
|
|
|
|
// This test verifies that message with no DHCPv4 query options is rejected.
|
|
// This test verifies that message with no DHCPv4 query options is rejected.
|
|
-TEST_F(Dhcp4o6IpcTest, receiveNoQueries) {
|
|
|
|
|
|
+TEST_F(Dhcp4to6IpcTest, receiveNoQueries) {
|
|
// Create instance of the IPC endpoint under test.
|
|
// Create instance of the IPC endpoint under test.
|
|
- Dhcp4o6Ipc& ipc = Dhcp4o6Ipc::instance();
|
|
|
|
|
|
+ Dhcp4to6Ipc& ipc = Dhcp4to6Ipc::instance();
|
|
// Create instance of the IPC endpoint being used as a source of messages.
|
|
// Create instance of the IPC endpoint being used as a source of messages.
|
|
TestIpc src_ipc(TEST_PORT, TestIpc::ENDPOINT_TYPE_V6);
|
|
TestIpc src_ipc(TEST_PORT, TestIpc::ENDPOINT_TYPE_V6);
|
|
|
|
|