-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve starting ipmi_sim program #9378
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -580,12 +580,12 @@ | |
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) | ||
server.run('nohup ipmi_sim -n > /var/log/ipmi_sim.log 2>&1 &', verbose: true, check_errors: true) | ||
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("ps aux | grep [f]ake_ipmi_host.sh | awk '{print $2}' | xargs kill") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add here verbose: true, so we can keep track of having duplicated processes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would stick with the previous version, there are two issues with it:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree in your points @szachovy but @maximenoel8 said that pkill was not killing successfully, and we need to address it somehow. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you look in uyuni podman server you will see the pkill is not working: uyuni-master-podman-srv:~ # ps aux | grep fake_ipmi_host.sh
root 10582 0.0 0.0 4236 3120 ? S Oct16 0:03 /bin/bash /etc/ipmi/fake_ipmi_host.sh
root 11787 0.0 0.0 9156 2336 pts/0 S+ 09:48 0:00 grep --color=auto fake_ipmi_host.sh
root 13152 0.0 0.0 4236 3104 ? S Oct16 0:03 /bin/bash /etc/ipmi/fake_ipmi_host.sh
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
uyuni-master-podman-srv:~ # ps aux | grep fake_ipmi_host.sh
root 10582 0.0 0.0 4236 3120 ? S Oct16 0:03 /bin/bash /etc/ipmi/fake_ipmi_host.sh
root 13152 0.0 0.0 4236 3104 ? S Oct16 0:03 /bin/bash /etc/ipmi/fake_ipmi_host.sh
root 13807 0.0 0.0 8780 2328 pts/1 S+ 10:03 0:00 grep --color=auto fake_ipmi_host.sh
uyuni-master-podman-srv:~ # pkill --full fake_ipmi_host.sh
uyuni-master-podman-srv:~ # ps aux | grep fake_ipmi_host.sh
root 13877 0.0 0.0 8780 816 pts/1 S+ 10:03 0:00 grep --color=auto fake_ipmi_host.sh There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, it seems the proper fix for that killing, indeed. |
||
end | ||
|
||
When(/^the controller starts mocking a Redfish host$/) do | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe before starting a new one, we can have an assert/pre-condition where we assure there is no other process already running.
If we have it, we might want to skip the start with a warning message, or we might want to just fail the step.