Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-8706

org.jboss.test.cluster.defaultcfg.web.test.CleanShutdownTestCase fails when run against IPv6 addresses

XMLWordPrintable

      org.jboss.test.cluster.defaultcfg.web.test.CleanShutdownTestCase checks the behaviour of HTTP requests to a server which in the process of shutting down.
      As part of its processing, it uses a method

      Cookie findCookie(int serverIndex, String name)

      to find a cookie with a given name on a given server (usually indexed by 0 or 1).
      Cookies are matched when they have the same domain and name.

      Cookie domains can be represented as hostnames, or IP address literals.

      Our version of HttpClient (which I hacked about one year ago) will always use enclosing brackets when presented with an IPv6 address literal.
      HttpClient 3.0.1 and 3.1 did not support IPv6 address literals at the time.

      I may have to reinvestigate what the correct standard is, but for the time being, the above test is failing because findCookie does not wrap IPv6 address literals
      in square brackets before trying to match. As a result, we get assertion failures in the test, even though we have the correct cookies being returned:

      Error Message
      null

      Stacktrace
      junit.framework.AssertionFailedError: null
      at org.jboss.test.cluster.defaultcfg.web.test.CleanShutdownTestCase.testShutdown(CleanShutdownTestCase.java:164)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
      at junit.extensions.TestSetup.run(TestSetup.java:27)

      Standard Output
      After initial request
      [fec0:0:a16:ffff::d] JSESSIONID /http-sr Eiq93h0lJFU7W6Y7YDNnXw__.cluster-udp-DIST-0
      After request initiated prior to shutdown
      [fec0:0:a16:ffff::d] JSESSIONID /http-sr Eiq93h0lJFU7W6Y7YDNnXw__.cluster-udp-DIST-0
      [fec0:0:a16:ffff::d] sleep /http-sr 0

      findCookie(0, "0") is trying to match on the pair ("fec0:0:a16:ffff::d", "0")

        1. server.log
          161 kB
        2. output.log
          21 kB

              pferraro@redhat.com Paul Ferraro
              rachmato@redhat.com Richard Achmatowicz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: