Commit c9a71714 authored by Francis Dupont's avatar Francis Dupont
Browse files

[4106_update] Disable openError on Linux

parent 138586ec
......@@ -426,6 +426,8 @@ TEST_F(Dhcp4o6IpcBaseTest, openMultipleTimes) {
EXPECT_EQ(TEST_PORT + 10, ipc.getPort());
}
// Linux has a silly interpretation of SO_REUSEADDR so disable this on it
#if !defined(OS_LINUX)
// This test verifies that the socket remains open if there is a failure
// to open a new socket.
TEST_F(Dhcp4o6IpcBaseTest, openError) {
......@@ -439,25 +441,17 @@ TEST_F(Dhcp4o6IpcBaseTest, openError) {
ASSERT_NE(-1, ipc_bound.getSocketFd());
ipc.setDesiredPort(TEST_PORT + 10);
#if defined(OS_LINUX)
// Linux has a silly interpretation of SO_REUSEADDR so we use
// another way to raise an error.
ipc.setDesiredPort(65535);
#endif
ASSERT_THROW(ipc.open(), isc::dhcp::Dhcp4o6IpcError);
EXPECT_EQ(sock_fd, ipc.getSocketFd());
EXPECT_EQ(TEST_PORT, ipc.getPort());
ASSERT_NO_THROW(ipc_bound.close());
#if defined(OS_LINUX)
// Restore the expected value
ipc.setDesiredPort(TEST_PORT + 10);
#endif
ASSERT_NO_THROW(ipc.open());
EXPECT_NE(-1, ipc.getSocketFd());
EXPECT_EQ(TEST_PORT + 10, ipc.getPort());
}
#endif
// This test verifies that receiving packet over the IPC fails when there
// is no vendor option present.
......
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