test NetInterfaceConfig.getAddress6

This commit is contained in:
Doug MacEachern 2009-07-24 17:56:20 -07:00
parent 7c5e4e3a3b
commit 6cb7d6b398
1 changed files with 11 additions and 0 deletions

View File

@ -18,6 +18,9 @@
package org.hyperic.sigar.test; package org.hyperic.sigar.test;
import java.net.InetAddress;
import java.net.Inet6Address;
import org.hyperic.sigar.Sigar; import org.hyperic.sigar.Sigar;
import org.hyperic.sigar.SigarException; import org.hyperic.sigar.SigarException;
import org.hyperic.sigar.SigarNotImplementedException; import org.hyperic.sigar.SigarNotImplementedException;
@ -44,6 +47,14 @@ public class TestNetIf extends SigarTestCase {
assertTrueTrace("Address", ifconfig.getAddress()); assertTrueTrace("Address", ifconfig.getAddress());
assertTrueTrace("Netmask", ifconfig.getNetmask()); assertTrueTrace("Netmask", ifconfig.getNetmask());
if (ifconfig.getPrefixLength() != 0) {
assertTrueTrace("Address6", ifconfig.getAddress6());
InetAddress in6 =
InetAddress.getByName(ifconfig.getAddress6());
assertTrue(in6 instanceof Inet6Address);
traceln("Link=" + in6.isLinkLocalAddress());
}
if (!getStats) { if (!getStats) {
continue; continue;
} }