Browse Source

[master] a quickhack fix to discheck failure in dhcp6/tests.
okayed on jabber

JINMEI Tatuya 13 years ago
parent
commit
d119c3155e
2 changed files with 7 additions and 3 deletions
  1. 3 1
      src/bin/dhcp6/tests/Makefile.am
  2. 4 2
      src/bin/dhcp6/tests/iface_mgr_unittest.cc

+ 3 - 1
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

+ 4 - 2
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();