]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2596] Error message in unlikely case that the system has nonexistent0 interface.
authorTomek Mrugalski <tomasz@isc.org>
Fri, 18 Jan 2013 13:04:22 +0000 (14:04 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Fri, 18 Jan 2013 13:04:22 +0000 (14:04 +0100)
src/bin/dhcp6/tests/config_parser_unittest.cc

index caca8eb0e210c6a94e2a92847720113ecd040b7e..ea84a1cff3d8968901126dd64b39c4aba850bf56 100644 (file)
@@ -52,11 +52,18 @@ public:
 
         // There must be some interface detected
         if (ifaces.empty()) {
+            // We can't use ASSERT in constructor
             ADD_FAILURE() << "No interfaces detected.";
         }
 
         valid_iface_ = ifaces.begin()->getName();
         bogus_iface_ = "nonexisting0";
+
+        if (IfaceMgr::instance().getIface(bogus_iface_)) {
+            ADD_FAILURE() << "The '" << bogus_iface_ << "' exists on this system"
+                          << " while the test assumes that it doesn't to execute"
+                          << " some negative scenarios. Can't continue this test";
+        }
     }
 
     ~Dhcp6ParserTest() {