summaryrefslogtreecommitdiff
path: root/spec/classes/munin_client_spec.rb
diff options
context:
space:
mode:
authorGabriel Filion <gabster@lelutin.ca>2014-12-13 09:34:56 -0500
committerGabriel Filion <gabster@lelutin.ca>2014-12-13 10:21:25 -0500
commit48272434978f95c70e34aebe9ce188157f8f935e (patch)
tree8c940d891cbcba026d56cf8ed2935361debc44fd /spec/classes/munin_client_spec.rb
parent7e03247a9e219fe8e57d544957eb06e305e69fc1 (diff)
parent27c9a5dbc2083dcc20d059008702dd3f75382bcc (diff)
Merge remote-tracking branch 'immerda/master' into merge_immerda
Conflicts: manifests/plugins/interfaces.pp $real_ifs was changed on master and we'd like to keep that change $ifs was changed to use the prefix() function and we'd like to keep that change.
Diffstat (limited to 'spec/classes/munin_client_spec.rb')
-rw-r--r--spec/classes/munin_client_spec.rb50
1 files changed, 50 insertions, 0 deletions
diff --git a/spec/classes/munin_client_spec.rb b/spec/classes/munin_client_spec.rb
new file mode 100644
index 0000000..f7fc5e9
--- /dev/null
+++ b/spec/classes/munin_client_spec.rb
@@ -0,0 +1,50 @@
+require 'spec_helper'
+
+describe 'munin::client' do
+ shared_examples 'debian-client' 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') }
+ it { should contain_class('munin::client::debian') }
+ end
+
+ shared_examples 'redhat-client' do |os, codename|
+ let(:facts) {{
+ :operatingsystem => os,
+ :osfamily => 'RedHat',
+ :lsbdistcodename => codename,
+ }}
+ 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-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-client', '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') }
+ it { should contain_class('munin::client::gentoo') }
+ end
+
+end