Tests and TCP ports

Ludovic Courtès ludo at gnu.org
Tue Jan 31 17:27:18 CET 2012


Hello,

Some of the tests work by connecting to localhost on some TCP port, and
then exchanging over that connection.  These tests typically fail when
the port cannot be listened, like:

  make[3]: Entering directory `/tmp/nix-build-1i4rvwc1v6vky76vplykl9z3qz220zlz-gnutls-3.0.11.drv-0/gnutls-3.0.11/tests/dsa'
  building check-TESTS
  Checking various DSA key sizes
  Checking DSA-1024 with TLS 1.0
  *** Fatal error: A TLS fatal alert has been received.
  *** Handshake has failed
  GnuTLS error: A TLS fatal alert has been received.
  Failure: Failed connection to a server with DSA 1024 key and TLS 1.0!
  FAIL: testdsa

This is particularly a problem on Hydra where several builds may be
running in parallel, and trying to access the same TCP port.

Possible solutions include:

  - Using Unix domain sockets, though the path name limitation doesn’t
    play well with the long $builddir that Nix uses (as above.)

  - Trying several port numbers until one succeeds, the difficulty being
    that the port number has to be communicated to the child somehow.

  - Avoiding sockets entirely, by using ‘gnutls_transport_set_ptr’ & co.
    This doesn’t help for tests written as shell scripts, though.
    (Perhaps these could be translated in Guile, which makes writing
    tests easy while not compromising on expressive power.)

WDYT?

Thanks,
Ludo’.




More information about the Gnutls-devel mailing list