Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
c9a71714
Commit
c9a71714
authored
Jun 09, 2016
by
Francis Dupont
Browse files
[4106_update] Disable openError on Linux
parent
138586ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcpsrv/tests/dhcp4o6_ipc_unittest.cc
View file @
c9a71714
...
...
@@ -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.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment