1
0
mirror of https://github.com/krislamo/puppet-fluentd synced 2024-09-20 04:30:36 +00:00
puppet-fluentd/spec/defines/plugin_spec.rb

52 lines
1.2 KiB
Ruby
Raw Normal View History

2015-12-04 12:28:06 +00:00
require 'spec_helper'
describe 'fluentd::plugin' do
2017-08-17 11:34:03 +00:00
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
2015-12-04 12:28:06 +00:00
2017-08-17 11:34:03 +00:00
let(:pre_condition) { 'include fluentd' }
2015-12-04 12:28:06 +00:00
2017-08-17 11:34:03 +00:00
describe 'gem plugin' do
let(:title) { 'fluent-plugin-elasticsearch' }
let(:params) do
{
type: 'gem'
}
end
2015-12-04 12:28:06 +00:00
2017-08-17 11:34:03 +00:00
it do
should contain_package('fluent-plugin-elasticsearch').with({
'ensure' => 'present',
'provider' => 'fluentd_gem',
'notify' => 'Class[Fluentd::Service]'
})
end
end
describe 'file plugin' do
let(:title) { 'fluent-plugin-test' }
let(:params) do
{
type: 'file',
source: 'puppet:///path/to/source'
}
end
2015-12-04 12:28:06 +00:00
2017-08-17 11:34:03 +00:00
it do
should contain_file('/etc/td-agent/plugin/fluent-plugin-test').with({
'ensure' => 'present',
'owner' => 'td-agent',
'group' => 'td-agent',
'mode' => '0640',
'source' => 'puppet:///path/to/source',
'notify' => 'Class[Fluentd::Service]'
})
end
end
2015-12-04 12:28:06 +00:00
end
end
2017-08-17 11:34:03 +00:00
end