BIND 10 trac3251, updated. 77059f8a6b32612fab2c862b5dee11c728430327 [3251] Additional unit test for the case when there are no interfaces.

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Dec 13 09:25:50 UTC 2013


The branch, trac3251 has been updated
       via  77059f8a6b32612fab2c862b5dee11c728430327 (commit)
      from  4276b45afad091f2022b690effd2711d6a587c79 (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 77059f8a6b32612fab2c862b5dee11c728430327
Author: Marcin Siodelski <marcin at isc.org>
Date:   Fri Dec 13 10:25:42 2013 +0100

    [3251] Additional unit test for the case when there are no interfaces.

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

Summary of changes:
 src/lib/dhcp/tests/iface_mgr_unittest.cc |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

-----------------------------------------------------------------------
diff --git a/src/lib/dhcp/tests/iface_mgr_unittest.cc b/src/lib/dhcp/tests/iface_mgr_unittest.cc
index d81f9be..df66e60 100644
--- a/src/lib/dhcp/tests/iface_mgr_unittest.cc
+++ b/src/lib/dhcp/tests/iface_mgr_unittest.cc
@@ -1645,6 +1645,24 @@ TEST_F(IfaceMgrTest, openSockets6IfaceInactive) {
 
 }
 
+// That that the openSockets6 function does not throw if there are no interfaces
+// detected. This function is expected to return false.
+TEST_F(IfaceMgrTest, openSockets6NoIfaces) {
+    NakedIfaceMgr ifacemgr;
+    // Remove existing interfaces.
+    ifacemgr.getIfacesLst().clear();
+
+    boost::shared_ptr<PktFilter6Stub> filter(new PktFilter6Stub());
+    ASSERT_TRUE(filter);
+    ASSERT_NO_THROW(ifacemgr.setPacketFilter(filter));
+
+    // This value indicates if at least one socket opens. There are no
+    // interfaces, so it should be set to false.
+    bool socket_open;
+    ASSERT_NO_THROW(socket_open = ifacemgr.openSockets6(DHCP6_SERVER_PORT));
+    EXPECT_FALSE(socket_open);
+}
+
 // Test the Iface structure itself
 TEST_F(IfaceMgrTest, iface) {
     boost::scoped_ptr<Iface> iface;



More information about the bind10-changes mailing list