From 646a6cd15f2c358c6fde25dbb795615f45913d96 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Tue, 30 Jun 2015 16:51:46 -0400 Subject: [PATCH] Use beaker-puppet_install_helper to install puppet When running with BEAKER_provision=no, the following happens: In Trusty: beaker is running dpkg with '--force' option so even if Puppet is already installed, the return code will be 0. In CentOS: beaker is running 'rpm -ivh' the second time and since the package is already here, the return code will be 1. Using the new puppet install helper will abort installing puppet if BEAKER_provision is no, so tests will continue as normal. Change-Id: I410ebcc23bdc27ae0e632d1f330cab374cbc8912 Co-Authored-By: Colleen Murphy --- Gemfile | 1 + spec/spec_helper_acceptance.rb | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 3c0b8753..9ea21133 100644 --- a/Gemfile +++ b/Gemfile @@ -17,6 +17,7 @@ group :development, :test do gem 'puppet-lint-numericvariable' gem 'beaker-rspec', :require => false + gem 'beaker-puppet_install_helper', :require => false gem 'json' gem 'webmock' end diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 7f12a155..386d612f 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -1,11 +1,7 @@ require 'beaker-rspec' +require 'beaker/puppet_install_helper' -hosts.each do |host| - - install_puppet - - on host, "mkdir -p #{host['distmoduledir']}" -end +run_puppet_install_helper RSpec.configure do |c| # Project root