forked from voxpupuli/puppet-rabbitmq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spec_helper_acceptance.rb
38 lines (29 loc) · 1.3 KB
/
spec_helper_acceptance.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'beaker-rspec'
require 'beaker/puppet_install_helper'
run_puppet_install_helper
UNSUPPORTED_PLATFORMS = []
RSpec.configure do |c|
# Project root
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
# Readable test descriptions
c.formatter = :documentation
c.before :suite do
puppet_module_install(:source => proj_root, :module_name => 'rabbitmq')
hosts.each do |host|
if fact('osfamily') == 'RedHat' && fact('selinux') == 'true'
# Make sure selinux is disabled so the tests work.
on host, puppet('apply', '-e',
%{"exec { 'setenforce 0': path => '/bin:/sbin:/usr/bin:/usr/sbin', onlyif => 'which setenforce && getenforce | grep Enforcing', }"})
end
on host, "/bin/touch #{default['puppetpath']}/hiera.yaml"
on host, puppet('module', 'install', 'puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }
on host, puppet('module', 'install', 'puppet-staging'), { :acceptable_exit_codes => [0,1] }
if fact('osfamily') == 'Debian'
on host, puppet('module', 'install', 'puppetlabs-apt'), { :acceptable_exit_codes => [0,1] }
end
if fact('osfamily') == 'RedHat'
on host, puppet('module', 'install', 'garethr-erlang'), { :acceptable_exit_codes => [0,1] }
end
end
end
end