Skip to content

Commit

Permalink
update spec_helper_acceptance
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jul 29, 2018
1 parent 0270fec commit 692b491
Showing 1 changed file with 9 additions and 24 deletions.
33 changes: 9 additions & 24 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,33 +1,18 @@
require 'beaker-rspec'
require 'beaker/puppet_install_helper'
require 'beaker/module_install_helper'

UNSUPPORTED_PLATFORMS = ['windows'].freeze

unless ENV['RS_PROVISION'] == 'no' || ENV['BEAKER_provision'] == 'no'
hosts.each do |host|
if host.is_pe?
install_pe
else
install_puppet
end
end
end
run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'
install_ca_certs unless ENV['PUPPET_INSTALL_TYPE'] =~ %r{pe}i
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
hosts.each do |host|
shell('rm -rf /etc/puppet/modules/python/')
copy_module_to(host, source: proj_root, module_name: 'python')
shell("/bin/touch #{default['puppetpath']}/hiera.yaml")
on host, puppet('module install puppetlabs-stdlib'), acceptable_exit_codes: [0, 1]
on host, puppet('module install stahnma-epel'), acceptable_exit_codes: [0, 1]
hosts.each do |host|
if host[:platform] =~ %r{el-7-x86_64} && host[:hypervisor] =~ %r{docker}
on(host, "sed -i '/nodocs/d' /etc/yum.conf")
end
end
end

0 comments on commit 692b491

Please sign in to comment.