]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/rabbitmq/spec/spec_helper_acceptance.rb
move to puppetlabs rabbitmq module
[dsa-puppet.git] / 3rdparty / modules / rabbitmq / spec / spec_helper_acceptance.rb
1 require 'beaker-rspec'
2
3 UNSUPPORTED_PLATFORMS = []
4
5 unless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_provision'] == 'no'
6   if hosts.first.is_pe?
7     install_pe
8   else
9     install_puppet
10   end
11   hosts.each do |host|
12     on hosts, "mkdir -p #{host['distmoduledir']}"
13   end
14 end
15
16 RSpec.configure do |c|
17   # Project root
18   proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
19
20   # Readable test descriptions
21   c.formatter = :documentation
22   c.before :suite do
23     hosts.each do |host|
24       copy_module_to(host, :source => proj_root, :module_name => 'rabbitmq')
25
26       shell("/bin/touch #{default['puppetpath']}/hiera.yaml")
27       shell('puppet module install puppetlabs-stdlib', { :acceptable_exit_codes => [0,1] })
28       if fact('osfamily') == 'Debian'
29         shell('puppet module install puppetlabs-apt --version 1.8.0 --force', { :acceptable_exit_codes => [0,1] })
30       end
31       shell('puppet module install nanliu-staging', { :acceptable_exit_codes => [0,1] })
32       if fact('osfamily') == 'RedHat'
33         shell('puppet module install garethr-erlang', { :acceptable_exit_codes => [0,1] })
34       end
35     end
36   end
37 end
38