Skip to content

Commit 001f3ae

Browse files
author
Ashley Penney
committed
Fix the spec helper to apply selinux to agents only.
1 parent 2816454 commit 001f3ae

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

spec/spec_helper_acceptance.rb

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,23 @@ def psql(psql_cmd, user = 'postgres', exit_codes = [0,1], &block)
5151
#install_package host, 'ruby-augeas'
5252
end
5353
end
54+
end
55+
end
56+
57+
UNSUPPORTED_PLATFORMS = ['AIX','windows','Solaris','Suse']
58+
59+
RSpec.configure do |c|
60+
# Project root
61+
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
62+
63+
# Readable test descriptions
64+
c.formatter = :documentation
65+
66+
# Configure all nodes in nodeset
67+
c.before :suite do
68+
# Install module and dependencies
69+
puppet_module_install(:source => proj_root, :module_name => 'postgresql')
70+
5471
# Set up selinux if appropriate.
5572
if fact('osfamily') == 'RedHat' && fact('selinux') == 'true'
5673
pp = <<-EOS
@@ -69,24 +86,9 @@ def psql(psql_cmd, user = 'postgres', exit_codes = [0,1], &block)
6986
}
7087
EOS
7188

72-
apply_manifest(pp, :catch_failures => true)
89+
apply_manifest_on(agents, pp, :catch_failures => true)
7390
end
74-
end
75-
end
76-
77-
UNSUPPORTED_PLATFORMS = ['AIX','windows','Solaris','Suse']
78-
79-
RSpec.configure do |c|
80-
# Project root
81-
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
82-
83-
# Readable test descriptions
84-
c.formatter = :documentation
8591

86-
# Configure all nodes in nodeset
87-
c.before :suite do
88-
# Install module and dependencies
89-
puppet_module_install(:source => proj_root, :module_name => 'postgresql')
9092
hosts.each do |host|
9193
on host, "/bin/touch #{default['puppetpath']}/hiera.yaml"
9294
on host, 'chmod 755 /root'

0 commit comments

Comments
 (0)