2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 14:05:33 +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:
Thomas Markwalder
2024-02-16 09:51:43 -05:00
parent e235c2149c
commit 9524af1de7
3 changed files with 36 additions and 0 deletions

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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()).