-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a couples of spec tests to cover basic usage
- Loading branch information
Joshua Hoblitt
committed
May 16, 2013
1 parent
56c987b
commit bb34e2d
Showing
1 changed file
with
47 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
require 'spec_helper' | ||
|
||
describe 'smartd' do | ||
let(:title) { 'redhat' } | ||
let(:facts) { {:osfamily=> 'RedHat', :lsbmajordistrelease => 6} } | ||
|
||
context 'without params' do | ||
it do | ||
should include_class('smartd') | ||
should include_class('smartd::params') | ||
should contain_package('smartmontools') | ||
should contain_service('smartd') | ||
should contain_file('/etc/smartd.conf')\ | ||
.with_content(<<-END.gsub(/^\s+/, "")) | ||
# Managed by Puppet -- do not edit! | ||
DEFAULT -m root -M daily | ||
DEVICESCAN | ||
END | ||
end | ||
end | ||
|
||
context 'without params + megaraid facts' do | ||
let(:facts) do | ||
{ | ||
:osfamily=> 'RedHat', :lsbmajordistrelease => 6, | ||
:megaraid_adapters => '1', | ||
:megaraid_virtual_drives => '/dev/sdb,/dev/sda', | ||
:megaraid_physical_drives => '2,1', | ||
} | ||
end | ||
|
||
it do | ||
should include_class('smartd') | ||
should include_class('smartd::params') | ||
should contain_package('smartmontools') | ||
should contain_service('smartd') | ||
should contain_file('/etc/smartd.conf')\ | ||
.with_content(<<-END.gsub(/^\s+/, "")) | ||
# Managed by Puppet -- do not edit! | ||
DEFAULT -m root -M daily | ||
/dev/sda -d sat+megaraid,1 | ||
/dev/sda -d sat+megaraid,2 | ||
DEVICESCAN | ||
END | ||
end | ||
end | ||
end |