"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/lib/config/tests/command_mgr_unittests.cc" between
kea-1.6.1.tar.gz and kea-1.6.2.tar.gz

About: Kea is a modern DHCPv4 & DHCPv6 Server (potential successor of ISC DHCP).

command_mgr_unittests.cc  (kea-1.6.1):command_mgr_unittests.cc  (kea-1.6.2)
// Copyright (C) 2015-2019 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2015-2020 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/. // file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h> #include <config.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <testutils/sandbox.h> #include <testutils/sandbox.h>
skipping to change at line 546 skipping to change at line 546
answer->str()); answer->str());
// Make sure invoked the command_processed callout // Make sure invoked the command_processed callout
EXPECT_EQ("command_processed_handler", callout_name_); EXPECT_EQ("command_processed_handler", callout_name_);
// Verify the callout could extract all the context arguments // Verify the callout could extract all the context arguments
EXPECT_EQ("change-response:[ \"just\", \"some\", \"data\" ]:" EXPECT_EQ("change-response:[ \"just\", \"some\", \"data\" ]:"
"{ \"result\": 2, \"text\": \"'change-response' command not support ed.\" }", "{ \"result\": 2, \"text\": \"'change-response' command not support ed.\" }",
processed_log_); processed_log_);
} }
// Verifies that a socket cannot be concurrently opened more than once.
TEST_F(CommandMgrTest, exclusiveOpen) {
// Pass in valid parameters.
ElementPtr socket_info = Element::createMap();
socket_info->set("socket-type", Element::create("unix"));
socket_info->set("socket-name", Element::create(getSocketPath()));
EXPECT_NO_THROW(CommandMgr::instance().openCommandSocket(socket_info));
EXPECT_GE(CommandMgr::instance().getControlSocketFD(), 0);
// Should not be able to open it twice.
EXPECT_THROW(CommandMgr::instance().openCommandSocket(socket_info),
isc::config::SocketError);
// Now let's close it.
EXPECT_NO_THROW(CommandMgr::instance().closeCommandSocket());
// Should be able to re-open it now.
EXPECT_NO_THROW(CommandMgr::instance().openCommandSocket(socket_info));
EXPECT_GE(CommandMgr::instance().getControlSocketFD(), 0);
// Now let's close it.
EXPECT_NO_THROW(CommandMgr::instance().closeCommandSocket());
}
 End of changes. 2 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)