1
0
mirror of https://github.com/krislamo/puppet-fluentd synced 2024-09-19 20:20:35 +00:00

use fixtures for conf file tests

should help to solve https://github.com/wywygmbh/puppet-fluentd/issues/4
This commit is contained in:
Max Wilhelm 2017-08-03 12:00:59 +02:00
parent bfa6de193e
commit 525fc9c5ab
3 changed files with 6 additions and 38 deletions

View File

@ -29,12 +29,7 @@ describe 'fluentd::filter' do
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>/)
with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/filter_record_transformer.conf')))
end
end
end
end

View File

@ -36,17 +36,7 @@ describe 'fluentd::match' do
it do
is_expected.to contain_file('/etc/td-agent/conf.d/30-match-test.conf').
with_content(/<match \*.test>/).
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>/)
with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/match_secure_forward.conf')))
end
end
@ -76,19 +66,7 @@ describe 'fluentd::match' do
it do
is_expected.to contain_file('/etc/td-agent/conf.d/30-match-test.conf').
with_content(/<match \*.test>/).
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>/)
with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/match_copy.conf')))
end
end
end

View File

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