Skip to content
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

Extend tmt-reboot to allow reboot from outside of the test process #2311

Merged
merged 1 commit into from
Oct 21, 2023

Conversation

happz
Copy link
Collaborator

@happz happz commented Sep 5, 2023

Patch introduced a "test pidfile" in which the execute plugin would
store test process pid. This file is then used by tmt-reboot to
discover which process to signal when reboot is requested.

This allows tmt-reboot to be called from outside of the test process
tree while keeping tmt in the loop and correctly notified.

Fixes #2067

tmt/steps/execute/scripts/tmt-reboot Fixed Show fixed Hide fixed
tmt/steps/execute/scripts/tmt-reboot-core Fixed Show fixed Hide fixed
tmt/steps/execute/scripts/tmt-reboot-core Fixed Show fixed Hide fixed
tmt/steps/execute/scripts/tmt-reboot-core Fixed Show fixed Hide fixed
tmt/steps/execute/scripts/tmt-reboot-core Fixed Show fixed Hide fixed
tmt/steps/execute/scripts/tmt-reboot-core Fixed Show fixed Hide fixed
tmt/steps/execute/scripts/tmt-reboot-core Fixed Show fixed Hide fixed
tmt/steps/execute/scripts/tmt-reboot-core Fixed Show fixed Hide fixed
@kkaarreell
Copy link
Collaborator

I have tested RPMs built from this PR on my test doing a reboot from the outside session and it seems to work well. Great job!

@happz
Copy link
Collaborator Author

happz commented Sep 14, 2023

@kkaarreell that's good news, thanks!

Adding this PR to 1.28 then, hoping for more testing.

@happz happz marked this pull request as ready for review September 14, 2023 13:38
@happz happz added this to the 1.28 milestone Sep 14, 2023
@happz happz added the command | reboot Support for rebooting guests during `tmt run` and the `tmt-reboot` command label Sep 14, 2023
@thrix
Copy link
Collaborator

thrix commented Sep 15, 2023

yep, planning to test also, stay tuned

@psss
Copy link
Collaborator

psss commented Sep 21, 2023

@happz, I guess this one obsoletes #1575?

@happz
Copy link
Collaborator Author

happz commented Sep 21, 2023

@happz, I guess this one obsoletes #1575?

I don't think so, this PR focuses on tmt-reboot only, in the context of a test running & external actor wishing to reboot the box. #1575 deals with reboots in prepare and finish, this PR acts in execute only.

Copy link
Collaborator

@therazix therazix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few typos.

README.rst Outdated Show resolved Hide resolved
tmt/steps/execute/scripts/tmt-reboot-core Outdated Show resolved Hide resolved
tmt/steps/execute/internal.py Outdated Show resolved Hide resolved
tmt/steps/execute/internal.py Outdated Show resolved Hide resolved
@psss psss modified the milestones: 1.28, 1.29 Oct 4, 2023
@happz
Copy link
Collaborator Author

happz commented Oct 4, 2023

Filed #2377 for tmt-abort change - not a blocker for this PR.

@psss psss self-assigned this Oct 10, 2023
@happz happz added the status | blocking other work An important pull request, blocking other pull requests or issues label Oct 16, 2023
Copy link
Collaborator

@psss psss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, nice work! Added just a couple of minor comments.

tests/execute/reboot/out-of-session.sh Outdated Show resolved Hide resolved
tests/execute/reboot/out-of-session.sh Show resolved Hide resolved
tests/execute/reboot/out-of-session.sh Show resolved Hide resolved
tests/execute/reboot/out-of-session.sh Outdated Show resolved Hide resolved
tmt/steps/execute/internal.py Outdated Show resolved Hide resolved
Patch introduced a "test pidfile" in which the execute plugin would
store test process pid. This file is then used by `tmt-reboot` to
discover which process to signal when reboot is requested.

This allows `tmt-reboot` to be called from outside of the test process
tree while keeping tmt in the loop and correctly notified.
@psss psss merged commit a6ad1ec into main Oct 21, 2023
15 of 16 checks passed
@psss psss deleted the reboot-from-outside branch October 21, 2023 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command | reboot Support for rebooting guests during `tmt run` and the `tmt-reboot` command status | blocking other work An important pull request, blocking other pull requests or issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cannot tmt-reboot from an independent session
5 participants