]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[master] Compilation fix, a mother of all fixes:
authorTomek Mrugalski <tomasz@isc.org>
Fri, 19 Jun 2015 16:40:35 +0000 (18:40 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Fri, 19 Jun 2015 16:40:35 +0000 (18:40 +0200)
 - linker failure in lfc (and tests), added libkea-cc
 - linker failure in dhcp6 (and tests), added libkea-stats
 - remove troublesome CtrlDhcpv4SrvTest.DISABLED_commandSocketBasic test

src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
src/bin/dhcp6/Makefile.am
src/bin/dhcp6/tests/Makefile.am
src/bin/lfc/Makefile.am
src/bin/lfc/tests/Makefile.am

index c766a540e62f9b09dbda0874c146ef0112e6b7da..29efa3735343d94aa97d4043ca98546a52d21ea0 100644 (file)
@@ -260,91 +260,4 @@ TEST_F(CtrlDhcpv4SrvTest, commandsRegistration) {
     EXPECT_EQ("[ \"list-commands\" ]", answer->get("arguments")->str());
 }
 
-// Checks if the server is able to parse control socket configuration and
-// configures the command socket properly.
-
-/// @todo: This unit-test is disabled, because it causes weird issues, when
-/// IfaceMgr::receive4() is called in a separate process. That's a side effect
-/// of how we run the test. We should either investigate why IfaceMgr doesn't
-/// work correctly after fork or develop a small tool that will send data
-/// from stdin to specified UNIX socket, print out the responses on stdout
-/// and develop shell tests for this.
-///
-/// Note that the test passes when run on its own, but not when run along with
-/// other unit-tests.
-TEST_F(CtrlDhcpv4SrvTest, DISABLED_commandSocketBasic) {
-
-    string socket_path = string(TEST_DATA_BUILDDIR) + "/kea4.sock";
-    ::remove(socket_path.c_str());
-
-    // Just a simple config. The important part here is the socket
-    // location information.
-    std::string config_txt =
-        "{"
-        "    \"interfaces-config\": {"
-        "        \"interfaces\": [ \"*\" ]"
-        "    },"
-        "    \"rebind-timer\": 2000, "
-        "    \"renew-timer\": 1000, "
-        "    \"subnet4\": [ ],"
-        "    \"valid-lifetime\": 4000,"
-        "    \"control-socket\": {"
-        "        \"socket-type\": \"unix\","
-        "        \"socket-name\": \"" + socket_path + "\""
-        "    },"
-        "    \"lease-database\": { \"type\": \"memfile\", \"persist\": false }"
-        "}";
-
-    pid_t pid = fork();
-    if (pid > 0) {
-        cout << "Created child process: " << pid << endl;
-
-        string command("{ \"command\": \"shutdown\" }");
-        string response;
-
-        sleep(3);
-
-        EXPECT_TRUE(sendCommandUnixSocket(command, response, socket_path));
-
-        kill(pid, SIGTERM);
-        int status;
-        waitpid(pid, &status, 0);
-
-        ASSERT_NE(0, response.length());
-
-        ConstElementPtr rsp;
-        EXPECT_NO_THROW(rsp = Element::fromJSON(response));
-        ASSERT_TRUE(rsp);
-
-        int status_code;
-        ConstElementPtr comment = parseAnswer(status_code, rsp);
-        EXPECT_EQ(0, status_code);
-    } else {
-
-        IfaceMgr::instance().deleteAllExternalSockets();
-
-        boost::scoped_ptr<ControlledDhcpv4Srv> srv;
-        ASSERT_NO_THROW(
-            srv.reset(new ControlledDhcpv4Srv(0));
-            );
-
-        ConstElementPtr config = Element::fromJSON(config_txt);
-
-        ConstElementPtr answer = srv->processConfig(config);
-        ASSERT_TRUE(answer);
-
-        int status = 0;
-        isc::config::parseAnswer(status, answer);
-        EXPECT_EQ(0, status);
-
-        // Now check that the socket was indeed open.
-        ASSERT_TRUE(isc::config::CommandMgr::instance().getControlSocketFD() > -1);
-
-        cout << "Child process: pid=" << pid << ", running server." << endl;
-        srv->run();
-
-        exit(EXIT_SUCCESS);
-    }
-}
-
 } // End of anonymous namespace
index a899787db76646846f01ad099f4a47d38619b080..5140dfa152b05aac09ffdc25875edb2d89f22741 100644 (file)
@@ -80,6 +80,7 @@ kea_dhcp6_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
 kea_dhcp6_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
 kea_dhcp6_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
 kea_dhcp6_LDADD += $(top_builddir)/src/bin/cfgrpt/libcfgrpt.la
+kea_dhcp6_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
 
 kea_dhcp6dir = $(pkgdatadir)
 kea_dhcp6_DATA = dhcp6.spec
index 07b94d811733cb24bb98014e98e6167d9e1a3dd7..b4157c72e11d7e69f87537f9a16cdd86b8addf37 100644 (file)
@@ -111,6 +111,8 @@ dhcp6_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
 dhcp6_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
 dhcp6_unittests_LDADD += $(top_builddir)/src/lib/util/io/libkea-util-io.la
 dhcp6_unittests_LDADD += $(top_builddir)/src/bin/cfgrpt/libcfgrpt.la
+dhcp6_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
+
 endif
 
 noinst_PROGRAMS = $(TESTS)
index 693605028fb3fcf3b9bde8aab79fa9e6f62f5551..ad5ba54a27bb70755566a3c54723e4aeeffed261 100644 (file)
@@ -64,6 +64,7 @@ kea_lfc_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
 kea_lfc_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
 kea_lfc_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
 kea_lfc_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
+kea_lfc_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
 kea_lfc_LDADD += $(top_builddir)/src/bin/cfgrpt/libcfgrpt.la
 
 kea_lfcdir = $(pkgdatadir)
index 5b14846ea1ebf8b587a878b56d6b96d690c2ecd2..11bfd3277a914b844f5a7c2f41d5c9bdd07dd94f 100644 (file)
@@ -57,6 +57,7 @@ lfc_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
 lfc_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
 lfc_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
 lfc_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
+lfc_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
 lfc_unittests_LDADD += $(top_builddir)/src/bin/cfgrpt/libcfgrpt.la
 
 endif