From 624d58dec6c91cf0b5bbc14f10cf40d4f792ae03 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Tue, 30 Jun 2015 16:50:56 -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: If77faa655f1831a7c9ad2c8d5c42ea712a4b651d 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 a408a523..94f10a89 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