Skip to content

Commit

Permalink
Tests for dev-secGH-131
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-sidorenko committed Dec 23, 2016
1 parent cfd4733 commit 484cd27
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 @@ -248,6 +248,24 @@
end
end

it 'disables the challenge response authentication' do
expect(chef_run).to render_file('/etc/ssh/sshd_config').
with_content(/ChallengeResponseAuthentication no/)
end

context 'with challenge response authentication enabled' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.normal['ssh-hardening']['ssh']['server']['challenge_response_authentication'] = true
end.converge(described_recipe)
end

it 'enables the challenge response authentication' do
expect(chef_run).to render_file('/etc/ssh/sshd_config').
with_content(/ChallengeResponseAuthentication yes/)
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 484cd27

Please sign in to comment.