mirror of
https://github.com/krislamo/puppet-fluentd
synced 2024-12-16 05:10:36 +00:00
use rspec-puppet-facts for filter_spec
This commit is contained in:
parent
c2f95f4bc9
commit
258a37ff11
@ -1,35 +1,34 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'fluentd::filter' do
|
describe 'fluentd::filter' do
|
||||||
let(:facts) {
|
on_supported_os.each do |os, facts|
|
||||||
{
|
context "on #{os}" do
|
||||||
:osfamily => 'Debian',
|
let :facts do
|
||||||
:lsbdistid => 'Ubuntu',
|
facts
|
||||||
:operatingsystem => 'Ubuntu',
|
end
|
||||||
:lsbdistcodename => 'precise',
|
|
||||||
:architecture => 'amd64',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let(:pre_condition) { 'include fluentd' }
|
|
||||||
|
|
||||||
context 'basic filter' do
|
let(:pre_condition) { 'include fluentd' }
|
||||||
let(:title) { 'test' }
|
|
||||||
let(:params) do
|
describe 'basic filter' do
|
||||||
{
|
let(:title) { 'test' }
|
||||||
priority: '20',
|
let(:params) do
|
||||||
pattern: '*.test',
|
{
|
||||||
config: {
|
priority: '20',
|
||||||
|
pattern: '*.test',
|
||||||
|
config: {
|
||||||
'type' => 'record_transformer',
|
'type' => 'record_transformer',
|
||||||
'record' => {
|
'record' => {
|
||||||
'hostname' => '${hostname}'
|
'hostname' => '${hostname}'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
end
|
||||||
end
|
|
||||||
|
|
||||||
it do
|
it do
|
||||||
is_expected.to contain_file('/etc/td-agent/conf.d/20-filter-test.conf').
|
is_expected.to contain_file('/etc/td-agent/conf.d/20-filter-test.conf').
|
||||||
with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/filter_record_transformer.conf')))
|
with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/filter_record_transformer.conf')))
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user