mirror of
https://github.com/krislamo/puppet-fluentd
synced 2025-01-05 13:20:36 +00:00
use rspec-puppet-facts for fluentd_config_spec
This commit is contained in:
parent
754cd4a696
commit
b51a559684
@ -1,46 +1,31 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'fluentd::config', :type => :class do
|
describe 'fluentd::config', :type => :class do
|
||||||
shared_examples 'when called with no parameters' do
|
on_supported_os.each do |os, facts|
|
||||||
it {
|
context "on #{os}" do
|
||||||
should contain_file('/etc/td-agent/td-agent.conf').with({
|
let :facts do
|
||||||
'ensure' => 'file',
|
facts
|
||||||
'owner' => 'root',
|
end
|
||||||
'group' => 'root',
|
|
||||||
'source' => 'puppet:///modules/fluentd/td-agent.conf',
|
|
||||||
'notify' => 'Class[Fluentd::Service]'
|
|
||||||
})
|
|
||||||
|
|
||||||
should contain_file('/etc/td-agent/conf.d').with({
|
describe 'when called with no parameters' do
|
||||||
'ensure' => 'directory',
|
|
||||||
'owner' => 'td-agent',
|
|
||||||
'group' => 'td-agent',
|
|
||||||
'mode' => '0750'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when osfamily is Debian' do
|
it {
|
||||||
let(:facts) {
|
should contain_file('/etc/td-agent/td-agent.conf').with({
|
||||||
{
|
'ensure' => 'file',
|
||||||
:osfamily => 'Debian',
|
'owner' => 'root',
|
||||||
:lsbdistid => 'Ubuntu',
|
'group' => 'root',
|
||||||
:operatingsystem => 'Ubuntu',
|
'source' => 'puppet:///modules/fluentd/td-agent.conf',
|
||||||
:lsbdistcodename => 'precise',
|
'notify' => 'Class[Fluentd::Service]'
|
||||||
:architecture => 'amd64',
|
})
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
include_examples 'when called with no parameters'
|
should contain_file('/etc/td-agent/conf.d').with({
|
||||||
end
|
'ensure' => 'directory',
|
||||||
|
'owner' => 'td-agent',
|
||||||
context 'when osfamily is RedHat' do
|
'group' => 'td-agent',
|
||||||
let(:facts) {
|
'mode' => '0750'
|
||||||
{
|
})
|
||||||
:osfamily => 'RedHat',
|
}
|
||||||
}
|
end
|
||||||
}
|
end
|
||||||
|
|
||||||
include_examples 'when called with no parameters'
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user