]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[4106_update] Disable openError on Linux
authorFrancis Dupont <fdupont@isc.org>
Thu, 9 Jun 2016 13:29:35 +0000 (15:29 +0200)
committerFrancis Dupont <fdupont@isc.org>
Thu, 9 Jun 2016 13:29:35 +0000 (15:29 +0200)
src/lib/dhcpsrv/tests/dhcp4o6_ipc_unittest.cc

index 4d5720ed445ef9f7850ce826ff50ab3175f15bc3..0be8801ab55066df3b7b5fbb554c87322cdc8282 100644 (file)
@@ -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.