Testing Puppet
@EslamElHusseiny
Agenda
• Motivation • Why to test ? • Different types of tests • Tools • Demo
Motivation
Why to test ?
Different types of tests
Puppet tests
•Puppet Lint “Validate Puppet style guidelines” •Validate Syntax
•puppet parser validate •r10k puppetfile check •erb -x -T '-' template/example.erb| ruby -c
•Unit tests “rspec-puppet” •Integration tests!
Tools
KitchenCI
•http://kitchen.ci •Your infrastructure deserves tests too •multiple drivers •multiple platforms •many testing frameworks
KitchenCI
•Install gem install test-kitchen
•Initialisation kitchen init
•Destroy, Create, Converge, Setup, Verify, and Destroy kitchen test
ServerSpec
•http://serverspec.org •RSpec tests for your servers configured by
CFEngine, Puppet, Ansible, or anything else. •Tests your servers’ actual state by executing
command locally, via SSH, Docker API, etc…
ServerSpec snippet
Thanks!
Twitter: @cakesolutionsTel: 0845 617 1200
Email: [email protected] Jobs: http://www.cakesolutions.net/
careers
We are Hiring!