Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Recommended Tools for Testing Puppet Code

DZone's Guide to

Recommended Tools for Testing Puppet Code

· DevOps Zone
Free Resource

“Automated Testing: The Glue That Holds DevOps Together” to learn about the key role automated testing plays in a DevOps workflow, brought to you in partnership with Sauce Labs.

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

Learn about the importance of automated testing as part of a healthy DevOps practice, brought to you in partnership with Sauce Labs.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}