Skip to content

Commit

Permalink
Use shell instead of run_shell
Browse files Browse the repository at this point in the history
  • Loading branch information
deric committed Apr 30, 2020
1 parent c3b301f commit 4c5f525
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,20 +289,20 @@ class { 'fail2ban': }
end

it 'is expected to modify sshd port' do
run_shell("grep \"\\[sshd\\]\" -A 5 #{config_file_path}") do |r|
shell("grep \"\\[sshd\\]\" -A 5 #{config_file_path}") do |r|
expect(r.stdout).to match %r{^port\s+\=\s+ssh,2200$}
end
end

it 'is expected to modify dropbear port' do
run_shell("grep \"\\[dropbear\\]\" -A 5 #{config_file_path}") do |r|
shell("grep \"\\[dropbear\\]\" -A 5 #{config_file_path}") do |r|
expect(r.stdout).to match %r{^port\s+\=\s+ssh,2201$}
end
end

it 'is expected to modify selinux-ssh port' do
unless fact('os.family') == 'Debian' && fact('os.release.major') == '8'
run_shell("grep \"\\[selinux-ssh\\]\" -A 5 #{config_file_path}") do |r|
shell("grep \"\\[selinux-ssh\\]\" -A 5 #{config_file_path}") do |r|
expect(r.stdout).to match %r{^port\s+\=\s+ssh,2202$}
end
end
Expand Down

0 comments on commit 4c5f525

Please sign in to comment.