client_spec.rb 853 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. require 'spec_helper'
  2. describe 'sshd::client' do
  3. shared_examples "a Linux OS" do
  4. it { should contain_file('/etc/ssh/ssh_known_hosts').with(
  5. {
  6. 'ensure' => 'present',
  7. 'owner' => 'root',
  8. 'group' => '0',
  9. 'mode' => '0644',
  10. }
  11. )}
  12. end
  13. context "Debian OS" do
  14. let :facts do
  15. {
  16. :operatingsystem => 'Debian',
  17. :osfamily => 'Debian',
  18. :lsbdistcodename => 'wheezy',
  19. }
  20. end
  21. it_behaves_like "a Linux OS"
  22. it { should contain_package('openssh-clients').with({
  23. 'name' => 'openssh-client'
  24. }) }
  25. end
  26. context "CentOS" do
  27. it_behaves_like "a Linux OS" do
  28. let :facts do
  29. {
  30. :operatingsystem => 'CentOS',
  31. :osfamily => 'RedHat',
  32. :lsbdistcodename => 'Final',
  33. }
  34. end
  35. end
  36. end
  37. end