-
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.
Drop apache username/password (#168)
- Loading branch information
Showing
2 changed files
with
41 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'certs::apache' 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 parameters' do | ||
let(:pp) do | ||
'include ::certs::apache' | ||
end | ||
|
||
it_behaves_like 'a idempotent resource' | ||
|
||
describe x509_certificate('/etc/pki/katello/certs/katello-apache.crt') do | ||
it { should be_certificate } | ||
it { should be_valid } | ||
it { should have_purpose 'server' } | ||
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/O=Katello/OU=SomeOrgUnit/CN=#{fact('fqdn')}" } | ||
its(:keylength) { should be >= 2048 } | ||
end | ||
|
||
describe x509_private_key('/etc/pki/katello/private/katello-apache.key') do | ||
it { should_not be_encrypted } | ||
it { should be_valid } | ||
it { should have_matching_certificate('/etc/pki/katello/certs/katello-apache.crt') } | ||
end | ||
end | ||
end |