mirror of
https://github.com/krislamo/puppet-fluentd
synced 2024-11-09 20:50:34 +00:00
added match_spec
This commit is contained in:
parent
87b6efde4b
commit
0723d2df21
49
spec/defines/match_spec.rb
Normal file
49
spec/defines/match_spec.rb
Normal file
@ -0,0 +1,49 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'fluentd::match' do
|
||||
let(:facts) {
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:lsbdistid => 'Ubuntu',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:lsbdistcodename => 'precise',
|
||||
}
|
||||
}
|
||||
let(:pre_condition) { 'include fluentd' }
|
||||
|
||||
context 'basic source' do
|
||||
let(:title) { 'test' }
|
||||
let(:params) do
|
||||
{
|
||||
priority: '30',
|
||||
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',
|
||||
'servers' => {
|
||||
'host' => 'test.server.com'
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
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(/<servers>/).
|
||||
with_content(/host test.server.com/).
|
||||
with_content(/<\/servers>/).
|
||||
with_content(/<\/match>/)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user