mirror of
https://github.com/krislamo/puppet-fluentd
synced 2024-11-09 20:50:34 +00:00
Merge pull request #17 from wywygmbh/conf_file_fixtures
Conf file fixtures
This commit is contained in:
commit
f4da637999
@ -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
|
@ -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
|
6
spec/fixtures/files/filter_record_transformer.conf
vendored
Normal file
6
spec/fixtures/files/filter_record_transformer.conf
vendored
Normal 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
13
spec/fixtures/files/match_copy.conf
vendored
Normal 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>
|
11
spec/fixtures/files/match_secure_forward.conf
vendored
Normal file
11
spec/fixtures/files/match_secure_forward.conf
vendored
Normal 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
6
spec/fixtures/files/source_tail.conf
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
<source>
|
||||
type tail
|
||||
format json
|
||||
path /var/log/test-application/*.json
|
||||
tag application.test
|
||||
</source>
|
Loading…
Reference in New Issue
Block a user