Skip to content

Commit

Permalink
Expanded test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock committed Oct 20, 2018
1 parent a0c0b60 commit f868bf8
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions spec/acceptance/00_pam_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@
it { should be_installed }
end

describe file('/etc/pam.d/login') do
it { should be_file }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
it { should be_mode 644 }
if fact('osfamily') == 'RedHat'
its(:content) { should match /^account\s+required\s+pam_access.so$/ }
end
end

describe file('/etc/pam.d/sshd') do
it { should be_file }
it { should be_owned_by 'root' }
Expand All @@ -45,6 +55,32 @@
it { should be_mode 640 }
its(:content) { should match /^$|^#/ }
end

if fact('osfamily') == 'RedHat'
['password-auth','system-auth'].each do |f|
describe file("/etc/pam.d/#{f}-ac") do
it { should be_file }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
it { should be_mode 644 }
end
describe file("/etc/pam.d/#{f}") do
it { should be_symlink }
it { should be_linked_to "/etc/pam.d/#{f}-ac" }
end
end
end

if fact('osfamily') == 'Debian'
['auth', 'account', 'password', 'session', 'session_noninteractive' ].each do |f|
describe file("/etc/pam.d/pam_common_#{f}") do
it { should be_file }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
it { should be_mode 644 }
end
end
end
end
end

0 comments on commit f868bf8

Please sign in to comment.