Skip to content

Commit 205f3b7

Browse files
committed
Only copy fixture certificates in the spec helper
1 parent 2b9f043 commit 205f3b7

File tree

4 files changed

+8
-24
lines changed

4 files changed

+8
-24
lines changed

spec/acceptance/apache_spec.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@
5252

5353
context 'with server cert' do
5454
before(:context) do
55-
['crt', 'key'].each do |ext|
56-
source_path = "fixtures/example.partial.solutions.#{ext}"
57-
dest_path = "/server.#{ext}"
58-
scp_to(hosts, source_path, dest_path)
59-
end
60-
6155
# Force regen
6256
on hosts, "if [ -e /root/ssl-build/#{fact('fqdn')} ] ; then touch /root/ssl-build/#{fact('fqdn')}/#{fact('fqdn')}-apache.update ; fi"
6357
end
@@ -134,12 +128,6 @@ class { 'certs::apache':
134128

135129
context 'with custom certificates fresh' do
136130
before(:context) do
137-
['crt', 'key'].each do |ext|
138-
source_path = "fixtures/example.partial.solutions.#{ext}"
139-
dest_path = "/server.#{ext}"
140-
scp_to(hosts, source_path, dest_path)
141-
end
142-
143131
on hosts, 'rm -rf /root/ssl-build'
144132
end
145133

spec/acceptance/certs_spec.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,6 @@ class { 'certs':
126126
end
127127

128128
context 'with server CA cert' do
129-
before(:context) do
130-
source_path = "fixtures/example.partial.solutions-chain.pem"
131-
dest_path = "/server-ca.crt"
132-
scp_to(hosts, source_path, dest_path)
133-
end
134-
135129
it_behaves_like 'an idempotent resource' do
136130
let(:manifest) do
137131
<<-PUPPET

spec/acceptance/foreman_proxy_spec.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,6 @@
164164

165165
context 'with custom certificates fresh' do
166166
before(:context) do
167-
['crt', 'key'].each do |ext|
168-
source_path = "fixtures/example.partial.solutions.#{ext}"
169-
dest_path = "/server.#{ext}"
170-
scp_to(hosts, source_path, dest_path)
171-
end
172-
173167
on hosts, 'rm -rf /root/ssl-build'
174168
end
175169

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
certs = {
2+
'fixtures/example.partial.solutions.crt' => '/server.crt',
3+
'fixtures/example.partial.solutions.key' => '/server.key',
4+
'fixtures/example.partial.solutions-chain.pem' => '/server-ca.crt',
5+
}
6+
certs.each do |source_path, dest_path|
7+
scp_to(hosts, source_path, dest_path)
8+
end

0 commit comments

Comments
 (0)