Skip to content

Commit ebbb97c

Browse files
committed
Merge pull request #133 from DavidS/fix-acceptance-tests
Fix acceptance tests
2 parents 6eaacc5 + 956d8e8 commit ebbb97c

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

spec/acceptance/keystore_spec.rb

+18-6
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@
1515
pp = <<-EOS
1616
java_ks { 'puppetca:keystore':
1717
ensure => latest,
18-
certificate => "${settings::ssldir}/certs/ca.pem",
19-
target => '/etc/keystore.ks',
18+
certificate => "#{@temp_dir}ca.pem",
19+
target => '#{target}',
2020
password => 'puppet',
2121
trustcacerts => true,
22-
path => #{resource_path},
22+
path => #{@resource_path},
2323
}
2424
EOS
2525

2626
apply_manifest(pp, :catch_failures => true)
27+
apply_manifest(pp, :catch_changes => true)
2728
end
2829

2930
it 'verifies the keystore' do
@@ -53,6 +54,7 @@
5354
EOS
5455

5556
apply_manifest(pp, :catch_failures => true)
57+
apply_manifest(pp, :catch_changes => true)
5658
end
5759
end
5860

@@ -61,16 +63,26 @@
6163
pp = <<-EOS
6264
java_ks { 'puppetca:keystore':
6365
ensure => latest,
64-
certificate => "${settings::ssldir}/certs/ca.pem",
65-
target => '/etc/keystore.ks',
66+
certificate => "#{@temp_dir}ca.pem",
67+
target => '#{target}',
6668
password => 'puppet',
6769
trustcacerts => true,
68-
path => #{resource_path},
70+
path => #{@resource_path},
6971
storetype => 'jceks',
7072
}
7173
EOS
7274

7375
apply_manifest(pp, :catch_failures => true)
76+
apply_manifest(pp, :catch_changes => true)
77+
end
78+
79+
it 'verifies the keystore' do
80+
shell("#{@keytool_path}keytool -list -v -keystore #{target} -storepass puppet") do |r|
81+
expect(r.exit_code).to be_zero
82+
expect(r.stdout).to match(/Your keystore contains 2 entries/)
83+
expect(r.stdout).to match(/Alias name: puppetca/)
84+
expect(r.stdout).to match(/CN=Test CA/)
85+
end
7486
end
7587
end
7688

0 commit comments

Comments
 (0)