[bind10-dev] Testing interface detection
Shane Kerr
shane at isc.org
Tue Nov 29 10:19:36 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. It should
not be too bad, since the interface detection is also inherently
non-portable. Your idea of using ifconfig output makes sense to me.
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.
The 2nd test would probably be something that requires root permissions,
so not run by default. We could run it when porting to a new system, or
if we have errors reported by users. We would probably enable it on our
build farms as well, to detect regressions.
The idea of the 2nd test also allows us to test the system behavior when
interfaces come online or go offline during runtime. This is something
we want to handle gracefully at some point.
--
Shane
More information about the bind10-dev
mailing list