Testing Cumulus Linux with Serverspec
As configuration management software has matured, engineers have recognized the importance of testing and validation. A comprehensive set of tools has been been developed around configuration management software such as Chef, Puppet, Ansible and others that allow you to test your configuration management scripts.
One of these tools is Serverspec, which is an RSpec testing framework for checking that servers are configured correctly by testing their actual state.
Serverspec can execute its tests on a remote host (such as a Cumulus Linux switch) via. SSH. The tests express how the system should be configured and Serverspec will test that the current system configuration meets those expectations.
Using Serverspec to validate your switch configuration means that you can make changes to your configuration management scripts and be confident that the changes have been applied correctly and worked as intended.
Getting started
Because Serverspec natively supports Cumulus Linux, all you have to do is install Serverspec and create your tests. If you’ve never used Serverspec before, the serverspec-init
command will create an example called sample_spec.rb
. Adding your own files is very simple; just make sure the filename ends in _spec.rb
and the first line of the file is require 'spec_helper'
Writing tests
Individual Serverspec tests are Continue reading