]
Brian Stansberry reassigned WFCORE-794:
---------------------------------------
Fix Version/s: 3.0.0.Alpha1
Assignee: Petr Kremensky (was: Jason Greene)
Resolution: Done
IPv6ScopeIdMatchUnitTestCase fails if some IPv6 subinterface exists
-------------------------------------------------------------------
Key: WFCORE-794
URL:
https://issues.jboss.org/browse/WFCORE-794
Project: WildFly Core
Issue Type: Bug
Components: Test Suite
Affects Versions: 2.0.0.Alpha5
Reporter: Petr Kremensky
Assignee: Petr Kremensky
Fix For: 3.0.0.Alpha1
The test (org.jboss.as.controller.interfacesIPv6ScopeIdMatchUnitTestCase) keeps failing
on one of our Solaris boxes with following interfaces:
{noformat}
/usr/sbin/ifconfig -a
...
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
inet6 ::1/128
net0: flags=120002000841<UP,RUNNING,MULTICAST,IPv6,PHYSRUNNING> mtu 1500 index 2
inet6 fe80::221:28ff:feb3:20f2/10
net0:1: flags=120002080841<UP,RUNNING,MULTICAST,ADDRCONF,IPv6,PHYSRUNNING> mtu 1500
index 2
inet6 2620:52:0:105f:221:28ff:feb3:20f2/64
net4: flags=120002000840<RUNNING,MULTICAST,IPv6,PHYSRUNNING> mtu 1500 index 3
inet6 ::/0
{noformat}
*Error Message*
{noformat}
expected:</2620:52:0:105f:221:28ff:feb3:20f2%2> but was:<null>
{noformat}
*Stacktrace*
{noformat}
java.lang.AssertionError: expected:</2620:52:0:105f:221:28ff:feb3:20f2%2> but
was:<null>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:743)
at org.junit.Assert.assertEquals(Assert.java:118)
at org.junit.Assert.assertEquals(Assert.java:144)
at
org.jboss.as.controller.interfaces.IPv6ScopeIdMatchUnitTestCase.testNonLoopback(IPv6ScopeIdMatchUnitTestCase.java:129)
{noformat}
Promlem is, that getByName returns null when resolving NetworkInterface by its
subinterface name (net0:1 in this case). See following example.
{noformat}
Enumeration<NetworkInterface> interfaces =
NetworkInterface.getNetworkInterfaces();
while (interfaces.hasMoreElements()) {
NetworkInterface nic = interfaces.nextElement();
Enumeration<NetworkInterface> subInterfaces = nic.getSubInterfaces();
while (subInterfaces.hasMoreElements()) {
NetworkInterface subInterface = subInterfaces.nextElement();
System.out.println(subInterface.getName());
System.out.println(NetworkInterface.getByName(subInterface.getName()));
}
}
{noformat}
----
{noformat}
em1:0
null
{noformat}