1
0
mirror of https://github.com/krislamo/puppet-fluentd synced 2024-12-16 05:10:36 +00:00

added gem plugin installation to acceptance test

This commit is contained in:
Max Wilhelm 2016-01-27 20:12:28 +01:00
parent 9f79619a08
commit 9c34a6cbf6
2 changed files with 19 additions and 1 deletions

10
examples/test.pp Normal file
View File

@ -0,0 +1,10 @@
# This file is use for the beaker tests.
# basic installation
include '::fluentd'
# install a gem plugin
::fluentd::plugin { 'fluent-plugin-elasticsearch':
type => 'gem',
require => Class['::fluentd']
}

View File

@ -2,17 +2,19 @@ require 'spec_helper_acceptance'
RSpec.describe 'fluentd' do RSpec.describe 'fluentd' do
it 'runs successfully' do it 'runs successfully' do
manifest = File.read(File.expand_path('../../examples/init.pp', File.dirname(__FILE__))) manifest = File.read(File.expand_path('../../examples/test.pp', File.dirname(__FILE__)))
# Run it twice and test for idempotency # Run it twice and test for idempotency
apply_manifest(manifest, catch_failures: true) apply_manifest(manifest, catch_failures: true)
expect(apply_manifest(manifest, catch_failures: true).exit_code).to be_zero expect(apply_manifest(manifest, catch_failures: true).exit_code).to be_zero
end end
# test package
describe package('td-agent') do describe package('td-agent') do
it { is_expected.to be_installed } it { is_expected.to be_installed }
end end
# test service
describe service('td-agent') do describe service('td-agent') do
it { is_expected.to be_running } it { is_expected.to be_running }
# @todo # @todo
@ -34,4 +36,10 @@ RSpec.describe 'fluentd' do
it { is_expected.to be_enabled } it { is_expected.to be_enabled }
end end
end end
# test gem installed plugin
describe command('/opt/td-agent/embedded/bin/gem list') do
its(:stdout) { should contain('fluent-plugin-elasticsearch') }
end
end end