Skip to content
GitLab
Menu
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
2688a2a8
Commit
2688a2a8
authored
Jun 22, 2017
by
Marcin Siodelski
Browse files
[5317] Use poll() instead of run_one() in Ctrl DHCP server unit tests.
parent
03d3566d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
View file @
2688a2a8
...
@@ -190,17 +190,13 @@ public:
...
@@ -190,17 +190,13 @@ public:
client
.
reset
(
new
UnixControlClient
());
client
.
reset
(
new
UnixControlClient
());
ASSERT_TRUE
(
client
);
ASSERT_TRUE
(
client
);
// Connect and then call server's receivePacket() so it can
// Connect.
// detect the control socket connect and call the accept handler
ASSERT_TRUE
(
client
->
connectToServer
(
socket_path_
));
ASSERT_TRUE
(
client
->
connectToServer
(
socket_path_
));
ASSERT_NO_THROW
(
server_
->
receivePacket
(
0
));
ASSERT_NO_THROW
(
getIOService
()
->
poll
());
ASSERT_NO_THROW
(
getIOService
()
->
run_one
());
// Send the command and then call server's receivePacket() so it can
// Send the command.
// detect the inbound data and call the read handler
ASSERT_TRUE
(
client
->
sendCommand
(
command
));
ASSERT_TRUE
(
client
->
sendCommand
(
command
));
ASSERT_NO_THROW
(
server_
->
receivePacket
(
0
));
ASSERT_NO_THROW
(
getIOService
()
->
poll
());
ASSERT_NO_THROW
(
getIOService
()
->
run_one
());
// Read the response generated by the server. Note that getResponse
// Read the response generated by the server. Note that getResponse
// only fails if there an IO error or no response data was present.
// only fails if there an IO error or no response data was present.
...
@@ -209,8 +205,6 @@ public:
...
@@ -209,8 +205,6 @@ public:
// Now disconnect and process the close event
// Now disconnect and process the close event
client
->
disconnectFromServer
();
client
->
disconnectFromServer
();
ASSERT_NO_THROW
(
server_
->
receivePacket
(
0
));
// ASSERT_NO_THROW(getIOService()->run_one());
ASSERT_NO_THROW
(
getIOService
()
->
poll
());
ASSERT_NO_THROW
(
getIOService
()
->
poll
());
}
}
...
...
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
View file @
2688a2a8
...
@@ -200,17 +200,13 @@ public:
...
@@ -200,17 +200,13 @@ public:
client
.
reset
(
new
UnixControlClient
());
client
.
reset
(
new
UnixControlClient
());
ASSERT_TRUE
(
client
);
ASSERT_TRUE
(
client
);
// Connect and then call server's receivePacket() so it can
// Connect.
// detect the control socket connect and call the accept handler
ASSERT_TRUE
(
client
->
connectToServer
(
socket_path_
));
ASSERT_TRUE
(
client
->
connectToServer
(
socket_path_
));
ASSERT_NO_THROW
(
server_
->
receivePacket
(
0
));
ASSERT_NO_THROW
(
getIOService
()
->
poll
());
ASSERT_NO_THROW
(
getIOService
()
->
run_one
());
// Send the command and then call server's receivePacket() so it can
// Send the command.
// detect the inbound data and call the read handler
ASSERT_TRUE
(
client
->
sendCommand
(
command
));
ASSERT_TRUE
(
client
->
sendCommand
(
command
));
ASSERT_NO_THROW
(
server_
->
receivePacket
(
0
));
ASSERT_NO_THROW
(
getIOService
()
->
poll
());
ASSERT_NO_THROW
(
getIOService
()
->
run_one
());
// Read the response generated by the server. Note that getResponse
// Read the response generated by the server. Note that getResponse
// only fails if there an IO error or no response data was present.
// only fails if there an IO error or no response data was present.
...
@@ -219,7 +215,6 @@ public:
...
@@ -219,7 +215,6 @@ public:
// Now disconnect and process the close event
// Now disconnect and process the close event
client
->
disconnectFromServer
();
client
->
disconnectFromServer
();
ASSERT_NO_THROW
(
server_
->
receivePacket
(
0
));
ASSERT_NO_THROW
(
getIOService
()
->
poll
());
ASSERT_NO_THROW
(
getIOService
()
->
poll
());
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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