Revision 85a118b7
Added by Ewoud Kohl van Wijngaarden about 7 years ago
spec/spec_helper_acceptance.rb | ||
---|---|---|
require 'beaker-rspec/spec_helper'
|
||
require 'beaker-rspec/helpers/serverspec'
|
||
require 'beaker/puppet_install_helper'
|
||
require 'beaker/module_install_helper'
|
||
|
||
run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'
|
||
install_module_on(hosts)
|
||
install_module_dependencies_on(hosts)
|
||
|
||
RSpec.configure do |c|
|
||
# Project root
|
||
proj_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 and dependencies
|
||
puppet_module_install(:source => proj_root, :module_name => 'candlepin')
|
||
hosts.each do |host|
|
||
["puppetlabs-stdlib"].each do |mod|
|
||
on host, puppet('module', 'install', mod), { :acceptable_exit_codes => [0] }
|
||
end
|
||
|
||
if fact_on(host, 'osfamily') == 'RedHat'
|
||
# don't delete downloaded rpm for use with BEAKER_provision=no +
|
||
# BEAKER_destroy=no
|
||
on host, 'sed -i "s/keepcache=.*/keepcache=1/" /etc/yum.conf'
|
||
# refresh check if cache needs refresh on next yum command
|
||
on host, 'yum clean expire-cache'
|
||
# We always need EPEL
|
||
on host, puppet('resource', 'package', 'epel-release', 'ensure=installed')
|
||
end
|
||
end
|
||
end
|
||
... | ... | |
apply_manifest(pp, catch_changes: true)
|
||
end
|
||
end
|
||
|
||
shared_examples 'the example' do |name|
|
||
let(:pp) do
|
||
path = File.join(File.dirname(File.dirname(__FILE__)), 'examples', name)
|
||
File.read(path)
|
||
end
|
||
|
||
it_behaves_like 'a idempotent resource'
|
||
end
|
Also available in: Unified diff
modulesync: Drop puppet 3, improve testing infra