Skip to content

Commit 1315a33

Browse files
Travis Fieldsbmjen
Travis Fields
authored andcommitted
(maint) Add beaker-puppet_install_helper and fix fact bug
- Issue with fact() was being called against default instead of using fact_on when iterating against each host, also was installing 3.8.1 despite specifying PUPPET_VERSION=1.1.1 so updated to use beaker-puppet_install_helper
1 parent ad3e042 commit 1315a33

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed

Diff for: Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ group :system_tests do
2828
gem 'beaker-rspec', :require => false
2929
end
3030
gem 'serverspec', :require => false
31+
gem 'beaker-puppet_install_helper', :require => false
3132
end
3233

3334

Diff for: spec/spec_helper_acceptance.rb

+6-22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
require 'beaker-rspec/spec_helper'
22
require 'beaker-rspec/helpers/serverspec'
3+
require 'beaker/puppet_install_helper'
4+
5+
run_puppet_install_helper
6+
7+
UNSUPPORTED_PLATFORMS = ['AIX','windows','Solaris','Suse']
38

49
class String
510
# 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)
3439
shell("su #{shellescape(user)} -c #{shellescape(psql)}", :acceptable_exit_codes => exit_codes, &block)
3540
end
3641

37-
unless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_provision'] == 'no'
38-
# This will install the latest available package on el and deb based
39-
# systems fail on windows and osx, and install via gem on other *nixes
40-
foss_opts = { :default_action => 'gem_install' }
41-
42-
if default.is_pe?; then install_pe; else install_puppet( foss_opts ); end
43-
44-
hosts.each do |host|
45-
shell("mkdir -p #{host['distmoduledir']}")
46-
if ! host.is_pe?
47-
# Augeas is only used in one place, for Redhat.
48-
if fact('osfamily') == 'RedHat'
49-
install_package host, 'ruby-devel'
50-
#install_package host, 'augeas-devel'
51-
#install_package host, 'ruby-augeas'
52-
end
53-
end
54-
end
55-
end
56-
57-
UNSUPPORTED_PLATFORMS = ['AIX','windows','Solaris','Suse']
5842

5943
RSpec.configure do |c|
6044
# Project root
@@ -92,7 +76,7 @@ def psql(psql_cmd, user = 'postgres', exit_codes = [0,1], &block)
9276
hosts.each do |host|
9377
on host, "/bin/touch #{default['puppetpath']}/hiera.yaml"
9478
on host, 'chmod 755 /root'
95-
if fact('osfamily') == 'Debian'
79+
if fact_on(host, 'osfamily') == 'Debian'
9680
on host, "echo \"en_US ISO-8859-1\nen_NG.UTF-8 UTF-8\nen_US.UTF-8 UTF-8\n\" > /etc/locale.gen"
9781
on host, '/usr/sbin/locale-gen'
9882
on host, '/usr/sbin/update-locale'

0 commit comments

Comments
 (0)