|
@@ -235,14 +235,8 @@ TEST_F(CtrlDhcpv6SrvTest, commands) {
|
|
|
}
|
|
|
|
|
|
// Check that the "libreload" command will reload libraries
|
|
|
-TEST_F(CtrlDhcpv6SrvTest, libreload) {
|
|
|
-
|
|
|
- // Sending commands for processing now requires a server that can process
|
|
|
- // them.
|
|
|
- boost::scoped_ptr<ControlledDhcpv6Srv> srv;
|
|
|
- ASSERT_NO_THROW(
|
|
|
- srv.reset(new ControlledDhcpv6Srv(0))
|
|
|
- );
|
|
|
+TEST_F(CtrlChannelDhcpv6SrvTest, libreload) {
|
|
|
+ createUnixChannelServer();
|
|
|
|
|
|
// Ensure no marker files to start with.
|
|
|
ASSERT_FALSE(checkMarkerFileExists(LOAD_MARKER_FILE));
|
|
@@ -268,15 +262,11 @@ TEST_F(CtrlDhcpv6SrvTest, libreload) {
|
|
|
|
|
|
// Now execute the "libreload" command. This should cause the libraries
|
|
|
// to unload and to reload.
|
|
|
-
|
|
|
- // Use empty parameters list
|
|
|
- ElementPtr params(new isc::data::MapElement());
|
|
|
- int rcode = -1;
|
|
|
-
|
|
|
- ConstElementPtr result =
|
|
|
- ControlledDhcpv6Srv::processCommand("libreload", params);
|
|
|
- ConstElementPtr comment = isc::config::parseAnswer(rcode, result);
|
|
|
- EXPECT_EQ(0, rcode); // Expect success
|
|
|
+ std::string response;
|
|
|
+ sendUnixCommand("{ \"command\": \"libreload\" }", response);
|
|
|
+ EXPECT_EQ("{ \"result\": 0, "
|
|
|
+ "\"text\": \"Hooks libraries successfully reloaded.\" }"
|
|
|
+ , response);
|
|
|
|
|
|
// Check that the libraries have unloaded and reloaded. The libraries are
|
|
|
// unloaded in the reverse order to which they are loaded. When they load,
|
|
@@ -295,7 +285,7 @@ TEST_F(CtrlDhcpv6SrvTest, configReload) {
|
|
|
srv.reset(new ControlledDhcpv6Srv(0))
|
|
|
);
|
|
|
|
|
|
- // Now execute the "libreload" command. This should cause the libraries
|
|
|
+ // Now execute the "config-reload" command. This should cause the libraries
|
|
|
// to unload and to reload.
|
|
|
|
|
|
// Use empty parameters list
|