Commit c6522aa9 authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[master] Multiple small improvements in the unit tests.

Also, the read buffer for unix socket client is extended to 64k.
parent 1b57d207
......@@ -110,7 +110,7 @@ private:
CtrlAgentCommandMgr();
/// @brief Buffer into which responses to forwarded commands are stored.
std::array<char, 8192> receive_buf_;
std::array<char, 65535> receive_buf_;
};
......
......@@ -230,14 +230,16 @@ public:
// to this we need to run the server side socket at the same time.
// Running IO service in a thread guarantees that the server responds
// as soon as it receives the control command.
isc::util::thread::Thread(boost::bind(&CtrlAgentCommandMgrTest::runIO,
getIOService(), server_socket_,
expected_responses));
isc::util::thread::Thread th(boost::bind(&CtrlAgentCommandMgrTest::runIO,
getIOService(), server_socket_,
expected_responses));
ConstElementPtr command = createCommand("foo", service);
ConstElementPtr answer = mgr_.handleCommand("foo", ConstElementPtr(),
command);
th.wait();
checkAnswer(answer, expected_result0, expected_result1, expected_result2);
}
......@@ -364,13 +366,15 @@ TEST_F(CtrlAgentCommandMgrTest, forwardListCommands) {
// to this we need to run the server side socket at the same time.
// Running IO service in a thread guarantees that the server responds
// as soon as it receives the control command.
isc::util::thread::Thread(boost::bind(&CtrlAgentCommandMgrTest::runIO,
getIOService(), server_socket_, 1));
isc::util::thread::Thread th(boost::bind(&CtrlAgentCommandMgrTest::runIO,
getIOService(), server_socket_, 1));
ConstElementPtr command = createCommand("list-commands", "dhcp4");
ConstElementPtr answer = mgr_.handleCommand("list-commands", ConstElementPtr(),
command);
th.wait();
// Answer of 3 is specific to the stub response we send when the
// command is forwarded. So having this value returned means that
// the command was forwarded as expected.
......
......@@ -225,7 +225,11 @@ TestServerUnixSocket::bindServerSocket() {
}
void
TestServerUnixSocket::acceptHandler(const boost::system::error_code&) {
TestServerUnixSocket::acceptHandler(const boost::system::error_code& ec) {
if (ec) {
return;
}
connection_pool_->start(custom_response_);
accept();
}
......
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