diff options
author | varac <varacanero@zeromail.org> | 2016-03-16 22:03:36 +0100 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2016-03-16 22:03:36 +0100 |
commit | 6c633f8606e04aad29f40a3fc0fcfdcb4b293715 (patch) | |
tree | 63d7c8a54a643cc628b9b4f7a3b941d9f508c4ad /spec/classes/munin_plugins_interfaces_spec.rb | |
parent | 503e9296860e4d844a1ee391331996db87e0bfa6 (diff) | |
parent | 87dc315597e8ed27c2e0907615ede8a3f1521b7a (diff) |
Diffstat (limited to 'spec/classes/munin_plugins_interfaces_spec.rb')
-rw-r--r-- | spec/classes/munin_plugins_interfaces_spec.rb | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/spec/classes/munin_plugins_interfaces_spec.rb b/spec/classes/munin_plugins_interfaces_spec.rb new file mode 100644 index 0000000..7e3c418 --- /dev/null +++ b/spec/classes/munin_plugins_interfaces_spec.rb @@ -0,0 +1,44 @@ +require 'spec_helper' + +describe 'munin::plugins::interfaces' do + context 'on CentOS' do + let :facts do + { + :operatingsystem => 'CentOS', + :interfaces => 'lo,eth0,sit0', + } + end + + it 'should compile' do + should contain_class('munin::plugins::interfaces') + end + + it 'should create plugins for each interface' do + # lo + should contain_munin__plugin('if_lo').with_ensure('if_') + should contain_munin__plugin('if_err_lo').with_ensure('if_err_') + + # eth0 + should contain_munin__plugin('if_eth0').with_ensure('if_') + should contain_munin__plugin('if_err_eth0').with_ensure('if_err_') + end + + it 'should not create plugins for sit0' do + should_not contain_munin__plugin('if_sit0') + should_not contain_munin__plugin('if_err_sit0') + end + end + + context 'on OpenBSD' do + let :facts do + { + :operatingsystem => 'OpenBSD', + :interfaces => 'eth0', + } + end + + it 'should use if_errcoll_ instead of if_err_' do + should contain_munin__plugin('if_errcoll_eth0').with_ensure('if_errcoll_') + end + end +end |