The document discusses KPN's use of Beaker and VMpooler for multi-platform testing of Puppet modules. It outlines the requirements for an automated testing pipeline that runs syntax, unit, and acceptance tests on Linux and Windows platforms in parallel. The solution involved setting up a Jenkins master and build slaves along with VMpooler to provision VMs for testing. Beaker is used to run acceptance tests across multiple platforms. Details are provided on configuring the testing components and writing acceptance tests. Metrics on modules, test types, runs, and failed tests are presented.
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
Similaire à PuppetConf 2016: Delivering Premium Quality Modules: Using Beaker and VMpooler for Multi-Platform Testing – Rene Last, KPN B.V & Dimitri Tischenko, Myndrik
Similaire à PuppetConf 2016: Delivering Premium Quality Modules: Using Beaker and VMpooler for Multi-Platform Testing – Rene Last, KPN B.V & Dimitri Tischenko, Myndrik (20)
29. Prepare a System For TesEng
spec/spec_helper_acceptance.rb
1. require 'beaker-rspec/spec_helper'
2. require 'beaker-rspec/helpers/serverspec'
3. require 'beaker/puppet_install_helper'
4.
5. # Install puppet agent on a node
6. run_puppet_install_helper
7.
8. # Copy our module dependencies to the SUT
9. system('git clone git@github.kpn.com/stdlib spec/fixtures/modules/stdlib')
10.
11. copy_module_to(hosts, :source => 'spec/fixtures/modules/stdlib',
12. :module => 'stdlib')
13.
14. # Or if you have internet access
15. install_puppet_module_via_pmt_on(host, :module_name => 'stdlib')
30. Example Test
spec/acceptance/*_spec.rb
1. require 'spec_helper_acceptance'
2.
3. describe 'kpn-centerity_agent module' do
4. context 'install centerity_agent software' do
5. pp = <<-EOS
6. class { 'centerity_agent': }
7. EOS
8. it '1st apply should run without errors' do
9. apply_manifest(pp, :catch_failures => true)
10. end
11. it '2nd apply should run without changes' do
12. apply_manifest(pp, :catch_changes => true)
13. end
14. end
15. end