1
0
mirror of https://github.com/krislamo/puppet-fluentd synced 2024-11-14 14:00:36 +00:00
puppet-fluentd/spec/defines/match_spec.rb

72 lines
2.1 KiB
Ruby
Raw Normal View History

2015-12-04 12:11:34 +00:00
require 'spec_helper'
describe 'fluentd::match' do
2017-08-17 11:33:54 +00:00
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
2015-12-04 12:11:34 +00:00
2017-08-17 11:33:54 +00:00
let(:pre_condition) { 'include fluentd' }
describe 'basic match' do
let(:title) { 'test' }
let(:params) do
{
2018-01-17 10:22:32 +00:00
priority: 30,
2017-08-17 11:33:54 +00:00
pattern: '*.test',
config: {
'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',
}
]
}
2015-12-04 12:11:34 +00:00
}
2017-08-17 11:33:54 +00:00
end
2015-12-04 12:11:34 +00:00
2017-08-17 11:33:54 +00:00
it do
is_expected.to contain_file('/etc/td-agent/conf.d/30-match-test.conf').
with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/match_secure_forward.conf')))
end
end
2017-08-17 11:33:54 +00:00
describe 'multiple store' do
let(:title) { 'test' }
let(:params) do
{
2018-01-17 10:22:32 +00:00
priority: 30,
2017-08-17 11:33:54 +00:00
pattern: '*.test',
config: {
'type' => 'copy',
'store' => [
{
'type' => 'elasticsearch',
'logstashformat' => true,
'hosts' => '172.20.10.17:9200',
'flush_interval' => '30s',
},
{
'type' => 'file',
'path' => '/tmp/td-agent-debug.log',
}
]
}
}
2017-08-17 11:33:54 +00:00
end
2017-08-17 11:33:54 +00:00
it do
is_expected.to contain_file('/etc/td-agent/conf.d/30-match-test.conf').
with_content(IO.read(File.join(File.dirname(__FILE__), '../fixtures/files/match_copy.conf')))
end
end
end
end
end