Skip to content

Commit 9ebc9de

Browse files
Tests for GH-132
1 parent 484cd27 commit 9ebc9de

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

spec/recipes/server_spec.rb

+18
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,24 @@
266266
end
267267
end
268268

269+
it 'sets the login grace time to 30s' do
270+
expect(chef_run).to render_file('/etc/ssh/sshd_config').
271+
with_content(/LoginGraceTime 30s/)
272+
end
273+
274+
context 'with configured login grace time to 60s' do
275+
cached(:chef_run) do
276+
ChefSpec::ServerRunner.new do |node|
277+
node.normal['ssh-hardening']['ssh']['server']['login_grace_time'] = '60s'
278+
end.converge(described_recipe)
279+
end
280+
281+
it 'sets the login grace time to 60s' do
282+
expect(chef_run).to render_file('/etc/ssh/sshd_config').
283+
with_content(/LoginGraceTime 60s/)
284+
end
285+
end
286+
269287
it 'leaves deny users commented' do
270288
expect(chef_run).to render_file('/etc/ssh/sshd_config').
271289
with_content(/#DenyUsers */)

0 commit comments

Comments
 (0)