-
-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6197c0b
commit 3364978
Showing
3 changed files
with
44 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
$upss = { }, | ||
) { | ||
|
||
include ::collectd | ||
include collectd | ||
|
||
|
||
collectd::plugin { 'nut': | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
require 'spec_helper' | ||
|
||
describe 'collectd::plugin::nut', type: :class do | ||
let :pre_condition do | ||
'include ::collectd' | ||
end | ||
|
||
on_supported_os(baseline_os_hash).each do |os, facts| | ||
context "on #{os} " do | ||
let :facts do | ||
facts | ||
end | ||
|
||
context ':ensure => present, default params' do | ||
it 'Will create /etc/collectd.d/10-nut.conf' do | ||
is_expected.to contain_file('nut.load'). | ||
with(ensure: 'present', | ||
path: '/etc/collectd.d/10-nut.conf', | ||
content: %r{LoadPlugin nut}) | ||
end | ||
end | ||
|
||
context ':ensure => present, single entry' do | ||
let :params do | ||
{ upss: ['ups1@localhost'] } | ||
end | ||
|
||
it 'Will create /etc/collectd.d/[email protected]' do | ||
is_expected.to contain_file('/etc/collectd.d/[email protected]'). | ||
with(ensure: 'present', | ||
path: '/etc/collectd.d/[email protected]', | ||
content: %r{UPS "ups1@localhost"}) | ||
end | ||
end | ||
end | ||
end | ||
end |