Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My team has created a large number of chef cookbooks. I was wondering what methods and frameworks I should look into so we can start creating tests to assure that our nodes are configured properly?

share|improve this question
    
Sounds like it belongs on cooking.se ;) –  Mark Henderson Aug 11 '11 at 6:19
    
For a moment I thought you was talking about Chef: en.wikipedia.org/wiki/Chef_%28programming_language%29 –  Janne Pikkarainen Aug 11 '11 at 6:23

4 Answers 4

up vote 4 down vote accepted

You might (also) look into Vagrant for this.
A video is showing how to use the combo of Vagrant and Chef cookbooks. And there's a dedicated page to Vagrant and Chef on the Opscode site.

share|improve this answer

There's a number of options.

Opscode has on the Chef development roadmap "no-op" support which will help with testing. We do argue that "no-op" doesn't necessarily do what you want, but understand the desire for the feature.

share|improve this answer

There's the cucumber-chef ruby gem and a recently released book Nelson-Smith et al - "Test-driven Infrastructure with Chef" that makes use of that gem - http://www.cucumber-chef.org/

Just remembered this from my github watchlist: https://github.com/gregretkowski/vmth/

The VMTH (Virtual Machine Test Harness) provides a mechanism to unit-test your infrastructure automation - puppet policies, chef recipes, release deployment scripts, etc. It uses features of modern VM monitors (like qemu) to snapshot system state, and then reset that state after each test, so that a series of tests can be performed on a VM instance in rapid succession

share|improve this answer

In my experience, the only way to really do this is with a staging environment and careful development practices. Mocking out the actual work to be done is incredibly messy and fragile, and CI test suites running on commit or push are a lot of effort to write and maintain (although Chef is probably a lot better at this than Puppet, which is my main experience), and take a ridiculous amount of time to run.

EDIT

Just after I wrote this, I suddenly realised there might be a way to do reasonably efficient "unit" testing of Chef/Puppet recipes with a union filesystem and a significant amount of scaffolding. However, I can't find anything out there that anyone's done already in this area. I might have just found myself a project.

share|improve this answer
    
Testing the infrastructure itself is incredibly important. Naturally, there are a number of methodologies, i.e, functional and nonfunctional, necessary to implement this slightly differently than software methodologies. –  Barry Aug 12 '11 at 8:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.