Over a million developers have joined DZone.

Recommended Tools for Testing Puppet Code

DZone 's Guide to

Recommended Tools for Testing Puppet Code

· DevOps Zone ·
Free Resource

Since modifying Puppet manifiests, a lot of errors can... manifest :)   
So Puppet Labs was kind enough to put together a small post on verifying your Puppet manifests for infrastructure automation with a nice list and description of a few syntax checking and automated testing songs.  You should follow the source link below to see the whole post, but I'm just going to take the 'TL;DR version' route here and give you the list of tools they provided:

Syntax Checks

Manually run 'puppet parser validate selinux.pp' - ensures that your manifest can be parsed before you commit your changes
Vim's built in code compilation - can be used to run error checking
Syntastic - continuously checks and alerts for syntax errors
puppet-lint - this was developed by GitHub’s Tim Sharpe.  It analyzes your manifests and looks for deviations from the Puppet style guide

Automated Module Testing

rspec and Cucumber -  their tests to ensure that your modules are creating the resources that you expect
puppet-apt module - Puppet module to help manage the Advanced Package Tool
Puppet Forge - for verifying modules if they have tests

Automated System Testing

Cucumber - A Ruby-based BDD framework that can be used to ensure that you get the correct
Puppet host that you asked for

For a deeper tutorial, you really ought to read Patrick Dubois' Puppet Testing like a Pro


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}