Commit 2688a2a8 authored by Marcin Siodelski's avatar Marcin Siodelski

[5317] Use poll() instead of run_one() in Ctrl DHCP server unit tests.

parent 03d3566d
......@@ -190,17 +190,13 @@ public:
client.reset(new UnixControlClient());
ASSERT_TRUE(client);
// Connect and then call server's receivePacket() so it can
// detect the control socket connect and call the accept handler
// Connect.
ASSERT_TRUE(client->connectToServer(socket_path_));
ASSERT_NO_THROW(server_->receivePacket(0));
ASSERT_NO_THROW(getIOService()->run_one());
ASSERT_NO_THROW(getIOService()->poll());
// Send the command and then call server's receivePacket() so it can
// detect the inbound data and call the read handler
// Send the command.
ASSERT_TRUE(client->sendCommand(command));
ASSERT_NO_THROW(server_->receivePacket(0));
ASSERT_NO_THROW(getIOService()->run_one());
ASSERT_NO_THROW(getIOService()->poll());
// Read the response generated by the server. Note that getResponse
// only fails if there an IO error or no response data was present.
......@@ -209,8 +205,6 @@ public:
// Now disconnect and process the close event
client->disconnectFromServer();
ASSERT_NO_THROW(server_->receivePacket(0));
// ASSERT_NO_THROW(getIOService()->run_one());
ASSERT_NO_THROW(getIOService()->poll());
}
......
......@@ -200,17 +200,13 @@ public:
client.reset(new UnixControlClient());
ASSERT_TRUE(client);
// Connect and then call server's receivePacket() so it can
// detect the control socket connect and call the accept handler
// Connect.
ASSERT_TRUE(client->connectToServer(socket_path_));
ASSERT_NO_THROW(server_->receivePacket(0));
ASSERT_NO_THROW(getIOService()->run_one());
ASSERT_NO_THROW(getIOService()->poll());
// Send the command and then call server's receivePacket() so it can
// detect the inbound data and call the read handler
// Send the command.
ASSERT_TRUE(client->sendCommand(command));
ASSERT_NO_THROW(server_->receivePacket(0));
ASSERT_NO_THROW(getIOService()->run_one());
ASSERT_NO_THROW(getIOService()->poll());
// Read the response generated by the server. Note that getResponse
// only fails if there an IO error or no response data was present.
......@@ -219,7 +215,6 @@ public:
// Now disconnect and process the close event
client->disconnectFromServer();
ASSERT_NO_THROW(server_->receivePacket(0));
ASSERT_NO_THROW(getIOService()->poll());
}
......
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