mirror of
https://github.com/krislamo/puppet-fluentd
synced 2024-12-16 05:10:36 +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:
parent
bfa6de193e
commit
525fc9c5ab
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user