1 require 'beaker-rspec/spec_helper'
2 require 'beaker-rspec/helpers/serverspec'
5 unless ENV['RS_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' }
10 if default.is_pe?; then install_pe; else install_puppet( foss_opts ); end
13 if host['platform'] =~ /debian/
14 on host, 'echo \'export PATH=/var/lib/gems/1.8/bin/:${PATH}\' >> ~/.bashrc'
17 on host, "mkdir -p #{host['distmoduledir']}"
21 UNSUPPORTED_PLATFORMS = ['Suse','windows','AIX','Solaris']
23 RSpec.configure do |c|
25 proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
27 # Readable test descriptions
28 c.formatter = :documentation
30 # Configure all nodes in nodeset
32 # Install module and dependencies
34 copy_module_to(host, :source => proj_root, :module_name => 'apache')
35 # Required for mod_passenger tests.
36 if fact('osfamily') == 'RedHat'
37 on host, puppet('module','install','stahnma/epel'), { :acceptable_exit_codes => [0,1] }
39 # Required for manifest to make mod_pagespeed repository available
40 if fact('osfamily') == 'Debian'
41 on host, puppet('module','install','puppetlabs-apt', '--version 1.8.0', '--force'), { :acceptable_exit_codes => [0,1] }
43 on host, puppet('module','install','puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }
44 on host, puppet('module','install','puppetlabs-concat', '--version 1.1.1', '--force'), { :acceptable_exit_codes => [0,1] }
46 # Make sure selinux is disabled before each test or apache won't work.
47 if ! UNSUPPORTED_PLATFORMS.include?(fact('osfamily'))
48 on host, puppet('apply', '-e',
49 %{"exec { 'setenforce 0': path => '/bin:/sbin:/usr/bin:/usr/sbin', onlyif => 'which setenforce && getenforce | grep Enforcing', }"}),
50 { :acceptable_exit_codes => [0] }