Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-794

IPv6ScopeIdMatchUnitTestCase fails if some IPv6 subinterface exists

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.0.0.Alpha1
    • 2.0.0.Alpha5
    • Test Suite
    • None

      The test (org.jboss.as.controller.interfacesIPv6ScopeIdMatchUnitTestCase) keeps failing on one of our Solaris boxes with following interfaces:

      /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
      

      Error Message

      expected:</2620:52:0:105f:221:28ff:feb3:20f2%2> but was:<null>
      

      Stacktrace

      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)
      

      Promlem is, that getByName returns null when resolving NetworkInterface by its subinterface name (net0:1 in this case). See following example.

      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()));
          }
      }
      

      em1:0
      null
      

              pkremens@redhat.com Petr Kremensky (Inactive)
              pkremens@redhat.com Petr Kremensky (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: