From: JINMEI Tatuya Date: Thu, 6 Oct 2011 22:56:56 +0000 (-0700) Subject: [master] a quickhack fix to discheck failure in dhcp6/tests. X-Git-Tag: perftcpdns_before_epoll~37^2~21^2~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d119c3155e617e120c69abebcf8d22e500dcffca;p=thirdparty%2Fkea.git [master] a quickhack fix to discheck failure in dhcp6/tests. okayed on jabber --- diff --git a/src/bin/dhcp6/tests/Makefile.am b/src/bin/dhcp6/tests/Makefile.am index 873b21fc00..ae9d8e3173 100644 --- a/src/bin/dhcp6/tests/Makefile.am +++ b/src/bin/dhcp6/tests/Makefile.am @@ -29,9 +29,11 @@ AM_CPPFLAGS += -I$(top_builddir)/src/lib/cc AM_CPPFLAGS += -I$(top_srcdir)/src/lib/asiolink AM_CPPFLAGS += $(BOOST_INCLUDES) AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(abs_top_srcdir)/src/lib/testutils/testdata\" -AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/lib/testutils/testdata\" +AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/bin/dhcp6/tests\" AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\" +CLEANFILES = $(builddir)/interfaces.txt + AM_CXXFLAGS = $(B10_CXXFLAGS) if USE_STATIC_LINK diff --git a/src/bin/dhcp6/tests/iface_mgr_unittest.cc b/src/bin/dhcp6/tests/iface_mgr_unittest.cc index c8301eb723..a726511390 100644 --- a/src/bin/dhcp6/tests/iface_mgr_unittest.cc +++ b/src/bin/dhcp6/tests/iface_mgr_unittest.cc @@ -29,6 +29,8 @@ using namespace isc; using namespace isc::asiolink; namespace { +const char* const INTERFACE_FILE = TEST_DATA_BUILDDIR "/interfaces.txt"; + class NakedIfaceMgr: public IfaceMgr { // "naked" Interface Manager, exposes internal fields public: @@ -114,7 +116,7 @@ TEST_F(IfaceMgrTest, detectIfaces) { // test detects that interfaces can be detected // there is no code for that now, but interfaces are // read from file - fstream fakeifaces("interfaces.txt", ios::out|ios::trunc); + fstream fakeifaces(INTERFACE_FILE, ios::out|ios::trunc); fakeifaces << "eth0 fe80::1234"; fakeifaces.close(); @@ -210,7 +212,7 @@ TEST_F(IfaceMgrTest, DISABLED_sendReceive) { // testing socket operation in a portable way is tricky // without interface detection implemented - fstream fakeifaces("interfaces.txt", ios::out|ios::trunc); + fstream fakeifaces(INTERFACE_FILE, ios::out|ios::trunc); fakeifaces << "lo ::1"; fakeifaces.close();