mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 05:55:28 +00:00
[#3230] Added UTs for isSocketReceiveTimeSupported
src/lib/dhcp/tests/pkt_filter_inet6_unittest.cc src/lib/dhcp/tests/pkt_filter_inet_unittest.cc src/lib/dhcp/tests/pkt_filter_lpf_unittest.cc Added test for isSocketReceivedTimeSupported)
This commit is contained in:
@@ -31,6 +31,18 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// This test verifies that the PktFilterInet6 class reports its capability
|
||||
// to create SOCKET_RECEIVED events.
|
||||
TEST_F(PktFilterInet6Test, isSocketReceivedTimeSupported) {
|
||||
// Create object under test.
|
||||
PktFilterInet6 pkt_filter;
|
||||
#ifdef SO_TIMESTAMP
|
||||
EXPECT_TRUE(pkt_filter.isSocketReceivedTimeSupported());
|
||||
#else
|
||||
EXPECT_FALSE(pkt_filter.isSocketReceivedTimeSupported());
|
||||
#endif
|
||||
}
|
||||
|
||||
// This test verifies that the INET6 datagram socket is correctly opened and
|
||||
// bound to the appropriate address and port.
|
||||
TEST_F(PktFilterInet6Test, openSocket) {
|
||||
|
@@ -44,6 +44,18 @@ TEST_F(PktFilterInetTest, isDirectResponseSupported) {
|
||||
EXPECT_FALSE(pkt_filter.isDirectResponseSupported());
|
||||
}
|
||||
|
||||
// This test verifies that the PktFilterInet class reports its capability
|
||||
// to create SOCKET_RECEIVED events.
|
||||
TEST_F(PktFilterInetTest, isSocketReceivedTimeSupported) {
|
||||
// Create object under test.
|
||||
PktFilterInet pkt_filter;
|
||||
#ifdef SO_TIMESTAMP
|
||||
EXPECT_TRUE(pkt_filter.isSocketReceivedTimeSupported());
|
||||
#else
|
||||
EXPECT_FALSE(pkt_filter.isSocketReceivedTimeSupported());
|
||||
#endif
|
||||
}
|
||||
|
||||
// This test verifies that the INET datagram socket is correctly opened and
|
||||
// bound to the appropriate address and port.
|
||||
TEST_F(PktFilterInetTest, openSocket) {
|
||||
|
@@ -47,6 +47,18 @@ TEST_F(PktFilterLPFTest, isDirectResponseSupported) {
|
||||
EXPECT_TRUE(pkt_filter.isDirectResponseSupported());
|
||||
}
|
||||
|
||||
// This test verifies that the PktFilterLPF class reports its capability
|
||||
// to create SOCKET_RECEIVED events.
|
||||
TEST_F(PktFilterLPFTest, isSocketReceivedTimeSupported) {
|
||||
// Create object under test.
|
||||
PktFilterLPF pkt_filter;
|
||||
#ifdef SO_TIMESTAMP
|
||||
EXPECT_TRUE(pkt_filter.isSocketReceivedTimeSupported());
|
||||
#else
|
||||
EXPECT_FALSE(pkt_filter.isSocketReceivedTimeSupported());
|
||||
#endif
|
||||
}
|
||||
|
||||
// All tests below require root privileges to execute successfully. If they
|
||||
// are run as non-root they will be skipped via SKIP_IF(notRoot()).
|
||||
|
||||
|
Reference in New Issue
Block a user