FtpServer
  1. FtpServer
  2. FTPSERVER-106

Test failure on system with IPv4 and IPv6 dual stack

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.0-M2
    • Fix Version/s: 1.0.0-M2
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Fedora 7 Linux 2.6.22.4-65.fc7
      java version "1.5.0_12"

      Description

      org.apache.ftpserver.clienttests.PasvTest fails on system with IPv6 addresses.

      TestUtils.getHostAddresses() returns IP addresses for all interfaces on the system and on a dual stack system that includes IPv6 addresses.
      Not sure if the FtpServer is supposed to support IPv6 (since that would affect server response to stuff like PASV), but I will include a temporary fix for TestUtils below.

      Index: /srv/home/birkirb/svn/ftpserver/core/src/test/org/apache/ftpserver/test/TestUtil.java
      ===================================================================
      — /srv/home/birkirb/svn/ftpserver/core/src/test/org/apache/ftpserver/test/TestUtil.java (revision 570339)
      +++ /srv/home/birkirb/svn/ftpserver/core/src/test/org/apache/ftpserver/test/TestUtil.java (working copy)
      @@ -105,7 +105,14 @@

      while (ips.hasMoreElements()) {
      InetAddress ip = (InetAddress) ips.nextElement();

      • hostIps.add(ip.getHostAddress());
        + if(ip instanceof java.net.Inet4Address)
        + { + hostIps.add(ip.getHostAddress()); + }

        + else
        +

        { + // IPv6 not tested + }

        }
        }

        Activity

        Hide
        Niklas Gustavsson added a comment -

        Fixed, thanks for reporting! I would like to support IP6 in FtpServer, but I do not have a system to test it on so I have a hard time doing anything useful.

        commit -m "Fixed tests that would break on IP6 machines (FTPSERVER-106)" C:/home/niklas/workspaces/apache/ftpserver/core/src/test/org/apache/ftpserver/test/TestUtil.java
        Sending home/niklas/workspaces/apache/ftpserver/core/src/test/org/apache/ftpserver/test/TestUtil.java
        Transmitting file data ...
        Committed revision 570708.

        Show
        Niklas Gustavsson added a comment - Fixed, thanks for reporting! I would like to support IP6 in FtpServer, but I do not have a system to test it on so I have a hard time doing anything useful. commit -m "Fixed tests that would break on IP6 machines ( FTPSERVER-106 )" C:/home/niklas/workspaces/apache/ftpserver/core/src/test/org/apache/ftpserver/test/TestUtil.java Sending home/niklas/workspaces/apache/ftpserver/core/src/test/org/apache/ftpserver/test/TestUtil.java Transmitting file data ... Committed revision 570708.

          People

          • Assignee:
            Niklas Gustavsson
            Reporter:
            Birkir A. Barkarson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development