Tests and TCP ports

Ludovic Courtès ludo at gnu.org
Tue Feb 7 00:43:12 CET 2012

Hi Nikos,

Sorry for the late reply.

Nikos Mavrogiannopoulos <nmav at gnutls.org> skribis:

> On 01/31/2012 05:27 PM, Ludovic Courtès wrote:
>> 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'
>> 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.)
> The sockets could be made relative to the directory, thus such a
> limitation might not be a problem.

Yes.  Actually, it’s even easier to use socket pairs, as currently done
in guile/tests/*-auth.scm.

> I've thought of moving the tests in a higher level language quite few
> times. Guile(with scheme) could have been a candidate but I have given
> up any attempt learning scheme or lisp.

Oh well.  I can only encourage you to look at (say)
guile/tests/openpgp-auth.scm.  Hopefully it’s fairly easy to understand,
as it’s essentially a direct translation of the C code.

I could rewrite ‘testdsa’ in Scheme but I guess it’d be pointless to do
it myself.

> Btw. If guile adds support for lua, would the binding for gnutls work,
> or it would be a totally different story?

Yes, but don’t hold your breath.


More information about the Gnutls-devel mailing list