Skip to content

Commit eb6bc9b

Browse files
committed
spec_helper_acceptance.rb: Switch to Vox Pupuli defaults
1 parent f88f571 commit eb6bc9b

File tree

1 file changed

+9
-47
lines changed

1 file changed

+9
-47
lines changed

Diff for: spec/spec_helper_acceptance.rb

+9-47
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,12 @@
1-
require 'beaker-rspec'
2-
require 'beaker/puppet_install_helper'
1+
# frozen_string_literal: true
32

4-
# Install Puppet on all hosts
5-
install_puppet_agent_on(hosts, puppet_collection: 'puppet5')
3+
require 'voxpupuli/acceptance/spec_helper_acceptance'
64

7-
RSpec.configure do |c|
8-
module_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
9-
10-
c.formatter = :documentation
11-
12-
c.before :suite do
13-
# Install module to all hosts
14-
hosts.each do |host|
15-
install_dev_puppet_module_on(host, source: module_root, module_name: 'icingaweb2',
16-
target_module_path: '/etc/puppetlabs/code/modules')
17-
18-
# Install dependencies
19-
on(host, puppet('module', 'install', 'puppetlabs-stdlib'))
20-
on(host, puppet('module', 'install', 'puppetlabs-concat'))
21-
on(host, puppet('module', 'install', 'puppetlabs-vcsrepo'))
22-
23-
# Install additional modules
24-
on(host, puppet('module', 'install', 'puppetlabs-mysql'))
25-
on(host, puppet('module', 'install', 'puppetlabs-postgresql'))
26-
on(host, puppet('module', 'install', 'puppetlabs-apache'))
27-
on(host, puppet('module', 'install', 'puppet-php'))
28-
29-
if fact('osfamily') == 'Debian'
30-
on(host, puppet('module', 'install', 'puppetlabs-apt'))
31-
end
32-
33-
if fact('osfamily') == 'Suse'
34-
on(host, puppet('module', 'install', 'puppet-zypprepo'))
35-
end
36-
37-
# Add more setup code as needed
38-
end
39-
end
40-
end
41-
42-
shared_examples 'a idempotent resource' do
43-
it 'applies with no errors' do
44-
apply_manifest(pp, catch_failures: true)
45-
end
46-
47-
it 'applies a second time without changes', :skip_pup_5016 do
48-
apply_manifest(pp, catch_changes: true)
49-
end
5+
configure_beaker do |host|
6+
install_puppet_module_via_pmt_on(host, 'puppetlabs-mysql')
7+
install_puppet_module_via_pmt_on(host, 'puppetlabs-postgresql')
8+
install_puppet_module_via_pmt_on(host, 'puppetlabs-apache')
9+
install_puppet_module_via_pmt_on(host, 'puppet-php')
10+
install_puppet_module_via_pmt_on(host, 'puppetlabs-apt')
11+
install_puppet_module_via_pmt_on(host, 'puppet-zypprepo')
5012
end

0 commit comments

Comments
 (0)