VM/containerization/cloud to use ▸ Provisioner: which configuration management tool to apply ▸ Verifier: test automation type to verify with ▸ Transport: mechanism to upload files into instance under test
http://serverspec.org/resource_types.html ▸ Independent of kitchen - can be used standalone ▸ We keep test suite together with puppet code under spec directory to have ability to create consistent PRs describe file('/var/log/httpd') do it { should be_directory } end describe docker_image('busybox:latest') do its(['Architecture']) { should eq 'amd64' } end
serverspec test suite ▸ Runs a serverspec test suite against the configured (converged) instance ▸ Reports in shell and junit - jenkins ready verifier: name: shell remote_exec: true command: | sudo -s <<SERVERSPEC export SERVERSPEC_ENV=$EC2DATA_ENVIRONMENT export SERVERSPEC_BACKEND=exec serverspec junit=true tag=~skip_in_kitchen check:role:$EC2DATA_TYPE SERVERSPEC
specific limitations ▸ Implementation located in puppet repo under spec/shellmock ▸ Simple ruby script ▸ Wraps yum invocation ▸ Mock is defined in simple yaml format: package: /path/to/executable: contents
code ▸ kitchen verify <type> ▸ Observe related test is red ▸ Write puppet code ▸ kitchen converge <type> ▸ kitchen verify <type> ▸ Observe related test is green ▸ Commit the changes and create PR to puppet repo ▸ DEMO
Easy to test permutations ▸ Resource efficiency ▸ Test-first/test-driven approach for infrastructure code ▸ Fast feedback - even before a commit ▸ Naturally growing regression test suite
kitchen ▸ with every next adopted type it will be easier ▸ Create smart way to test only related types for code change, a.k.a puppet dependency tracking
driver is agnostic to virtualization solution/cloud ▸ As the kitchen provisioner is agnostic to configuration management solution ▸ As the serverspec is agnostic to way to configure servers at all ▸ We are capable to make brave movements in future!