Skip to content

Commit

Permalink
Work with fang64 on spec tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ghoneycutt committed Sep 3, 2015
1 parent e649f71 commit 4ea08a5
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1309,29 +1309,38 @@
end
end

describe 'with KerberosAuthentication' do
describe 'with sshd_kerberos_authentication' do
['yes','no'].each do |value|
context "set to #{value}" do
set param to value
it { should contain_file('sshd_config').with_content(/^KerberosAuthentication #{value}$/) }
end
context 'with KerberosAuthentication set to invalid value on valid osfamily' do
let :facts do
{
:fqdn => 'monkey.example.com',
:osfamily => 'RedHat',
:sshrsakey => 'AAAAB3NzaC1yc2EAAAABIwAAAQEArGElx46pD6NNnlxVaTbp0ZJMgBKCmbTCT3RaeCk0ZUJtQ8wkcwTtqIXmmiuFsynUT0DFSd8UIodnBOPqitimmooAVAiAi30TtJVzADfPScMiUnBJKZajIBkEMkwUcqsfh630jyBvLPE/kyQcxbEeGtbu1DG3monkeymanOBW1AKc5o+cJLXcInLnbowMG7NXzujT3BRYn/9s5vtT1V9cuZJs4XLRXQ50NluxJI7sVfRPVvQI9EMbTS4AFBXUej3yfgaLSV+nPZC/lmJ2gR4t/tKvMFF9m16f8IcZKK7o0rK7v81G/tREbOT5YhcKLK+0wBfR6RsmHzwy4EddZloyLQ=='
}
end
let :params do
{ :sshd_kerberos_authentication => 'invalid' }
end
let (:params) {{ 'sshd_kerberos_authentication' => value }}

it 'should fail' do
expect {
should contain_class('ssh')
}.to raise_error(Puppet::Error,/ssh::sshd_kerberos_authentication may be either \'yes\' or \'no\' and is set to <invalid>\./)
end
it { should contain_file('sshd_config').with_content(/^KerberosAuthentication #{value}$/) }
end
end

context 'set to invalid value on valid osfamily' do
let :facts do
{
:fqdn => 'monkey.example.com',
:osfamily => 'RedHat',
:sshrsakey => 'AAAAB3NzaC1yc2EAAAABIwAAAQEArGElx46pD6NNnlxVaTbp0ZJMgBKCmbTCT3RaeCk0ZUJtQ8wkcwTtqIXmmiuFsynUT0DFSd8UIodnBOPqitimmooAVAiAi30TtJVzADfPScMiUnBJKZajIBkEMkwUcqsfh630jyBvLPE/kyQcxbEeGtbu1DG3monkeymanOBW1AKc5o+cJLXcInLnbowMG7NXzujT3BRYn/9s5vtT1V9cuZJs4XLRXQ50NluxJI7sVfRPVvQI9EMbTS4AFBXUej3yfgaLSV+nPZC/lmJ2gR4t/tKvMFF9m16f8IcZKK7o0rK7v81G/tREbOT5YhcKLK+0wBfR6RsmHzwy4EddZloyLQ=='
}
end
let :params do
{ :sshd_kerberos_authentication => 'invalid' }
end

it 'should fail' do
expect {
should contain_class('ssh')
}.to raise_error(Puppet::Error,/ssh::sshd_kerberos_authentication may be either \'yes\' or \'no\' and is set to <invalid>\./)
end
end
end
Expand Down

0 comments on commit 4ea08a5

Please sign in to comment.