Before starting any test, you should make sure you have installed all dependent puppet modules. Find a list of all dependencies in [README.md] or [metadata.json].
Required gems are installed with bundler
:
cd puppet-icinga2
bundle install
Validation tests will check all manifests, templates and ruby files against syntax violations and style guides .
Run validation tests:
cd puppet-icinga2
bundle exec rake validate
With puppet-lint we test if our manifests conform to the recommended style guides from Puppet.
Run lint tests:
cd puppet-icinga2
bundle exec rake lint
For unit testing we use [RSpec]. All classes, defined resource types and functions should have appropriate unit tests.
Run unit tests:
cd puppet-icinga2
bundle exec rake parallel_spec
With integration tests this module is tested on multiple platforms to check the complete installation process. We define these tests with [Beaker] and run them on VMs by using [Vagrant].
All available Beaker acceptance tests are listed in the spec/acceptance
directory.
Run all integraion tests:
cd puppet-icinga2
bundle exec rake beaker
Run integration tests for a single platform:
cd puppet-icinga2
bundle exec rake beaker:centos-6-x64
To choose a specific Puppet version for your tests set the environment variable, e.g.
BEAKER_PUPPET_AGENT_VERSION="6.4.2"
Debugging: Does not destroy a virtual machine after a test fails is done by setting:
BEAKER_destroy=no
Logging in virtual machine, e.g.
cd puppet-icinga2
bundle exec rake beaker:ssh:centos-6-x64
or in the default machine:
cd puppet-icinga2
bundle exec rake beaker:ssh:default