Skip to content

Commit

Permalink
Improve impi simulator process handling (#9378)
Browse files Browse the repository at this point in the history
Improve impi simulator process handling
  • Loading branch information
maximenoel8 authored Nov 15, 2024
1 parent ef605e3 commit 9c034d9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions testsuite/features/step_definitions/command_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -578,12 +578,17 @@
raise ScriptError, 'File injection failed' unless success
end
server.run('chmod +x /etc/ipmi/fake_ipmi_host.sh', verbose: true, check_errors: true)
server.run('ipmi_sim -n < /dev/null > /dev/null &', verbose: true, check_errors: true)
# Check if ipmi_sim is already running
if server.run('pgrep -f ipmi_sim', verbose: false, check_errors: false)[1].zero?
log 'ipmi_sim is already running; skipping startup.'
else
server.run('ipmi_sim -n < /dev/null > /dev/null &', verbose: true, check_errors: true)
end
end

When(/^the server stops mocking an IPMI host$/) do
get_target('server').run('pkill ipmi_sim')
get_target('server').run('pkill fake_ipmi_host.sh || :')
get_target('server').run('pkill --full fake_ipmi_host.sh || :', verbose: false, check_errors: false)
end

When(/^the controller starts mocking a Redfish host$/) do
Expand Down

0 comments on commit 9c034d9

Please sign in to comment.