Browse Source

[1186] Tests are now working on OS X.

Tomek Mrugalski 13 years ago
parent
commit
2276752655
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/bin/dhcp6/tests/iface_mgr_unittest.cc

+ 5 - 2
src/bin/dhcp6/tests/iface_mgr_unittest.cc

@@ -71,9 +71,11 @@ TEST_F(IfaceMgrTest, loDetect) {
 
     NakedIfaceMgr * ifacemgr = new NakedIfaceMgr();
     IOAddress loAddr("::1");
+    IOAddress mcastAddr("ff02::1:2");
 
     // bind multicast socket to port 10547
-    int socket1 = ifacemgr->openSocket("lo", loAddr, 10547);
+    int socket1 = ifacemgr->openSocket("lo", mcastAddr, 10547);
+    // this fails on BSD (there's no lo interface there)
 
     // poor man's interface dection
     // it will go away as soon as proper interface detection
@@ -82,7 +84,8 @@ TEST_F(IfaceMgrTest, loDetect) {
         cout << "This is Linux, using lo as loopback." << endl;
         close(socket1);
     } else {
-        socket1 = ifacemgr->openSocket("lo0", loAddr, 10547);
+        // this fails on Linux and succeeds on BSD
+        socket1 = ifacemgr->openSocket("lo0", mcastAddr, 10547);
         if (socket1>0) {
             sprintf(LOOPBACK, "lo0");
             cout << "This is BSD, using lo0 as loopback." << endl;