mirror of
https://github.com/krislamo/puppet-fluentd
synced 2024-12-16 05:10:36 +00:00
added filter_spec
This commit is contained in:
parent
df6c698931
commit
87b6efde4b
39
spec/defines/filter_spec.rb
Normal file
39
spec/defines/filter_spec.rb
Normal file
@ -0,0 +1,39 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::filter' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
let(:pre_condition) { 'include fluentd' }
|
||||
|
||||
context 'basic source' do
|
||||
let(:title) { 'test' }
|
||||
let(:params) do
|
||||
{
|
||||
priority: '20',
|
||||
pattern: '*.test',
|
||||
config: {
|
||||
'type' => 'record_transformer',
|
||||
'record' => {
|
||||
'hostname' => '${hostname}'
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
it do
|
||||
is_expected.to contain_file('/etc/td-agent/conf.d/20-filter-test.conf').
|
||||
with_content(/<filter \*.test>/).
|
||||
with_content(/type record_transformer/).
|
||||
with_content(/<record>/).
|
||||
with_content(/hostname \$\{hostname\}/).
|
||||
with_content(/<\/record>/).
|
||||
with_content(/<\/filter>/)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user