1
0
mirror of https://github.com/krislamo/puppet-fluentd synced 2024-12-16 13:20:35 +00:00

added first version of beaker tests (wip)

This commit is contained in:
Max Wilhelm 2016-01-11 18:36:45 +01:00
parent d11007eb35
commit c6e3a69f2b
4 changed files with 63 additions and 0 deletions

View File

@ -5,3 +5,5 @@ gem 'puppet', puppetversion
gem 'puppetlabs_spec_helper', '>= 0.8.2' gem 'puppetlabs_spec_helper', '>= 0.8.2'
gem 'puppet-lint', '>= 1.0.0' gem 'puppet-lint', '>= 1.0.0'
gem 'facter', '>= 1.7.0' gem 'facter', '>= 1.7.0'
gem 'beaker-rspec'
gem 'pry'

View File

@ -0,0 +1,20 @@
require 'spec_helper_acceptance'
RSpec.describe 'fluentd' do
it 'runs successfully' do
manifest = File.read(File.expand_path('../../examples/init.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
describe package('td-agent') do
it { is_expected.to be_installed }
end
describe service('td-agent') do
it { is_expected.to be_enabled.with_level(3) }
it { is_expected.to be_running }
end
end

View File

@ -0,0 +1,13 @@
HOSTS:
ubuntu-server-1204-x64:
roles:
- master
platform: ubuntu-12.04-amd64
box: puppetlabs/ubuntu-12.04-64-nocm
#box: wywy-ubuntu-12.04.5
box_url: https://vagrantcloud.com/puppetlabs/boxes/ubuntu-12.04-64-nocm
#box_url: http://files.munich.wywy.com/vagrant/box/wywy-ubuntu-12.04.5.box
hypervisor: vagrant
CONFIG:
log_level: verbose
type: foss

View File

@ -0,0 +1,28 @@
require 'beaker-rspec'
require 'pry'
hosts.each do |host|
# Install Puppet
on host, 'apt-get -y install ruby1.9.1 rubygems ruby1.9.1-dev libaugeas-ruby1.9.1'
on host, 'update-alternatives --set ruby /usr/bin/ruby1.9.1'
on host, 'update-alternatives --set gem /usr/bin/gem1.9.1'
on host, install_puppet
end
RSpec.configure do |c|
# Project root
module_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
# Readable test descriptions
c.formatter = :documentation
# Configure all nodes in nodeset
c.before :suite do
# Install module
puppet_module_install(:source => module_root, :module_name => 'fluentd')
hosts.each do |host|
on host, puppet('module', 'install', 'puppetlabs-stdlib', '--version', '4.9.0')
on host, puppet('module', 'install', 'puppetlabs-apt', '--version', '2.1.1')
end
end
end