-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'certs with default params' do | ||
before(:all) do | ||
install_repo = <<-EOS | ||
yumrepo { 'katello': | ||
descr => 'Katello latest', | ||
baseurl => 'https://fedorapeople.org/groups/katello/releases/yum/latest/katello/el7/$basearch/', | ||
gpgcheck => false, | ||
enabled => true, | ||
} | ||
EOS | ||
|
||
apply_manifest(install_repo) | ||
end | ||
|
||
context 'with default params' do | ||
let(:pp) do | ||
'include ::certs' | ||
end | ||
|
||
it_behaves_like 'a idempotent resource' | ||
|
||
describe package('katello-certs-tools') do | ||
it { is_expected.to be_installed } | ||
end | ||
|
||
describe x509_certificate('/etc/pki/katello-certs-tools/certs/katello-default-ca.crt') do | ||
it { should be_certificate } | ||
it { should be_valid } | ||
it { should have_purpose 'SSL server CA' } | ||
its(:issuer) { should eq "/C=US/ST=North Carolina/L=Raleigh/O=Katello/OU=SomeOrgUnit/CN=#{fact('fqdn')}" } | ||
its(:subject) { should eq "/C=US/ST=North Carolina/L=Raleigh/O=Katello/OU=SomeOrgUnit/CN=#{fact('fqdn')}" } | ||
end | ||
|
||
describe x509_certificate('/etc/pki/katello-certs-tools/certs/katello-server-ca.crt') do | ||
it { should be_certificate } | ||
it { should be_valid } | ||
it { should have_purpose 'SSL server CA' } | ||
its(:issuer) { should eq "/C=US/ST=North Carolina/L=Raleigh/O=Katello/OU=SomeOrgUnit/CN=#{fact('fqdn')}" } | ||
its(:subject) { should eq "/C=US/ST=North Carolina/L=Raleigh/O=Katello/OU=SomeOrgUnit/CN=#{fact('fqdn')}" } | ||
end | ||
end | ||
end |