2015-12-04 12:11:08 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'fluentd::source' do
|
|
|
|
let(:facts) {
|
|
|
|
{
|
|
|
|
:osfamily => 'Debian',
|
|
|
|
:lsbdistid => 'Ubuntu',
|
|
|
|
:operatingsystem => 'Ubuntu',
|
|
|
|
:lsbdistcodename => 'precise',
|
2016-05-12 20:31:52 +00:00
|
|
|
:architecture => 'amd64',
|
2015-12-04 12:11:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
let(:pre_condition) { 'include fluentd' }
|
|
|
|
|
|
|
|
context 'basic source' do
|
|
|
|
let(:title) { 'test' }
|
|
|
|
let(:params) do
|
|
|
|
{
|
|
|
|
priority: '10',
|
|
|
|
config: {
|
|
|
|
'type' => 'tail',
|
|
|
|
'format' => 'json',
|
|
|
|
'path' => '/var/log/test-application/*.json',
|
|
|
|
'tag' => 'application.test'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
it do
|
|
|
|
is_expected.to contain_file('/etc/td-agent/conf.d/10-source-test.conf').
|
2017-08-03 10:00:59 +00:00
|
|
|
with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/source_tail.conf')))
|
2015-12-04 12:11:08 +00:00
|
|
|
end
|
|
|
|
end
|
2017-08-03 10:00:59 +00:00
|
|
|
end
|