Skip to content

Commit

Permalink
Tests for dev-secGH-130
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-sidorenko committed Dec 22, 2016
1 parent d2a96ae commit 2a8d483
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/recipes/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,24 @@
end
end

it 'disables the login banner' do
expect(chef_run).to render_file('/etc/ssh/sshd_config').
with_content(/Banner none/)
end

context 'with provided login banner path' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.normal['ssh-hardening']['ssh']['banner'] = '/etc/ssh/banner'
end.converge(described_recipe)
end

it 'uses the given login banner' do
expect(chef_run).to render_file('/etc/ssh/sshd_config').
with_content(%r{Banner /etc/ssh/banner})
end
end

it 'leaves deny users commented' do
expect(chef_run).to render_file('/etc/ssh/sshd_config').
with_content(/#DenyUsers */)
Expand Down

0 comments on commit 2a8d483

Please sign in to comment.