secnet (lack of) test suite

Ian Jackson ijackson at chiark.greenend.org.uk
Sat Sep 28 12:57:41 BST 2019


This is really starting to annoy me.  In particular, the lack of any
tests of the (now really quite complex) code in site.c.  I think I
will have to produce something so I can test my public key rollover
stuff.  I heve been ruminating on what it should look like.

Ingredients would seem to be:

* Stunt config generation script

* For inside network interfaces, either:
  - Be root and use tun and invent temporary interface names
    (seems likely to be annoying and to interact with the host
    too much).
 or
  - Use the userv module with a stunt command, to avoid needing
    to be root.  The stunt command would use pipes or something.
  - Ad-hoc IP packet creation (eg literal ping packets committed
    to the test cases)
 of which the latter approach seems better.

* For outside networking, either:
  - Simply use localhost udp ports.  We want to test parallelism
    so each test must use its own set of ports.  Race-free allocation
    o a free port is awkward.  Testing packet loss etc. will be
    difficult.
  - Make an entirely new "comm".
  - Recompile udp.c (and maybe also polypath.c) with stunt versions
    of the following syscalls:
	socket
	bind
	getsockname
	sendto
	recvfrom
	setsockopt IPV6_V6ONLY
        setsockopt SO_BINDTODEVICE (polypath)
    and presumably the fd is actually an AF_UNIX socket to a
    test suite mock daemon thing.
  of which the latter seems best.

* faketime to speed up timeouts etc.  This is crude but will make the
  tests much less annoying without having to set too many artificial
  config parameters.

* test suite mock daemon thing which pretends to be both the outer
  and inner networks.  tcl is really good for this.  Will want to use
  chiark-tcl's AF_UNIX listener or somthing.

* ability to be pointed to a 2nd secnet git tree and run the
  old secnet for one of the ends: tests backward compat.

I think the need for concurrent handling of network stuff means the
test implementation language should be tcl.

Opinions ?

Ian.

-- 
Ian Jackson <ijackson at chiark.greenend.org.uk>   These opinions are my own.

If I emailed you from an address @fyvzl.net or @evade.org.uk, that is
a private address which bypasses my fierce spamfilter.



More information about the sgo-software-discuss mailing list