Files
puppet-openstacklib/spec/spec_helper_acceptance.rb
Colleen Murphy b4f3e89ed9 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: I2cb734defce21ed1709e80bd0f0b0d965b772a9d
2015-07-07 14:58:00 -07:00

38 lines
1.4 KiB
Ruby

require 'beaker-rspec'
require 'beaker/puppet_install_helper'
run_puppet_install_helper
RSpec.configure do |c|
# Project root
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
# Readable test descriptions
c.formatter = :documentation
# Configure all nodes in nodeset
c.before :suite do
# Install module and dependencies
hosts.each do |host|
# install git
install_package host, 'git'
# clean out any module cruft
shell('rm -fr /etc/puppet/modules/*')
# install library modules from the forge
on host, puppet('module','install','puppetlabs-mysql'), { :acceptable_exit_codes => 0 }
on host, puppet('module','install','puppetlabs-rabbitmq'), { :acceptable_exit_codes => 0 }
on host, puppet('module','install','puppetlabs-apache'), { :acceptable_exit_codes => 0 }
on host, puppet('module','install','puppetlabs-postgresql'), { :acceptable_exit_codes => 0 }
on host, puppet('module','install','stahnma-epel'), { :acceptable_exit_codes => 0 }
shell('git clone https://git.openstack.org/openstack/puppet-openstack_extras /etc/puppet/modules/openstack_extras')
# Install the module being tested
puppet_module_install(:source => proj_root, :module_name => 'openstacklib')
# List modules installed to help with debugging
on host, puppet('module','list'), { :acceptable_exit_codes => 0 }
end
end
end