Consider a simple FreeBSD machine running an SMTP server - how can I automatically verify that it's doing the right thing (e.g. accept incoming SMTP connections for certain recipients, and drop the mail in some Maildir)?
We already use server monitoring software (in this cas, Nagios) and of course we do manual tests, but I was wondering: is there some common way to run automatic functional tests on server services?
An example of what I'm thinking of: when reconfiguring our server (which usually happens inside a VM for testing purposes), I'm considering to
- Pipe a few manually crafted SMTP sessions into netcat, which connects to the SMTP port of our server and then
- Run some sort of 'verfication' script on the server which makes sure that expected assertions hold (such as: new files with expected contents appeared on the server, log entries were created, etc.).
I imagine being able to execute a series of such tests for other services (e.g. testing that backups can be created, testing that the IMAP server accepts connections for certain users and that it lists the right mail) might be useful for testing configuration changes, or for verifying that restored system backups work as expected.