1
0
mirror of https://github.com/krislamo/puppet-fluentd synced 2024-11-10 04:50:34 +00:00

Merge pull request #17 from wywygmbh/conf_file_fixtures

Conf file fixtures
This commit is contained in:
Max Wilhelm 2017-08-04 10:51:32 +02:00 committed by GitHub
commit f4da637999
7 changed files with 42 additions and 38 deletions

View File

@ -29,12 +29,7 @@ describe 'fluentd::filter' do
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(/<filter \*.test>/). with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/filter_record_transformer.conf')))
with_content(/type record_transformer/).
with_content(/<record>/).
with_content(/hostname \$\{hostname\}/).
with_content(/<\/record>/).
with_content(/<\/filter>/)
end end
end end
end end

View File

@ -36,17 +36,7 @@ describe 'fluentd::match' do
it do it do
is_expected.to contain_file('/etc/td-agent/conf.d/30-match-test.conf'). is_expected.to contain_file('/etc/td-agent/conf.d/30-match-test.conf').
with_content(/<match \*.test>/). with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/match_secure_forward.conf')))
with_content(/flush_interval 30s/).
with_content(/type secure_forward/).
with_content(/secure yes/).
with_content(/shared_key my_shared_key/).
with_content(/self_hostname instance.test.com/).
with_content(/ca_cert_path \/path\/to\/ca.cert/).
with_content(/<server>/).
with_content(/host test.server.com/).
with_content(/<\/server>/).
with_content(/<\/match>/)
end end
end end
@ -76,19 +66,7 @@ describe 'fluentd::match' do
it do it do
is_expected.to contain_file('/etc/td-agent/conf.d/30-match-test.conf'). is_expected.to contain_file('/etc/td-agent/conf.d/30-match-test.conf').
with_content(/<match \*.test>/). with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/match_copy.conf')))
with_content(/type copy/).
with_content(/<store>/).
with_content(/type elasticsearch/).
with_content(/logstashformat true/).
with_content(/hosts 172.20.10.17:9200/).
with_content(/flush_interval 30s/).
with_content(/<\/store>/).
with_content(/<store>/).
with_content(/type file/).
with_content(/path \/tmp\/td-agent-debug.log/).
with_content(/<\/store>/).
with_content(/<\/match>/)
end end
end end
end end

View File

@ -28,12 +28,7 @@ describe 'fluentd::source' do
it do it do
is_expected.to contain_file('/etc/td-agent/conf.d/10-source-test.conf'). is_expected.to contain_file('/etc/td-agent/conf.d/10-source-test.conf').
with_content(/<source>/). with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/source_tail.conf')))
with_content(/type tail/).
with_content(/format json/).
with_content(/path \/var\/log\/test-application\/\*.json/).
with_content(/tag application.test/).
with_content(/<\/source>/)
end end
end end
end end

View File

@ -0,0 +1,6 @@
<filter *.test>
type record_transformer
<record>
hostname ${hostname}
</record>
</filter>

13
spec/fixtures/files/match_copy.conf vendored Normal file
View File

@ -0,0 +1,13 @@
<match *.test>
type copy
<store>
type elasticsearch
logstashformat true
hosts 172.20.10.17:9200
flush_interval 30s
</store>
<store>
type file
path /tmp/td-agent-debug.log
</store>
</match>

View File

@ -0,0 +1,11 @@
<match *.test>
flush_interval 30s
type secure_forward
secure yes
shared_key my_shared_key
self_hostname instance.test.com
ca_cert_path /path/to/ca.cert
<server>
host test.server.com
</server>
</match>

6
spec/fixtures/files/source_tail.conf vendored Normal file
View File

@ -0,0 +1,6 @@
<source>
type tail
format json
path /var/log/test-application/*.json
tag application.test
</source>