Remove if statement for sshd_gssapiauthentication.
This commit is contained in:
parent
9933e7ac27
commit
20bb5118df
@ -428,9 +428,7 @@ class ssh (
|
|||||||
validate_re($ssh_gssapidelegatecredentials, '^(yes|no)$', "ssh::ssh_gssapidelegatecredentials may be either 'yes' or 'no' and is set to <${ssh_gssapidelegatecredentials}>.")
|
validate_re($ssh_gssapidelegatecredentials, '^(yes|no)$', "ssh::ssh_gssapidelegatecredentials may be either 'yes' or 'no' and is set to <${ssh_gssapidelegatecredentials}>.")
|
||||||
}
|
}
|
||||||
|
|
||||||
if $sshd_gssapiauthentication != undef {
|
|
||||||
validate_re($sshd_gssapiauthentication, '^(yes|no)$', "ssh::sshd_gssapiauthentication may be either 'yes' or 'no' and is set to <${sshd_gssapiauthentication}>.")
|
validate_re($sshd_gssapiauthentication, '^(yes|no)$', "ssh::sshd_gssapiauthentication may be either 'yes' or 'no' and is set to <${sshd_gssapiauthentication}>.")
|
||||||
}
|
|
||||||
|
|
||||||
if $sshd_gssapikeyexchange_real != undef {
|
if $sshd_gssapikeyexchange_real != undef {
|
||||||
validate_re($sshd_gssapikeyexchange_real, '^(yes|no)$', "ssh::sshd_gssapikeyexchange may be either 'yes' or 'no' and is set to <${sshd_gssapikeyexchange_real}>.")
|
validate_re($sshd_gssapikeyexchange_real, '^(yes|no)$', "ssh::sshd_gssapikeyexchange may be either 'yes' or 'no' and is set to <${sshd_gssapikeyexchange_real}>.")
|
||||||
|
@ -2295,24 +2295,6 @@ describe 'ssh' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe 'with parameter sshd_gssapiauthentication' do
|
describe 'with parameter sshd_gssapiauthentication' do
|
||||||
['yes','no'].each do |value|
|
|
||||||
context "specified as #{value}" do
|
|
||||||
let(:params) { { :sshd_gssapiauthentication => value } }
|
|
||||||
let(:facts) do
|
|
||||||
{ :fqdn => 'monkey.example.com',
|
|
||||||
:osfamily => 'Solaris',
|
|
||||||
:kernelrelease => '5.11',
|
|
||||||
:sshrsakey => 'AAAAB3NzaC1yc2EAAAABIwAAAQEArGElx46pD6NNnlxVaTbp0ZJMgBKCmbTCT3RaeCk0ZUJtQ8wkcwTtqIXmmiuFsynUT0DFSd8UIodnBOPqitimmooAVAiAi30TtJVzADfPScMiUnBJKZajIBkEMkwUcqsfh630jyBvLPE/kyQcxbEeGtbu1DG3monkeymanOBW1AKc5o+cJLXcInLnbowMG7NXzujT3BRYn/9s5vtT1V9cuZJs4XLRXQ50NluxJI7sVfRPVvQI9EMbTS4AFBXUej3yfgaLSV+nPZC/lmJ2gR4t/tKvMFF9m16f8IcZKK7o0rK7v81G/tREbOT5YhcKLK+0wBfR6RsmHzwy4EddZloyLQ=='
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
it { should contain_file('sshd_config').with_content(/^GSSAPIAuthentication #{value}$/) }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
['YES',true].each do |value|
|
|
||||||
context "specified an invalid value #{value}" do
|
|
||||||
let(:params) { { :sshd_gssapiauthentication => value } }
|
|
||||||
let(:facts) do
|
let(:facts) do
|
||||||
{ :fqdn => 'monkey.example.com',
|
{ :fqdn => 'monkey.example.com',
|
||||||
:osfamily => 'RedHat',
|
:osfamily => 'RedHat',
|
||||||
@ -2320,8 +2302,25 @@ describe 'ssh' do
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should fail' do
|
['yes','no'].each do |value|
|
||||||
expect { should raise_error(Puppet::Error,/^ssh::sshd_gssapiauthentication may be either 'yes' or 'no' and is set to <#{value}>./) }
|
context "specified as valid #{value} (as #{value.class})" do
|
||||||
|
let(:params) { { :sshd_gssapiauthentication => value } }
|
||||||
|
|
||||||
|
it { should contain_file('sshd_config').with_content(/^GSSAPIAuthentication #{value}$/) }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
['YES',true,2.42,['array'],a = { 'ha' => 'sh' }].each do |value|
|
||||||
|
context "specified as invalid value #{value} (as #{value.class})" do
|
||||||
|
let(:params) { { :sshd_gssapiauthentication => value } }
|
||||||
|
if value.is_a?(Array)
|
||||||
|
value = value.join
|
||||||
|
end
|
||||||
|
|
||||||
|
it do
|
||||||
|
expect {
|
||||||
|
should contain_class('ssh')
|
||||||
|
}.to raise_error(Puppet::Error,/^ssh::sshd_gssapiauthentication may be either 'yes' or 'no' and is set to <#{value}>\./)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user