2014-05-07 11:49:25 +02:00
|
|
|
#! /usr/bin/env ruby -S rspec
|
2014-03-12 19:22:23 +01:00
|
|
|
require 'beaker-rspec'
|
|
|
|
|
|
|
|
UNSUPPORTED_PLATFORMS = []
|
|
|
|
|
2014-04-09 23:35:34 +02:00
|
|
|
unless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_provision'] == 'no'
|
2014-05-07 03:48:59 +02:00
|
|
|
if hosts.first.is_pe?
|
|
|
|
install_pe
|
2014-06-24 02:24:08 +02:00
|
|
|
on hosts, 'mkdir -p /etc/puppetlabs/facter/facts.d'
|
2014-05-07 03:48:59 +02:00
|
|
|
else
|
|
|
|
install_puppet
|
|
|
|
on hosts, 'mkdir -p /etc/facter/facts.d'
|
|
|
|
on hosts, '/bin/touch /etc/puppet/hiera.yaml'
|
|
|
|
end
|
2014-03-12 19:22:23 +01:00
|
|
|
hosts.each do |host|
|
2014-05-07 03:48:59 +02:00
|
|
|
on host, "mkdir -p #{host['distmoduledir']}"
|
2014-03-12 19:22:23 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
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
|
2014-06-24 01:59:46 +02:00
|
|
|
hosts.each do |host|
|
|
|
|
if host['platform'] !~ /windows/i
|
|
|
|
copy_root_module_to(host, :source => proj_root, :module_name => 'stdlib')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
hosts.each do |host|
|
|
|
|
if host['platform'] =~ /windows/i
|
|
|
|
on host, puppet('plugin download')
|
|
|
|
end
|
|
|
|
end
|
2014-03-12 19:22:23 +01:00
|
|
|
end
|
|
|
|
end
|