Skip to content

Commit

Permalink
switch to only_if
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Schurz <[email protected]>
  • Loading branch information
schurzi committed Jul 16, 2020
1 parent 5ad1788 commit 893eeb4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions controls/sshd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -508,12 +508,14 @@
impact 1.0
title 'Server: CRYPTO_POLICY'
desc 'Verifies, that we are not running CRYPTO_POLICY and our settings from sshd_config are effective'
if os[:family] == 'redhat' && ::Gem::Version.new(os.release) > ::Gem::Version.new('8')
describe bash("pgrep -af 'sshd -D'") do
its('exit_status') { should eq 0 }
its('stdout') { should_not match('-oCiphers') }
its('stdout') { should_not match('-oKexAlgorithms') }
its('stdout') { should_not match('-oHostKeyAlgorithms') }
end
only_if('OS is RHEL 8+ or compatible') do
os[:family] == 'redhat' && ::Gem::Version.new(os.release) > ::Gem::Version.new('8')
end

describe bash("pgrep -af 'sshd -D'") do
its('exit_status') { should eq 0 }
its('stdout') { should_not match('-oCiphers') }
its('stdout') { should_not match('-oKexAlgorithms') }
its('stdout') { should_not match('-oHostKeyAlgorithms') }
end
end

0 comments on commit 893eeb4

Please sign in to comment.