|
15 | 15 | pp = <<-EOS
|
16 | 16 | java_ks { 'puppetca:keystore':
|
17 | 17 | ensure => latest,
|
18 |
| - certificate => "${settings::ssldir}/certs/ca.pem", |
19 |
| - target => '/etc/keystore.ks', |
| 18 | + certificate => "#{@temp_dir}ca.pem", |
| 19 | + target => '#{target}', |
20 | 20 | password => 'puppet',
|
21 | 21 | trustcacerts => true,
|
22 |
| - path => #{resource_path}, |
| 22 | + path => #{@resource_path}, |
23 | 23 | }
|
24 | 24 | EOS
|
25 | 25 |
|
26 | 26 | apply_manifest(pp, :catch_failures => true)
|
| 27 | + apply_manifest(pp, :catch_changes => true) |
27 | 28 | end
|
28 | 29 |
|
29 | 30 | it 'verifies the keystore' do
|
|
53 | 54 | EOS
|
54 | 55 |
|
55 | 56 | apply_manifest(pp, :catch_failures => true)
|
| 57 | + apply_manifest(pp, :catch_changes => true) |
56 | 58 | end
|
57 | 59 | end
|
58 | 60 |
|
|
61 | 63 | pp = <<-EOS
|
62 | 64 | java_ks { 'puppetca:keystore':
|
63 | 65 | ensure => latest,
|
64 |
| - certificate => "${settings::ssldir}/certs/ca.pem", |
65 |
| - target => '/etc/keystore.ks', |
| 66 | + certificate => "#{@temp_dir}ca.pem", |
| 67 | + target => '#{target}', |
66 | 68 | password => 'puppet',
|
67 | 69 | trustcacerts => true,
|
68 |
| - path => #{resource_path}, |
| 70 | + path => #{@resource_path}, |
69 | 71 | storetype => 'jceks',
|
70 | 72 | }
|
71 | 73 | EOS
|
72 | 74 |
|
73 | 75 | 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 |
74 | 86 | end
|
75 | 87 | end
|
76 | 88 |
|
|
0 commit comments