[bind10-dev] Testing interface detection

Francis Dupont fdupont at isc.org
Tue Nov 29 11:30:28 UTC 2011


> Tomek mentioned some issues with testing interface detection (currently
> needed by the DHCP side, but it will eventually be needed by the DNS
> side as well).
> 
> I thought it might be worthwhile to discuss here.
> 
> On Mon, 2011-11-28 at 19:56 +0100, Tomek Mrugalski wrote:
> > - IfaceMgr is now part of libdhcp. (It is no longer used by dhcp6 only,
> >   but both dhcp4 and dhcp6).
> > - Added OS detection capability to build system. Some elements may
> >   now be OS-specific (e.g. interface detection).
> > - I have implemented a prototype of Linux interface detection (#1237).
> >   It works (detects interfaces and IPv4 and IPv6 addresses), but the
> >   code needs some work and it is currently completely untested. I just
> >   don't have any good ideas how to test this without reimplementing the
> >   detection itself. I was thinking about comparing detected interfaces
> >   to output of ifconfig (note that ifconfig output syntax is different,
> >   writing tests in a portable way will be tricky).
> 
> This is indeed tricky.
> 
> I think writing non-portable tests is probably the way to go.

=> IMHO there is no choice: the system / library calls to detect
interfaces are very OS dependent and what Tomasz' message means
is the user level tools are also very OS dependent (BTW for
Linux I believe 'ip' is better than 'ifconfig').

> Perhaps we can have 2 different styles of test:
> 
>      1. Something akin to a unit tests, that simply detects interfaces
>         and confirms that the ifconfig output matches.
>      2. A test that actually changes the interface status and checks
>         that the detection matches.

=> I believe the 2 is about getting interface changes via kernel messages.
I worked on mobility in the past with that: it is not stable between
versions / in the time, i.e., worse than OS dependent...

Regards

Francis Dupont <fdupont at isc.org>



More information about the bind10-dev mailing list