diff --git a/Gemfile b/Gemfile index 2b1b7cd..bfe64b1 100644 --- a/Gemfile +++ b/Gemfile @@ -28,6 +28,7 @@ group :system_tests do gem 'beaker-rspec', :require => false end gem 'serverspec', :require => false + gem 'beaker-puppet_install_helper', :require => false end diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 882e21b..30b2058 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -1,5 +1,10 @@ require 'beaker-rspec/spec_helper' require 'beaker-rspec/helpers/serverspec' +require 'beaker/puppet_install_helper' + +run_puppet_install_helper + +UNSUPPORTED_PLATFORMS = ['AIX','windows','Solaris','Suse'] class String # Provide ability to remove indentation from strings, for the purpose of @@ -34,27 +39,6 @@ def psql(psql_cmd, user = 'postgres', exit_codes = [0,1], &block) shell("su #{shellescape(user)} -c #{shellescape(psql)}", :acceptable_exit_codes => exit_codes, &block) end -unless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_provision'] == 'no' - # This will install the latest available package on el and deb based - # systems fail on windows and osx, and install via gem on other *nixes - foss_opts = { :default_action => 'gem_install' } - - if default.is_pe?; then install_pe; else install_puppet( foss_opts ); end - - hosts.each do |host| - shell("mkdir -p #{host['distmoduledir']}") - if ! host.is_pe? - # Augeas is only used in one place, for Redhat. - if fact('osfamily') == 'RedHat' - install_package host, 'ruby-devel' - #install_package host, 'augeas-devel' - #install_package host, 'ruby-augeas' - end - end - end -end - -UNSUPPORTED_PLATFORMS = ['AIX','windows','Solaris','Suse'] RSpec.configure do |c| # Project root @@ -92,7 +76,7 @@ RSpec.configure do |c| hosts.each do |host| on host, "/bin/touch #{default['puppetpath']}/hiera.yaml" on host, 'chmod 755 /root' - if fact('osfamily') == 'Debian' + if fact_on(host, 'osfamily') == 'Debian' on host, "echo \"en_US ISO-8859-1\nen_NG.UTF-8 UTF-8\nen_US.UTF-8 UTF-8\n\" > /etc/locale.gen" on host, '/usr/sbin/locale-gen' on host, '/usr/sbin/update-locale'