Page 1 of 1

Unit Testing a Server Configuration

Posted: Sat Feb 10, 2007 7:33 am
by Ollie Saunders
It suddenly occurred to me last night after work that writing some unit tests for the server configuration would be a really good idea. I've recently had a freelancer configure our dedicated server and I noticed there were some bugs with some of the scripts he wrote and a couple of other things weren't quite correct.

Perhaps writing unit tests is a good idea. This way I can be more certain that everything is working, the tests can be executed every time I change something. In short unit tests could catch pretty serious problems very early. Its such a good idea I was amazed that a google search revealed nothing of interest.

Has anyone ever done this?
Do you think it is worth doing?
Are there any toolkits for doing such things?

Posted: Sat Feb 10, 2007 9:11 am
by Chris Corbyn
What sort of things do you want to test? Unit Testing a server configuration sounds a bit odd. More like acceptance/integration/integrity testing would be more fitting. Things like heatbeat, smokeping and sql integrity scripts can do that. But like I say, what did you want to test?

Posted: Sun Feb 11, 2007 2:50 am
by Ollie Saunders
  • PHP config
    • Extensions exist
    • Classes exist
    • Version
    • Error logging
    • Configuration values within acceptable range
  • MySQL config
    • Version
    • Settings (char encoding, ANSI mode)
    • User permissions
    • Works - a database and table can be created, data can be inserted and retrieved
  • Apache
    • Options Indexes is off where it should be
    • Domains newly created with script work and have correct settings
    • SSL works
    • Errors are logged in the correct place
    • Customized error messages work
I could make a more complete list if I had the configuration spec on me at the moment.

Posted: Sun Feb 11, 2007 3:49 am
by Kieran Huggins
Oh ole - you unit testing nut! :-) I think it's a great idea - maybe if it had a front end that could edit the test config? I'd help with that eventually.

How's the sofa?