Skip to content

Commit

Permalink
Refs #32947 - add tests for the Debian keytab path
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Jul 9, 2021
1 parent 91d6b57 commit f9cafdc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spec/classes/foreman_config_ipa_spec.rb
Expand Up @@ -2,10 +2,12 @@

describe 'foreman' do
on_supported_os.each do |os, facts|
context "on #{os}", if: facts[:osfamily] == 'RedHat' do
context "on #{os}" do
let(:facts) { facts.merge(interfaces: '') }
let(:params) { { ipa_authentication: true } }

keytab_path = facts[:osfamily] == 'RedHat' ? '/etc/httpd/conf/http.keytab' : '/etc/apache2/http.keytab'

describe 'without apache' do
let(:params) { super().merge(apache: false) }
it { should raise_error(Puppet::Error, /External authentication via IPA can only be enabled when Apache is used/) }
Expand Down Expand Up @@ -50,7 +52,7 @@
should contain_foreman__config__apache__fragment('lookup_identity')

should contain_foreman__config__apache__fragment('auth_gssapi')
.with_ssl_content(%r{^\s*GssapiCredStore keytab:/etc/httpd/conf/http.keytab$})
.with_ssl_content(%r{^\s*GssapiCredStore keytab:#{keytab_path}$})
.with_ssl_content(/^\s*require pam-account foreman$/)
end

Expand Down

0 comments on commit f9cafdc

Please sign in to comment.