Skip to content

Commit f95edde

Browse files
committed
update spec_helper_acceptance
1 parent c90613c commit f95edde

1 file changed

Lines changed: 10 additions & 24 deletions

File tree

spec/spec_helper_acceptance.rb

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,19 @@
11
require 'beaker-rspec'
2+
require 'beaker-puppet'
3+
require 'beaker/puppet_install_helper'
4+
require 'beaker/module_install_helper'
25

3-
UNSUPPORTED_PLATFORMS = ['windows'].freeze
4-
5-
unless ENV['RS_PROVISION'] == 'no' || ENV['BEAKER_provision'] == 'no'
6-
hosts.each do |host|
7-
if host.is_pe?
8-
install_pe
9-
else
10-
install_puppet
11-
end
12-
end
13-
end
6+
run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'
7+
install_ca_certs unless ENV['PUPPET_INSTALL_TYPE'] =~ %r{pe}i
8+
install_module_on(hosts)
9+
install_module_dependencies_on(hosts)
1410

1511
RSpec.configure do |c|
16-
# Project root
17-
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
18-
1912
# Readable test descriptions
2013
c.formatter = :documentation
21-
22-
# Configure all nodes in nodeset
23-
c.before :suite do
24-
# Install module and dependencies
25-
hosts.each do |host|
26-
shell('rm -rf /etc/puppet/modules/python/')
27-
copy_module_to(host, source: proj_root, module_name: 'python')
28-
shell("/bin/touch #{default['puppetpath']}/hiera.yaml")
29-
on host, puppet('module install puppetlabs-stdlib'), acceptable_exit_codes: [0, 1]
30-
on host, puppet('module install stahnma-epel'), acceptable_exit_codes: [0, 1]
14+
hosts.each do |host|
15+
if host[:platform] =~ %r{el-7-x86_64} && host[:hypervisor] =~ %r{docker}
16+
on(host, "sed -i '/nodocs/d' /etc/yum.conf")
3117
end
3218
end
3319
end

0 commit comments

Comments
 (0)