1
0
mirror of https://github.com/krislamo/puppet-fluentd synced 2024-09-19 20:20:35 +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
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
apply_manifest(manifest, catch_failures: true)
expect(apply_manifest(manifest, catch_failures: true).exit_code).to be_zero
end
# test package
describe package('td-agent') do
it { is_expected.to be_installed }
end
# test service
describe service('td-agent') do
it { is_expected.to be_running }
# @todo
@ -34,4 +36,10 @@ RSpec.describe 'fluentd' do
it { is_expected.to be_enabled }
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