|
1 | 1 | # frozen_string_literal: true
|
2 | 2 |
|
3 |
| -require 'beaker-rspec/spec_helper' |
4 |
| -require 'beaker-rspec/helpers/serverspec' |
5 |
| -require 'beaker/puppet_install_helper' |
| 3 | +# This file is completely based on voxpupuli/modulesync_config |
| 4 | +require 'voxpupuli/acceptance/spec_helper_acceptance' |
6 | 5 |
|
7 |
| -RSpec.configure do |c| |
8 |
| - # Project root |
9 |
| - proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) |
10 |
| - fixture_modules = File.join(proj_root, 'spec', 'fixtures', 'modules') |
11 |
| - |
12 |
| - # Readable test descriptions |
13 |
| - c.formatter = :documentation |
14 |
| - |
15 |
| - # Configure all nodes in nodeset |
16 |
| - c.before :suite do |
17 |
| - hosts.each do |host| |
18 |
| - run_puppet_install_helper unless ENV.fetch('BEAKER_provision') == 'no' |
19 |
| - |
20 |
| - # Install rsync |
21 |
| - install_package(host, 'rsync') |
22 |
| - |
23 |
| - # A workaround -- this is required for backwards compatibility |
24 |
| - on host, 'mkdir -p /etc/puppet/modules/' |
25 |
| - on host, 'mkdir -p /etc/puppetlabs/code/' |
26 |
| - on host, 'rm -rf /etc/puppetlabs/code/modules' |
27 |
| - on host, 'ln -s /etc/puppet/modules/ /etc/puppetlabs/code/' |
28 |
| - |
29 |
| - # A workaround for systemd-resolved on Ubuntu 18.04. Thanks, systemd. |
30 |
| - if host['platform'] == 'ubuntu-1804-amd64' |
31 |
| - on host, 'systemctl stop systemd-resolved' |
32 |
| - on host, 'echo "nameserver 1.1.1.1" > /etc/resolv.conf' |
33 |
| - end |
34 |
| - |
35 |
| - # Sorry, it's a symlink, PATH doesn't work |
36 |
| - on host, 'ln -s /opt/puppetlabs/bin/puppet /usr/bin/puppet' |
37 |
| - on host, 'puppet --version' |
38 |
| - |
39 |
| - # Synchronise modules |
40 |
| - rsync_to(host, fixture_modules, '/etc/puppet/modules/') |
41 |
| - end |
42 |
| - |
43 |
| - # Install module and dependencies |
44 |
| - puppet_module_install(source: proj_root, module_name: 'powerdns') |
45 |
| - end |
46 |
| -end |
| 6 | +configure_beaker |
0 commit comments