From d6869b436bb021c95d4380ebfd18c465bf4f79e6 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Thu, 13 Apr 2017 22:37:52 +0200 Subject: [PATCH] Fix beaker-rspec tests for centos7 We recently made the epel repository disabled by default, which was where we were installing puppet from. Since the only reason we weren't using the beaker functions to install puppet was because of Xenial, we can just go back to using them for CentOS. Change-Id: Ib3b2b0b69900313643344908bbacaa9bd03ade93 --- spec/spec_helper_acceptance.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index c99e3c3..002ab34 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -4,7 +4,11 @@ hosts.each do |host| # puppet 3 isn't available from apt.puppetlabs.com so install it from the Xenial repos on host, "which apt-get && apt-get install puppet -y", { :acceptable_exit_codes => [0,1] } - on host, "which yum && yum install puppet -y", { :acceptable_exit_codes => [0,1] } + # otherwise use the beaker helpers to install the yum.puppetlabs.com repo and puppet + r = on host, "which yum", { :acceptable_exit_codes => [0,1] } + if r.exit_code == 0 + install_puppet + end add_platform_foss_defaults(host, 'unix') on host, "mkdir -p #{host['distmoduledir']}"