O'Reilly logo

Infrastructure as Code (IAC) Cookbook by Pierre Pomes, Stephane Jourdan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Testing and Writing Better Infrastructure Code with Chef and Puppet

In this chapter, we will cover the following recipes:

  • Linting Chef code with Foodcritic and Puppet code with puppet-lint
  • Unit testing with ChefSpec and rspec-puppet
  • Testing infrastructure with Test Kitchen for Chef and Beaker for Puppet
  • Integration testing with ServerSpec

Introduction

In the development world, good practices of testing software are widespread, such as unit and integration tests. Linters are also used daily for most languages by software developers. These techniques are fortunately brought to the infrastructure world through the tools we use; now as infrastructure is basically code, it can be analyzed, tested, and reported! Combined with CI systems, writing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required