Skip to content

Commit 893eeb4

Browse files
committed
switch to only_if
Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com>
1 parent 5ad1788 commit 893eeb4

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

controls/sshd_spec.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -508,12 +508,14 @@
508508
impact 1.0
509509
title 'Server: CRYPTO_POLICY'
510510
desc 'Verifies, that we are not running CRYPTO_POLICY and our settings from sshd_config are effective'
511-
if os[:family] == 'redhat' && ::Gem::Version.new(os.release) > ::Gem::Version.new('8')
512-
describe bash("pgrep -af 'sshd -D'") do
513-
its('exit_status') { should eq 0 }
514-
its('stdout') { should_not match('-oCiphers') }
515-
its('stdout') { should_not match('-oKexAlgorithms') }
516-
its('stdout') { should_not match('-oHostKeyAlgorithms') }
517-
end
511+
only_if('OS is RHEL 8+ or compatible') do
512+
os[:family] == 'redhat' && ::Gem::Version.new(os.release) > ::Gem::Version.new('8')
513+
end
514+
515+
describe bash("pgrep -af 'sshd -D'") do
516+
its('exit_status') { should eq 0 }
517+
its('stdout') { should_not match('-oCiphers') }
518+
its('stdout') { should_not match('-oKexAlgorithms') }
519+
its('stdout') { should_not match('-oHostKeyAlgorithms') }
518520
end
519521
end

0 commit comments

Comments
 (0)