Re: Now playing: miltertest

From: Daniel Black <>
Date: Thu, 3 Dec 2009 05:43:54 +1100

On Wednesday 02 December 2009 05:44:51 Murray S. Kucherawy wrote:
> On branch br-msk-lua I've whipped up a milter-level filter test facility
> that's Lua-based.

great work Murray.

> I intend to include a directory under "opendkim" called "tests" which has
> a comprehensive battery of unit tests done at the milter level that
> exercise the filter's features, something we're currently missing.

Sounds good. I'll get the test coverage code running there too (next week

> Daniel had some ideas about doing full integration testing in an automated
> fashion. That's still probably a good idea, but it's harder to do that in
> a self-contained fashion given the complexity of a full-blown MTA.
True - I'll stage this in a different directory. I'll start with some test
emails, and a script to receive the email at the other end and save to a file.
and a bit of logic to compare the two.

libinterpose is something I came across at OSDC. It basically uses LD_PRELOADs
to load a malloc library wrapper that does a fork, with the parent returning
success and the child failing. By using a similar strategy for other system
calls we can get a much better test coverage. Even the current DNS answer
injection test code could be rewritten.

The other GLIBC tool to deal with memory allocation tracing was mtrace. With
this you compile as normal. Use a mtrace() function call at the program start.
set the env variable MALLOC_TRACE=filename.log and run the programs. addr2line
makes a pretty output.
Received on Wed Dec 02 2009 - 18:44:05 PST

This archive was generated by hypermail 2.3.0 : Mon Oct 29 2012 - 23:32:30 PST