forked from voxpupuli/puppet-confluence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspec_helper_acceptance.rb
46 lines (41 loc) · 1.74 KB
/
spec_helper_acceptance.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require 'beaker-rspec/spec_helper'
require 'beaker-rspec/helpers/serverspec'
unless ENV['RS_PROVISION'] == 'no' || ENV['BEAKER_provision'] == 'no'
hosts.each do |host|
foss_opts = { default_action: 'gem_install' }
install_puppet(foss_opts)
on host, "mkdir -p #{host['distmoduledir']}"
on host, "sed -i '/templatedir/d' #{host['puppetpath']}/puppet.conf"
end
end
UNSUPPORTED_PLATFORMS = %w[AIX windows Solaris].freeze
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
puppet_module_install(
source: proj_root,
module_name: 'confluence',
ignore_list: %w[spec/fixtures/* .git/* .vagrant/*]
)
hosts.each do |host|
on host, "/bin/touch #{default['puppetpath']}/hiera.yaml"
on host, 'chmod 755 /root'
if fact('osfamily') == 'Debian'
on host, "echo \"en_US ISO-8859-1\nen_NG.UTF-8 UTF-8\nen_US.UTF-8 UTF-8\n\" > /etc/locale.gen"
on host, '/usr/sbin/locale-gen'
on host, '/usr/sbin/update-locale'
end
on host, puppet('module', 'install', 'puppet-archive'), acceptable_exit_codes: [0, 1]
on host, puppet('module', 'install', 'puppetlabs-java'), acceptable_exit_codes: [0, 1]
on host, puppet('module', 'install', 'puppetlabs-postgresql'), acceptable_exit_codes: [0, 1]
on host, puppet('module', 'install', 'puppet-staging'), acceptable_exit_codes: [0, 1]
on host, puppet('module', 'install', 'puppetlabs-stdlib'), acceptable_exit_codes: [0, 1]
on host, puppet('module', 'install', 'camptocamp-systemd'), acceptable_exit_codes: [0, 1]
end
end
end