client spec

This commit is contained in:
Tomas Barton 2014-01-26 11:33:41 +01:00
parent 550e78a4e6
commit 5ce0dcda97
2 changed files with 46 additions and 3 deletions

View file

@ -1,9 +1,10 @@
class sshd::client::base {
# this is needed because the gid might have changed
file { '/etc/ssh/ssh_known_hosts':
mode => '0644',
owner => root,
group => 0;
ensure => present,
mode => '0644',
owner => root,
group => 0;
}
# Now collect all server keys

View file

@ -0,0 +1,42 @@
require 'spec_helper'
describe 'sshd::client' do
shared_examples "a Linux OS" do
it { should contain_file('/etc/ssh/ssh_known_hosts').with(
{
'ensure' => 'present',
'owner' => 'root',
'group' => '0',
'mode' => '0644',
}
)}
end
context "Debian OS" do
let :facts do
{
:operatingsystem => 'Debian',
:osfamily => 'Debian',
:lsbdistcodename => 'wheezy',
}
end
it_behaves_like "a Linux OS"
it { should contain_package('openssh-clients').with({
'name' => 'openssh-client'
}) }
end
context "CentOS" do
it_behaves_like "a Linux OS" do
let :facts do
{
:operatingsystem => 'CentOS',
:osfamily => 'RedHat',
:lsbdistcodename => 'Final',
}
end
end
end
end