]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/concat/spec/spec_helper_acceptance.rb
upgrade to concat 2.0.0
[dsa-puppet.git] / 3rdparty / modules / concat / spec / spec_helper_acceptance.rb
1 require 'beaker-rspec/spec_helper'
2 require 'beaker-rspec/helpers/serverspec'
3 require 'acceptance/specinfra_stubs'
4
5 unless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_provision'] == 'no'
6   # This will install the latest available package on el and deb based
7   # systems fail on windows and osx, and install via gem on other *nixes
8   foss_opts = {:default_action => 'gem_install'}
9
10   if default.is_pe?; then
11     install_pe;
12   else
13     install_puppet(foss_opts);
14   end
15
16   hosts.each do |host|
17     on hosts, "mkdir -p #{host['distmoduledir']}"
18     if host['platform'] =~ /sles-1/i || host['platform'] =~ /solaris-1/i
19       get_deps = <<-EOS
20       package{'wget':}
21       exec{'download-stdlib':
22         command => "wget -P /root/ https://forgeapi.puppetlabs.com/v3/files/puppetlabs-stdlib-4.5.1.tar.gz --no-check-certificate",
23         path    => ['/opt/csw/bin/','/usr/bin/']
24       }
25       EOS
26       apply_manifest_on(host, get_deps)
27       # have to use force otherwise it checks ssl cert even though it is a local file
28       on host, puppet('module install /root/puppetlabs-stdlib-4.5.1.tar.gz --force --ignore-dependencies'), {:acceptable_exit_codes => [0, 1]}
29     elsif host['platform'] =~ /windows/i
30       on host, shell('curl -k -o c:/puppetlabs-stdlib-4.5.1.tar.gz https://forgeapi.puppetlabs.com/v3/files/puppetlabs-stdlib-4.5.1.tar.gz')
31       on host, puppet('module install c:/puppetlabs-stdlib-4.5.1.tar.gz --force --ignore-dependencies'), {:acceptable_exit_codes => [0, 1]}
32     else
33       on host, puppet('module install puppetlabs-stdlib'), {:acceptable_exit_codes => [0, 1]}
34     end
35   end
36 end
37
38 RSpec.configure do |c|
39   # Project root
40   proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
41
42   # Readable test descriptions
43   c.formatter = :documentation
44
45   # Configure all nodes in nodeset
46   c.before :suite do
47     hosts.each do |host|
48       copy_module_to(host, :source => proj_root, :module_name => 'concat')
49     end
50   end
51
52   c.before(:all) do
53     shell('mkdir -p /tmp/concat')
54   end
55   c.after(:all) do
56     shell('rm -rf /tmp/concat /var/lib/puppet/concat')
57   end
58
59   c.treat_symbols_as_metadata_keys_with_true_values = true
60 end
61