fakeifaces << LOOPBACK << " ::1";
fakeifaces.close();
}
+
+ ~IfaceMgrTest() {
+ unlink(INTERFACE_FILE);
+ }
};
// We need some known interface to work reliably. Loopback interface
TEST_F(IfaceMgrTest, basic) {
// checks that IfaceManager can be instantiated
+ createLoInterfacesTxt();
IfaceMgr & ifacemgr = IfaceMgr::instance();
ASSERT_TRUE(&ifacemgr != 0);
// is implemented.
TEST_F(IfaceMgrTest, getIface) {
+ createLoInterfacesTxt();
+
cout << "Interface checks. Please ignore socket binding errors." << endl;
NakedIfaceMgr* ifacemgr = new NakedIfaceMgr();
EXPECT_STREQ( "fe80::1234", addr.toText().c_str() );
delete ifacemgr;
- unlink(INTERFACE_FILE);
}
#endif
close(socket2);
delete ifacemgr;
- unlink(INTERFACE_FILE);
}
// TODO: disabled due to other naming on various systems
EXPECT_TRUE( (rcvPkt->remote_port_ == 10546) || (rcvPkt->remote_port_ == 10547) );
delete ifacemgr;
- unlink(INTERFACE_FILE);
}
TEST_F(IfaceMgrTest, socket4) {
close(socket1);
delete ifacemgr;
- unlink(INTERFACE_FILE);
}
// Test the Iface structure itself
);
delete ifacemgr;
- unlink(INTERFACE_FILE);
}
/// @brief parses text representation of MAC address
cout << "Address " << addr->toText() << " on iterface " << detected->getFullName()
<< " matched with 'ifconfig -a' output." << endl;
}
-
}
-
-
}
-
-
-
delete ifacemgr;
}
#endif