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:
parent
9f79619a08
commit
9c34a6cbf6
10
examples/test.pp
Normal file
10
examples/test.pp
Normal 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']
|
||||
}
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user