From 9c2c7140876bbe20a9871543ba28b7522acdb213 Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sat, 12 Oct 2013 16:45:19 +0200 Subject: testing infrastructure --- .fixtures.yml | 8 -------- .gitignore | 2 ++ Gemfile | 5 +++++ Puppetfile | 3 +++ Puppetfile.lock | 8 ++++++++ Rakefile | 12 ++++++++++++ spec/spec_helper_system.rb | 26 ++++++++++++++++++++++++++ 7 files changed, 56 insertions(+), 8 deletions(-) delete mode 100644 .fixtures.yml create mode 100644 Puppetfile create mode 100644 Puppetfile.lock create mode 100644 spec/spec_helper_system.rb diff --git a/.fixtures.yml b/.fixtures.yml deleted file mode 100644 index e05b8fd..0000000 --- a/.fixtures.yml +++ /dev/null @@ -1,8 +0,0 @@ -fixtures: - repositories: - concat: "https://github.com/puppetlabs/puppetlabs-concat" - openbsd: "https://github.com/duritong/puppet-openbsd" - stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib" - - symlinks: - munin: "#{source_dir}" diff --git a/.gitignore b/.gitignore index 6ce4053..9ef9ca4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ Gemfile.lock spec/fixtures/ vendor/ +.tmp/* +.librarian/* diff --git a/Gemfile b/Gemfile index ffc5ecc..d5495b8 100644 --- a/Gemfile +++ b/Gemfile @@ -9,3 +9,8 @@ end gem 'puppet', puppetversion gem 'puppet-lint', '>=0.3.2' gem 'puppetlabs_spec_helper', '>=0.2.0' +gem 'rake', '>=0.9.2.2' +gem 'librarian-puppet', '>=0.9.10' +gem 'rspec-system-puppet', :require => false +gem 'serverspec', :require => false +gem 'rspec-system-serverspec', :require => false diff --git a/Puppetfile b/Puppetfile new file mode 100644 index 0000000..03b0752 --- /dev/null +++ b/Puppetfile @@ -0,0 +1,3 @@ +forge 'http://forge.puppetlabs.com' + +mod 'puppetlabs/stdlib', '>=0.1.6' diff --git a/Puppetfile.lock b/Puppetfile.lock new file mode 100644 index 0000000..d949104 --- /dev/null +++ b/Puppetfile.lock @@ -0,0 +1,8 @@ +FORGE + remote: http://forge.puppetlabs.com + specs: + puppetlabs/stdlib (4.1.0) + +DEPENDENCIES + puppetlabs/stdlib (>= 0.1.6) + diff --git a/Rakefile b/Rakefile index 0d1f018..c0bab20 100644 --- a/Rakefile +++ b/Rakefile @@ -1,9 +1,21 @@ +require 'bundler' +Bundler.require(:rake) + require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-lint/tasks/puppet-lint' +require 'rspec-system/rake_task' PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "vendor/**/*.pp"] PuppetLint.configuration.log_format = '%{path}:%{linenumber}:%{KIND}: %{message}' PuppetLint.configuration.send("disable_class_inherits_from_params_class") PuppetLint.configuration.send("disable_80chars") +# use librarian-puppet to manage fixtures instead of .fixtures.yml +# offers more possibilities like explicit version management, forge downloads,... +task :librarian_spec_prep do + sh "librarian-puppet install --path=spec/fixtures/modules/" +end +task :spec_prep => :librarian_spec_prep + + task :default => [:spec, :lint] diff --git a/spec/spec_helper_system.rb b/spec/spec_helper_system.rb new file mode 100644 index 0000000..462d2a1 --- /dev/null +++ b/spec/spec_helper_system.rb @@ -0,0 +1,26 @@ +require 'rspec-system/spec_helper' +require 'rspec-system-puppet/helpers' +require 'rspec-system-serverspec/helpers' +include Serverspec::Helper::RSpecSystem +include Serverspec::Helper::DetectOS +include RSpecSystemPuppet::Helpers + +RSpec.configure do |c| + # Project root + proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) + + # Enable colour + c.tty = true + + c.include RSpecSystemPuppet::Helpers + + # This is where we 'setup' the nodes before running our tests + c.before :suite do + # Install puppet + puppet_install + + # Install modules and dependencies + puppet_module_install(:source => proj_root, :module_name => 'munin') + shell('puppet module install puppetlabs-stdlib') + end +end -- cgit v1.2.3 From b729e3903ded13e07501fc9b55766d21de206ae8 Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sat, 12 Oct 2013 18:29:11 +0200 Subject: basic munin::client specs --- .rspec | 3 +++ Puppetfile | 1 + Puppetfile.lock | 2 ++ spec/classes/munin_client_spec.rb | 47 ++++++++++++++++++++++++++++++++++----- spec/spec.opts | 1 - spec/spec_helper_system.rb | 1 + 6 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 .rspec delete mode 100644 spec/spec.opts diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..e0b06e8 --- /dev/null +++ b/.rspec @@ -0,0 +1,3 @@ +--format documentation +--color +#--backtrace diff --git a/Puppetfile b/Puppetfile index 03b0752..60d1d14 100644 --- a/Puppetfile +++ b/Puppetfile @@ -1,3 +1,4 @@ forge 'http://forge.puppetlabs.com' mod 'puppetlabs/stdlib', '>=0.1.6' +mod 'puppetlabs/concat' \ No newline at end of file diff --git a/Puppetfile.lock b/Puppetfile.lock index d949104..0689d41 100644 --- a/Puppetfile.lock +++ b/Puppetfile.lock @@ -1,8 +1,10 @@ FORGE remote: http://forge.puppetlabs.com specs: + puppetlabs/concat (1.0.0-rc1) puppetlabs/stdlib (4.1.0) DEPENDENCIES + puppetlabs/concat (>= 0) puppetlabs/stdlib (>= 0.1.6) diff --git a/spec/classes/munin_client_spec.rb b/spec/classes/munin_client_spec.rb index 5438b20..a5539b3 100644 --- a/spec/classes/munin_client_spec.rb +++ b/spec/classes/munin_client_spec.rb @@ -1,14 +1,49 @@ require 'spec_helper' describe 'munin::client' do - let :facts do - { - :operatingsystem => 'CentOS', + shared_examples 'debian' do |os, codename| + let(:facts) {{ + :operatingsystem => os, + :osfamily => 'Debian', + :lsbdistcodename => codename, + }} + it { should contain_package('munin-node') } + it { should contain_package('iproute') } + it { should contain_file('/etc/munin/munin-node.conf') } + end + + shared_examples 'redhat' do |os, codename| + let(:facts) {{ + :operatingsystem => os, + :osfamily => 'RedHat', + :lsbdistcodename => codename, :interfaces => 'lo,eth0', - } + }} + it { should contain_package('munin-node') } + it { should contain_file('/etc/munin/munin-node.conf') } + end + + context 'on debian-like system' do + it_behaves_like 'debian', 'Debian', 'squeeze' + it_behaves_like 'debian', 'Debian', 'wheezy' + it_behaves_like 'debian', 'Ubuntu', 'precise' end - it 'should compile' do - should include_class('munin::client') + context 'on redhat-like system' do + it_behaves_like 'redhat', 'CentOS', '6' + # not supported yet + # it_behaves_like 'redhat', 'RedHat', '6' end + + context 'gentoo' do + let(:facts) {{ + :operatingsystem => 'Gentoo', + :osfamily => 'Gentoo', + :lsbdistcodename => '', + :interfaces => 'lo,eth0', + }} + it { should contain_package('munin-node') } + it { should contain_file('/etc/munin/munin-node.conf') } + end + end diff --git a/spec/spec.opts b/spec/spec.opts deleted file mode 100644 index d1bd681..0000000 --- a/spec/spec.opts +++ /dev/null @@ -1 +0,0 @@ ---format documentation --colour --backtrace diff --git a/spec/spec_helper_system.rb b/spec/spec_helper_system.rb index 462d2a1..9adfea9 100644 --- a/spec/spec_helper_system.rb +++ b/spec/spec_helper_system.rb @@ -22,5 +22,6 @@ RSpec.configure do |c| # Install modules and dependencies puppet_module_install(:source => proj_root, :module_name => 'munin') shell('puppet module install puppetlabs-stdlib') + shell('puppet module install puppetlabs-concat') end end -- cgit v1.2.3 From 342ea7aa15a54c33ec4a12cf10b7b1a0c9811dba Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sun, 13 Oct 2013 18:14:45 +0200 Subject: extended tests, first group should pass --- .travis.yml | 1 + spec/classes/munin_client_spec.rb | 14 ++++++++------ spec/classes/munin_host_spec.rb | 23 +++++++++++++++-------- spec/spec_helper.rb | 6 +++++- 4 files changed, 29 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3e66a86..330677c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ rvm: - 1.8.7 - 1.9.3 - 2.0.0 +script: 'rake spec' env: - PUPPET_VERSION=2.6.0 - PUPPET_VERSION=2.7.0 diff --git a/spec/classes/munin_client_spec.rb b/spec/classes/munin_client_spec.rb index a5539b3..ebf8d73 100644 --- a/spec/classes/munin_client_spec.rb +++ b/spec/classes/munin_client_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe 'munin::client' do - shared_examples 'debian' do |os, codename| + shared_examples 'debian-client' do |os, codename| let(:facts) {{ :operatingsystem => os, :osfamily => 'Debian', @@ -10,9 +10,10 @@ describe 'munin::client' do it { should contain_package('munin-node') } it { should contain_package('iproute') } it { should contain_file('/etc/munin/munin-node.conf') } + it { should include_class('munin::client::debian') } end - shared_examples 'redhat' do |os, codename| + shared_examples 'redhat-client' do |os, codename| let(:facts) {{ :operatingsystem => os, :osfamily => 'RedHat', @@ -24,13 +25,13 @@ describe 'munin::client' do end context 'on debian-like system' do - it_behaves_like 'debian', 'Debian', 'squeeze' - it_behaves_like 'debian', 'Debian', 'wheezy' - it_behaves_like 'debian', 'Ubuntu', 'precise' + it_behaves_like 'debian-client', 'Debian', 'squeeze' + it_behaves_like 'debian-client', 'Debian', 'wheezy' + it_behaves_like 'debian-client', 'Ubuntu', 'precise' end context 'on redhat-like system' do - it_behaves_like 'redhat', 'CentOS', '6' + it_behaves_like 'redhat-client', 'CentOS', '6' # not supported yet # it_behaves_like 'redhat', 'RedHat', '6' end @@ -44,6 +45,7 @@ describe 'munin::client' do }} it { should contain_package('munin-node') } it { should contain_file('/etc/munin/munin-node.conf') } + it { should include_class('munin::client::gentoo') } end end diff --git a/spec/classes/munin_host_spec.rb b/spec/classes/munin_host_spec.rb index 2216cc5..ccfcee6 100644 --- a/spec/classes/munin_host_spec.rb +++ b/spec/classes/munin_host_spec.rb @@ -1,14 +1,21 @@ require 'spec_helper' describe 'munin::host' do - let :facts do - { - :operatingsystem => 'CentOS', - :interfaces => 'lo,eth0', - } + shared_examples 'debian-host' do |os, codename| + let(:facts) {{ + :operatingsystem => os, + :osfamily => 'Debian', + :lsbdistcodename => codename, + :concat_basedir => '/var/lib/puppet/concat', + }} + it { should contain_package('munin') } + it { should contain_file('/etc/munin/munin.conf') } end - it 'should compile' do - should include_class('munin::host') - end +# context 'on debian-like system' do +# it_behaves_like 'debian-host', 'Debian', 'squeeze' +# it_behaves_like 'debian', 'Debian', 'wheezy' +# it_behaves_like 'debian', 'Ubuntu', 'precise' +# end + end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index cffe80c..7269ae5 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,9 +1,13 @@ require 'puppetlabs_spec_helper/module_spec_helper' +require 'rspec-puppet' + fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures')) RSpec.configure do |c| c.module_path = File.join(fixture_path, 'modules') c.manifest_dir = File.join(fixture_path, 'manifests') - c.mock_with :mocha end + +Puppet::Util::Log.level = :warning +Puppet::Util::Log.newdestination(:console) -- cgit v1.2.3 From 1bc94a452f234321c903110f1b5999cdb928a6d9 Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sun, 13 Oct 2013 18:21:07 +0200 Subject: travis integration --- .travis.yml | 2 +- script/bootstrap | 3 +++ script/cibuild | 9 +++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 script/bootstrap create mode 100755 script/cibuild diff --git a/.travis.yml b/.travis.yml index 330677c..41039c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ rvm: - 1.8.7 - 1.9.3 - 2.0.0 -script: 'rake spec' +script: './script/cibuild' env: - PUPPET_VERSION=2.6.0 - PUPPET_VERSION=2.7.0 diff --git a/script/bootstrap b/script/bootstrap new file mode 100755 index 0000000..0695797 --- /dev/null +++ b/script/bootstrap @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +bundle install --path vendor/gems --local diff --git a/script/cibuild b/script/cibuild new file mode 100755 index 0000000..d1c8c06 --- /dev/null +++ b/script/cibuild @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +set -e + +[ -z "${PUPPET_VERSION}" ] && script/bootstrap + +bundle exec rspec + +bundle exec puppet-lint --with-filename --fail-on-warnings manifests -- cgit v1.2.3 From b4453fb9b9619cf930d26d58d77ef3229ff16313 Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sun, 13 Oct 2013 18:28:26 +0200 Subject: added fixtures file --- .fixtures.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .fixtures.yml diff --git a/.fixtures.yml b/.fixtures.yml new file mode 100644 index 0000000..42dee4e --- /dev/null +++ b/.fixtures.yml @@ -0,0 +1,8 @@ +fixtures: + repositories: + concat: "https://github.com/puppetlabs/puppetlabs-concat" + stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib" + + symlinks: + munin: "#{source_dir}" + -- cgit v1.2.3 From ee44760c3633c35eba23261e5ed5594b512f0d65 Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sun, 13 Oct 2013 18:35:30 +0200 Subject: removed fixtures file, librarian is much better --- .fixtures.yml | 8 -------- .travis.yml | 2 +- script/bootstrap | 3 --- script/cibuild | 9 --------- 4 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 .fixtures.yml delete mode 100755 script/bootstrap delete mode 100755 script/cibuild diff --git a/.fixtures.yml b/.fixtures.yml deleted file mode 100644 index 42dee4e..0000000 --- a/.fixtures.yml +++ /dev/null @@ -1,8 +0,0 @@ -fixtures: - repositories: - concat: "https://github.com/puppetlabs/puppetlabs-concat" - stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib" - - symlinks: - munin: "#{source_dir}" - diff --git a/.travis.yml b/.travis.yml index 41039c1..330677c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ rvm: - 1.8.7 - 1.9.3 - 2.0.0 -script: './script/cibuild' +script: 'rake spec' env: - PUPPET_VERSION=2.6.0 - PUPPET_VERSION=2.7.0 diff --git a/script/bootstrap b/script/bootstrap deleted file mode 100755 index 0695797..0000000 --- a/script/bootstrap +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env sh - -bundle install --path vendor/gems --local diff --git a/script/cibuild b/script/cibuild deleted file mode 100755 index d1c8c06..0000000 --- a/script/cibuild +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env sh - -set -e - -[ -z "${PUPPET_VERSION}" ] && script/bootstrap - -bundle exec rspec - -bundle exec puppet-lint --with-filename --fail-on-warnings manifests -- cgit v1.2.3 From c5f36700d044fbdf61b17e105bddd2147ff22f29 Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sun, 13 Oct 2013 18:42:41 +0200 Subject: debugging travis and librarian --- Rakefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index c0bab20..6b92f24 100644 --- a/Rakefile +++ b/Rakefile @@ -13,7 +13,9 @@ PuppetLint.configuration.send("disable_80chars") # use librarian-puppet to manage fixtures instead of .fixtures.yml # offers more possibilities like explicit version management, forge downloads,... task :librarian_spec_prep do - sh "librarian-puppet install --path=spec/fixtures/modules/" + sh "librarian-puppet install --path=spec/fixtures/modules/" + sh 'ls -laF spec/fixtures/modules' + sh 'ls -laF spec/fixtures/modules/munin/manifests' end task :spec_prep => :librarian_spec_prep -- cgit v1.2.3 From dcea01c89c802c4055e2e99a4ed17576a4c5581b Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sun, 13 Oct 2013 19:00:48 +0200 Subject: linking current directory to fixtures --- Rakefile | 5 ++++- spec/spec_helper.rb | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 6b92f24..3bc7abd 100644 --- a/Rakefile +++ b/Rakefile @@ -14,8 +14,11 @@ PuppetLint.configuration.send("disable_80chars") # offers more possibilities like explicit version management, forge downloads,... task :librarian_spec_prep do sh "librarian-puppet install --path=spec/fixtures/modules/" + pwd = `pwd`.strip + unless File.directory?("#{pwd}/spec/fixtures/modules/munin") + sh "ln -s #{pwd} #{pwd}/spec/fixtures/modules/munin" + end sh 'ls -laF spec/fixtures/modules' - sh 'ls -laF spec/fixtures/modules/munin/manifests' end task :spec_prep => :librarian_spec_prep diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7269ae5..70ab1fb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,5 @@ require 'puppetlabs_spec_helper/module_spec_helper' -require 'rspec-puppet' - fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures')) RSpec.configure do |c| -- cgit v1.2.3 From 26224742940b06335bca3cb8f5e09d0c0a5cabef Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sun, 13 Oct 2013 20:24:20 +0200 Subject: Class[] -> Class[] requirement replaced by an anchor --- Rakefile | 1 - manifests/client.pp | 38 ++++++++++++++++++++++++++++++++------ manifests/plugins/setup.pp | 5 ++--- 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/Rakefile b/Rakefile index 3bc7abd..e9e821a 100644 --- a/Rakefile +++ b/Rakefile @@ -18,7 +18,6 @@ task :librarian_spec_prep do unless File.directory?("#{pwd}/spec/fixtures/modules/munin") sh "ln -s #{pwd} #{pwd}/spec/fixtures/modules/munin" end - sh 'ls -laF spec/fixtures/modules' end task :spec_prep => :librarian_spec_prep diff --git a/manifests/client.pp b/manifests/client.pp index 4d70cac..c33ec0d 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -12,13 +12,39 @@ class munin::client( $shorewall_collector_source = 'net', $export_tag = 'munin' ) { + anchor { 'munin::client::installed': } + case $::operatingsystem { - openbsd: { include munin::client::openbsd } - darwin: { include munin::client::darwin } - debian,ubuntu: { include munin::client::debian } - gentoo: { include munin::client::gentoo } - centos: { include munin::client::package } - default: { include munin::client::base } + openbsd: { + class { 'munin::client::openbsd': + before => Anchor['munin::client::installed'] + } + } + darwin: { + class { 'munin::client::darwin': + before => Anchor['munin::client::installed'] + } + } + debian,ubuntu: { + class { 'munin::client::debian': + before => Anchor['munin::client::installed'] + } + } + gentoo: { + class { 'munin::client::gentoo': + before => Anchor['munin::client::installed'] + } + } + centos: { + class { 'munin::client::package': + before => Anchor['munin::client::installed'] + } + } + default: { + class { 'munin::client::base': + before => Anchor['munin::client::installed'] + } + } } if $munin::client::manage_shorewall { class{'shorewall::rules::munin': diff --git a/manifests/plugins/setup.pp b/manifests/plugins/setup.pp index e0826f0..e1a57d9 100644 --- a/manifests/plugins/setup.pp +++ b/manifests/plugins/setup.pp @@ -1,12 +1,10 @@ # Set up the munin plugins for a node class munin::plugins::setup { - # This is required for the munin-node service and package requirements below. - Class['munin::client'] -> Class['munin::plugins::setup'] - file { [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]: ensure => directory, + require => Anchor['munin::client::installed'], ignore => 'snmp_*', checksum => mtime, recurse => true, @@ -18,6 +16,7 @@ class munin::plugins::setup { mode => '0755'; '/etc/munin/plugin-conf.d/munin-node': ensure => present, + require => Anchor['munin::client::installed'], notify => Service['munin-node'], owner => root, group => 0, -- cgit v1.2.3 From 7be20b4d90918dce2404d5957fc6a2b77e082caf Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sun, 13 Oct 2013 20:30:33 +0200 Subject: munin host specs --- spec/classes/munin_client_spec.rb | 1 - spec/classes/munin_host_spec.rb | 26 +++++++++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/spec/classes/munin_client_spec.rb b/spec/classes/munin_client_spec.rb index ebf8d73..9a92cef 100644 --- a/spec/classes/munin_client_spec.rb +++ b/spec/classes/munin_client_spec.rb @@ -18,7 +18,6 @@ describe 'munin::client' do :operatingsystem => os, :osfamily => 'RedHat', :lsbdistcodename => codename, - :interfaces => 'lo,eth0', }} it { should contain_package('munin-node') } it { should contain_file('/etc/munin/munin-node.conf') } diff --git a/spec/classes/munin_host_spec.rb b/spec/classes/munin_host_spec.rb index ccfcee6..461ced5 100644 --- a/spec/classes/munin_host_spec.rb +++ b/spec/classes/munin_host_spec.rb @@ -10,12 +10,28 @@ describe 'munin::host' do }} it { should contain_package('munin') } it { should contain_file('/etc/munin/munin.conf') } + it { should include_class('munin::host') } end -# context 'on debian-like system' do -# it_behaves_like 'debian-host', 'Debian', 'squeeze' -# it_behaves_like 'debian', 'Debian', 'wheezy' -# it_behaves_like 'debian', 'Ubuntu', 'precise' -# end + shared_examples 'redhat-host' do |os, codename| + let(:facts) {{ + :operatingsystem => os, + :osfamily => 'RedHat', + :lsbdistcodename => codename, + :concat_basedir => '/var/lib/puppet/concat', + }} + it { should contain_package('munin') } + it { should contain_file('/etc/munin/munin.conf') } + it { should include_class('munin::host') } + end + context 'on debian-like system' do + it_behaves_like 'debian-host', 'Debian', 'squeeze' + it_behaves_like 'debian-host', 'Debian', 'wheezy' + it_behaves_like 'debian-host', 'Ubuntu', 'precise' + end + + context 'on redhat-like system' do + it_behaves_like 'redhat-host', 'CentOS', '6' + end end -- cgit v1.2.3 From 949474630dd6daf44a1da3820fa67c99a387e2b4 Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sun, 13 Oct 2013 20:32:54 +0200 Subject: disabled testing of puppet 2.6 --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 330677c..bd4225e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,9 @@ rvm: - 2.0.0 script: 'rake spec' env: - - PUPPET_VERSION=2.6.0 - PUPPET_VERSION=2.7.0 + - PUPPET_VERSION=3.0.0 + - PUPPET_VERSION=3.1.0 - PUPPET_VERSION=3.2.0 matrix: exclude: -- cgit v1.2.3 From b38f8b003efd9babe298029309c7ace0cc0a7e7c Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sun, 13 Oct 2013 20:40:55 +0200 Subject: disabled building on ruby 2.0 before puppet 3.2 --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bd4225e..e27b2f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,9 @@ matrix: - rvm: 1.9.3 env: PUPPET_VERSION=2.6.0 # No support for Ruby 2.0 before Puppet 3.2 - - rvm: 2.0.0 - env: PUPPET_VERSION=2.6.0 - rvm: 2.0.0 env: PUPPET_VERSION=2.7.0 + - rvm: 2.0.0 + env: PUPPET_VERSION=3.0.0 + - rvm: 2.0.0 + env: PUPPET_VERSION=3.1.0 -- cgit v1.2.3