BIND 10 trac1237, updated. f4e31621d8dbfe3742cc62c8d5435147f7f1b96a [1237] Fix for failing IfaceMgrTest.{basic|getIface}

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Dec 23 10:15:25 UTC 2011


The branch, trac1237 has been updated
       via  f4e31621d8dbfe3742cc62c8d5435147f7f1b96a (commit)
       via  1cd357e3b4d3940d7d0f7b40fc33b03d0bb58eee (commit)
      from  e1252b9d0a5a8f23dad207911923326f05d0db4c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f4e31621d8dbfe3742cc62c8d5435147f7f1b96a
Author: Tomek Mrugalski <tomasz at isc.org>
Date:   Fri Dec 23 11:14:52 2011 +0100

    [1237] Fix for failing IfaceMgrTest.{basic|getIface}

commit 1cd357e3b4d3940d7d0f7b40fc33b03d0bb58eee
Author: Tomek Mrugalski <tomasz at isc.org>
Date:   Fri Dec 23 11:12:47 2011 +0100

    [1237] Compilation fix for MacOS

-----------------------------------------------------------------------

Summary of changes:
 src/lib/dhcp/iface_mgr.cc                |    2 +-
 src/lib/dhcp/tests/iface_mgr_unittest.cc |   18 +++++++-----------
 2 files changed, 8 insertions(+), 12 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dhcp/iface_mgr.cc b/src/lib/dhcp/iface_mgr.cc
index 770296f..7a084b7 100644
--- a/src/lib/dhcp/iface_mgr.cc
+++ b/src/lib/dhcp/iface_mgr.cc
@@ -367,7 +367,7 @@ IfaceMgr::openSocket6(Iface& iface, const IOAddress& addr, int port) {
            addr.getAddress().to_v6().to_bytes().data(),
            sizeof(addr6.sin6_addr));
 #ifdef HAVE_SA_LEN
-    addr6->sin6_len = sizeof(addr6);
+    addr6.sin6_len = sizeof(addr6);
 #endif
 
     // TODO: use sockcreator once it becomes available
diff --git a/src/lib/dhcp/tests/iface_mgr_unittest.cc b/src/lib/dhcp/tests/iface_mgr_unittest.cc
index 06e9df0..9abbe13 100644
--- a/src/lib/dhcp/tests/iface_mgr_unittest.cc
+++ b/src/lib/dhcp/tests/iface_mgr_unittest.cc
@@ -56,6 +56,10 @@ public:
         fakeifaces << LOOPBACK << " ::1";
         fakeifaces.close();
     }
+
+    ~IfaceMgrTest() {
+        unlink(INTERFACE_FILE);
+    }
 };
 
 // We need some known interface to work reliably. Loopback interface
@@ -147,6 +151,7 @@ TEST_F(IfaceMgrTest, dhcp6Sniffer) {
 
 TEST_F(IfaceMgrTest, basic) {
     // checks that IfaceManager can be instantiated
+    createLoInterfacesTxt();
 
     IfaceMgr & ifacemgr = IfaceMgr::instance();
     ASSERT_TRUE(&ifacemgr != 0);
@@ -167,6 +172,8 @@ TEST_F(IfaceMgrTest, ifaceClass) {
 // is implemented.
 TEST_F(IfaceMgrTest, getIface) {
 
+    createLoInterfacesTxt();
+
     cout << "Interface checks. Please ignore socket binding errors." << endl;
     NakedIfaceMgr* ifacemgr = new NakedIfaceMgr();
 
@@ -241,7 +248,6 @@ TEST_F(IfaceMgrTest, detectIfaces_stub) {
     EXPECT_STREQ( "fe80::1234", addr.toText().c_str() );
 
     delete ifacemgr;
-    unlink(INTERFACE_FILE);
 }
 #endif
 
@@ -275,7 +281,6 @@ TEST_F(IfaceMgrTest, sockets6) {
     close(socket2);
 
     delete ifacemgr;
-    unlink(INTERFACE_FILE);
 }
 
 // TODO: disabled due to other naming on various systems
@@ -362,7 +367,6 @@ TEST_F(IfaceMgrTest, sendReceive6) {
     EXPECT_TRUE( (rcvPkt->remote_port_ == 10546) || (rcvPkt->remote_port_ == 10547) );
 
     delete ifacemgr;
-    unlink(INTERFACE_FILE);
 }
 
 TEST_F(IfaceMgrTest, socket4) {
@@ -390,7 +394,6 @@ TEST_F(IfaceMgrTest, socket4) {
     close(socket1);
 
     delete ifacemgr;
-    unlink(INTERFACE_FILE);
 }
 
 // Test the Iface structure itself
@@ -520,7 +523,6 @@ TEST_F(IfaceMgrTest, socketInfo) {
     );
 
     delete ifacemgr;
-    unlink(INTERFACE_FILE);
 }
 
 /// @brief parses text representation of MAC address
@@ -775,15 +777,9 @@ TEST_F(IfaceMgrTest, detectIfaces_linux) {
                 cout << "Address " << addr->toText() << " on iterface " << detected->getFullName()
                      << " matched with 'ifconfig -a' output." << endl;
             }
-
         }
-
-
     }
 
-
-
-
     delete ifacemgr;
 }
 #endif




More information about the bind10-changes mailing list