2013-04-15 16:37:58 +02:00
|
|
|
require 'rspec-system/spec_helper'
|
|
|
|
require 'rspec-system-puppet/helpers'
|
|
|
|
|
2013-10-21 15:25:28 +02:00
|
|
|
include RSpecSystemPuppet::Helpers
|
|
|
|
|
2013-04-15 16:37:58 +02:00
|
|
|
RSpec.configure do |c|
|
|
|
|
# Project root for the firewall code
|
|
|
|
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
|
|
|
|
|
|
|
# Enable colour in Jenkins
|
|
|
|
c.tty = true
|
|
|
|
|
2013-10-21 15:25:28 +02:00
|
|
|
# Import puppet helpers
|
|
|
|
c.include RSpecSystemPuppet::Helpers
|
|
|
|
c.extend RSpecSystemPuppet::Helpers
|
2013-04-15 16:37:58 +02:00
|
|
|
|
2013-10-21 15:25:28 +02:00
|
|
|
# This is where we 'setup' the nodes before running our tests
|
|
|
|
c.before :suite do
|
2013-10-27 01:11:02 +02:00
|
|
|
# Time sync
|
2013-10-27 13:56:45 +01:00
|
|
|
if node.facts['osfamily'] == 'Debian' then
|
|
|
|
shell('apt-get install -y ntpdate')
|
|
|
|
elsif node.facts['osfamily'] == 'RedHat' then
|
|
|
|
if node.facts['lsbmajdistrelease'] == '5' then
|
|
|
|
shell('yum install -y ntp')
|
|
|
|
else
|
|
|
|
shell('yum install -y ntpdate')
|
|
|
|
end
|
|
|
|
end
|
2013-10-27 01:11:02 +02:00
|
|
|
shell('ntpdate -u pool.ntp.org')
|
|
|
|
|
2013-04-15 16:37:58 +02:00
|
|
|
# Install puppet
|
|
|
|
puppet_install
|
|
|
|
puppet_master_install
|
|
|
|
|
|
|
|
# Copy this module into the module path of the test node
|
|
|
|
puppet_module_install(:source => proj_root, :module_name => 'puppetdb')
|
|
|
|
end
|
|
|
|
end
|