harness.check(ifs.hasMoreElements(), "getNetworkInterfaces returns something");
HashSet names = new HashSet();
while (ifs.hasMoreElements())
{
NetworkInterface netif = (NetworkInterface) ifs.nextElement();
harness.checkPoint("consistency - " + netif.getName());
harness.check(!names.contains(netif.getName()), "duplicate entries");
names.add(netif.getName());
try
{
NetworkInterface netif2 = NetworkInterface.getByName(netif.getName());
harness.check(netif2 != null);
harness.check(netif.equals(netif2));
}
catch (Exception x)
{
harness.fail("getByName unexpected exception");
harness.debug(x);
}
Enumeration addrs = netif.getInetAddresses();
harness.check(addrs.hasMoreElements());
while (addrs.hasMoreElements())
{
try
{
InetAddress addr = (InetAddress) addrs.nextElement();
NetworkInterface netif2 = NetworkInterface.getByInetAddress(addr);
harness.check(netif2 != null);
harness.check(netif.equals(netif2));
}
catch (Exception x)
{