Skip to content

Commit 047ad09

Browse files
committed
Add more tests to certs::candlepin
1 parent b30e456 commit 047ad09

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

spec/classes/certs_candlepin_spec.rb

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,34 @@
88
end
99

1010
describe 'with default parameters' do
11-
it { should compile.with_all_deps }
11+
it { is_expected.to compile.with_all_deps }
12+
13+
it { is_expected.to contain_certs__keypair('candlepin-ca') }
14+
it { is_expected.to contain_pubkey('/etc/candlepin/certs/candlepin-ca.crt').that_comes_before('File[/etc/candlepin/certs/candlepin-ca.crt]') }
15+
it { is_expected.to contain_file('/etc/candlepin/certs/candlepin-ca.crt') }
16+
it { is_expected.to contain_privkey('/etc/candlepin/certs/candlepin-ca.key').that_comes_before('File[/etc/candlepin/certs/candlepin-ca.key]') }
17+
it { is_expected.to contain_file('/etc/candlepin/certs/candlepin-ca.key') }
18+
19+
it { is_expected.to contain_certs__keypair('tomcat') }
20+
it { is_expected.to contain_cert('foo.example.com-tomcat').with_ca('Ca[katello-default-ca]') }
21+
it { is_expected.to contain_privkey('/etc/pki/katello/private/katello-tomcat.key') }
22+
it { is_expected.to contain_pubkey('/etc/pki/katello/certs/katello-tomcat.crt') }
23+
24+
it { is_expected.to contain_certs__keypair('candlepin') }
25+
it { is_expected.to contain_cert('java-client').with_ca('Ca[katello-default-ca]') }
26+
it { is_expected.to contain_pubkey('/etc/pki/katello/certs/java-client.crt').that_comes_before('File[/etc/pki/katello/certs/java-client.crt]') }
27+
it { is_expected.to contain_file('/etc/pki/katello/certs/java-client.crt') }
28+
it { is_expected.to contain_privkey('/etc/pki/katello/private/java-client.key').that_comes_before('File[/etc/pki/katello/private/java-client.key]') }
29+
it { is_expected.to contain_file('/etc/pki/katello/private/java-client.key') }
30+
31+
it { is_expected.to contain_file('/etc/candlepin/certs/keystore') }
32+
it { is_expected.to contain_file('/etc/pki/katello/keystore_password-file') }
33+
it { is_expected.to contain_exec('candlepin-generate-ssl-keystore').that_notifies('File[/etc/candlepin/certs/keystore]') }
34+
35+
it { is_expected.to contain_file('/etc/candlepin/certs/truststore') }
36+
it { is_expected.to contain_file('/etc/pki/katello/truststore_password-file') }
37+
it { is_expected.to contain_exec('Create Candlepin truststore with CA').that_notifies('File[/etc/candlepin/certs/truststore]') }
38+
it { is_expected.to contain_exec('import client certificate into Candlepin truststore').that_subscribes_to('File[/etc/candlepin/certs/truststore]') }
1239
end
1340
end
1441
end

0 commit comments

Comments
 (0)