Course details

Test-driven Cookbooks

Test-driven Cookbooks


Overview/Description
Target Audience
Prerequisites
Expected Duration
Lesson Objectives
Course Number
Expertise Level



Overview/Description
The most important role of a Cookbook developer is to test a code before it enters production. This course will focus on testing Chef cookbooks consistently and effectively.

Target Audience
DevOps practitioners and systems administrators interested in learning how to automate configuration tasks with Chef

Prerequisites
None

Expected Duration (hours)
1.4

Lesson Objectives

Test-driven Cookbooks

  • start the course
  • use Behavior-Driven Development (BDD) in the context of Chef cookbook development
  • identify the Chef Development Kit tools used for unit and integration testing
  • generate unit and integration tests inside of a cookbook
  • list the components of the .kitchen.yml file
  • configure a Test Kitchen driver to support deploying to physical, virtual, or cloud machines
  • execute the chef-client on a virtual machine generated by Test Kitchen
  • define an integration test and verify the results with kitchen login
  • use the InSpec compliance language to write simple integration tests
  • refactor a recipe and run kitchen verify with a test-driven approach
  • execute the RSpec utility to test Chef recipes in memory
  • utilize a simple formula to write ChefSpec tests
  • configure the Pry Ruby gem to insert a breakpoint into a recipe
  • use ChefSpec to check case statement evaluation of node attributes
  • use Test Kitchen to verify a simple Apache cookbook on Ubuntu and Centos
  • Course Number:
    os_doch_a04_it_enus

    Expertise Level
    Intermediate