From: Francis Dupont Date: Thu, 9 Jun 2016 13:29:35 +0000 (+0200) Subject: [4106_update] Disable openError on Linux X-Git-Tag: trac4109a_base~2^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9a717143b0b7e648b8ceed804a2b401cd0fc830;p=thirdparty%2Fkea.git [4106_update] Disable openError on Linux --- diff --git a/src/lib/dhcpsrv/tests/dhcp4o6_ipc_unittest.cc b/src/lib/dhcpsrv/tests/dhcp4o6_ipc_unittest.cc index 4d5720ed44..0be8801ab5 100644 --- a/src/lib/dhcpsrv/tests/dhcp4o6_ipc_unittest.cc +++ b/src/lib/dhcpsrv/tests/dhcp4o6_ipc_unittest.cc @@ -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.