-
Notifications
You must be signed in to change notification settings - Fork 87
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
[RHELC-752] Verify kernel boot files after conversion #721
[RHELC-752] Verify kernel boot files after conversion #721
Conversation
Codecov ReportBase: 92.71% // Head: 92.82% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #721 +/- ##
==========================================
+ Coverage 92.71% 92.82% +0.11%
==========================================
Files 24 24
Lines 3282 3319 +37
Branches 576 581 +5
==========================================
+ Hits 3043 3081 +38
+ Misses 172 171 -1
Partials 67 67
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Steps to reproduce locally (and for testing)
NotesThis reproducer probably works with Oracle Linux as well, but you will need to change the kernel version inside of the custom scripts. Keep an eye on that. |
2d743cf
to
7de2027
Compare
tests/integration/tier1/kernel-boot-files/test_handle_kernel_boot_files.py
Fixed
Show fixed
Hide fixed
2be7052
to
cc26f2e
Compare
/packit test |
cc26f2e
to
4d2b3d6
Compare
tests/integration/tier1/kernel-boot-files/test_handle_corrupted_files.py
Fixed
Show fixed
Hide fixed
4d2b3d6
to
8508a4a
Compare
tests/integration/tier1/kernel-boot-files/test_handle_corrupted_files.py
Fixed
Show fixed
Hide fixed
e3f26c1
to
10b3e6c
Compare
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.
Main code looks good. I'm just including a suggestion for how to implement outputing stdout to /dev/null and some spelling and wording changes.
I have looked at but not gone deeply into the unittests yet. I'm going to approve this because I don't see anything wrong with those but I know you specifically asked if I could see a better way to do them so I will look some more.
(I have not tested in a vm)
/packit test |
b28095f
to
7b2237c
Compare
/packit test |
Tested in a VM and it works fine. I've created a followup issue https://issues.redhat.com/browse/RHELC-902 (requesting to print required actions at the end of conversion). |
527f6e6
to
448e61a
Compare
tests/integration/tier1/kernel-boot-files/test_handle_corrupted_files.py
Fixed
Show fixed
Hide fixed
tests/integration/tier1/kernel-boot-files/test_handle_corrupted_files.py
Fixed
Show fixed
Hide fixed
43287ec
to
821fd59
Compare
Co-authored-by: Toshio Kuratomi <[email protected]> Apply suggestions from code review Co-authored-by: Michal Bocek <[email protected]>
Signed-off-by: Rodolfo Olivieri <[email protected]>
821fd59
to
db25585
Compare
@danmyway, FYI, I've re-run:
All issues were infrastructure related. |
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.
Looking good.
Failing tests unrelated to the changes.
Great job, thank you @r0x0d!
On CentOS and Oracle Linux 7 the test was failing because we were renaming the vmlinuz and initramfs files in order to back them up, but we left them in the /boot/ folder. That caused the grub2-mkconfig to pick them up and generated a new grub configuration using these renamed boot files. This change does not back up the boot files but instead simply removes them, simulating better the core test scenario of this integration test which is the kernel rpm scriptlet failure to copy/generate these boot files. After verifying that convert2rhel detected this situation of missing boot files correctly, the test goes on to do what the user instructed to do in such a case - that is reinstalling the kernel and re-runing grub2-mkconfig. Fixes oamg#721.
On CentOS and Oracle Linux 7 the test was failing because we were renaming the vmlinuz and initramfs files in order to back them up, but we left them in the /boot/ folder. That caused the grub2-mkconfig to pick them up and generated a new grub configuration using these renamed boot files. This change does not back up the boot files but instead simply removes them, simulating better the core test scenario of this integration test which is the kernel rpm scriptlet failure to copy/generate these boot files. After verifying that convert2rhel detected this situation of missing boot files correctly, the test goes on to do what the user instructed to do in such a case - that is reinstalling the kernel and re-runing grub2-mkconfig. Fixes oamg#721.
We incorrectly identified the test failures as unrelated to this PR. They were related and here's a fix of the test: #748. |
On CentOS and Oracle Linux 7 the test was failing because we were renaming the vmlinuz and initramfs files in order to back them up, but we left them in the /boot/ folder. That caused the grub2-mkconfig to pick them up and generated a new grub configuration using these renamed boot files. This change does not back up the boot files but instead simply removes them, simulating better the core test scenario of this integration test which is the kernel rpm scriptlet failure to copy/generate these boot files. After verifying that convert2rhel detected this situation of missing boot files correctly, the test goes on to do what the user instructed to do in such a case - that is reinstalling the kernel and re-runing grub2-mkconfig. Fixes #721.
* Add a later check to warn the user about kernel boot files We added a few later checks to verify and warn the user if there are any errors with both `initramfs` `vmlinuz` files on their system after the conversion. This check has the intention to at least inform the user what are the steps that they need to run in order to fix that problem. Added some unit tests to assert that the correct path is being executed while we are checking for the kernel boot files. The tests added here tries to assert that both individual functions (checking for initramfs and vmlinuz) are called correctly and going through the correct paths, as well, checking that the workflow for the main check function is also doing what is supposed to. Signed-off-by: Rodolfo Olivieri <[email protected]> * Add unit tests for later checks Signed-off-by: Rodolfo Olivieri <[email protected]> * Add integration tests for the kernel boot files Signed-off-by: Rodolfo Olivieri <[email protected]> * Applied comments from review and a small refactor Refactored the `check_kernel_boot_files()` function to be simpler and not rely on functions that only do mainly one line of code. Signed-off-by: Rodolfo Olivieri <[email protected]> * Make an after conversion check * instead of having a full conversion running just to check for initramfs and vmlinuz files presence, introduce a check after each conversion * scrap the individual test case * deselect said check from cases with tainted files Signed-off-by: Daniel Diblik <[email protected]> * Apply suggestions from code review Co-authored-by: Preston Watson <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Change integration test Signed-off-by: Rodolfo Olivieri <[email protected]> * Apply suggestions from code review Co-authored-by: Daniel Diblik <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remove leftover comparison Signed-off-by: Rodolfo Olivieri <[email protected]> * Apply suggestions from code review Co-authored-by: Toshio Kuratomi <[email protected]> Apply suggestions from code review Co-authored-by: Michal Bocek <[email protected]> * Change integration tests Signed-off-by: Rodolfo Olivieri <[email protected]> --------- Signed-off-by: Rodolfo Olivieri <[email protected]> Signed-off-by: Daniel Diblik <[email protected]> Co-authored-by: Daniel Diblik <[email protected]> Co-authored-by: Preston Watson <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Daniel Diblik <[email protected]> Co-authored-by: Michal Bocek <[email protected]>
On CentOS and Oracle Linux 7 the test was failing because we were renaming the vmlinuz and initramfs files in order to back them up, but we left them in the /boot/ folder. That caused the grub2-mkconfig to pick them up and generated a new grub configuration using these renamed boot files. This change does not back up the boot files but instead simply removes them, simulating better the core test scenario of this integration test which is the kernel rpm scriptlet failure to copy/generate these boot files. After verifying that convert2rhel detected this situation of missing boot files correctly, the test goes on to do what the user instructed to do in such a case - that is reinstalling the kernel and re-runing grub2-mkconfig. Fixes #721.
Add a later check to warn the user about kernel boot files
We added a few later checks to verify and warn the user if there is any
errors with both
initramfs
vmlinuz
files on their system after theconversion.
This check has the intention to at least inform the user what are the
steps that they need to run in order to fix that problem.
Signed-off-by: Rodolfo Olivieri [email protected]
Jira Issue: RHELC-752
Checklist
[RHELC-]
is part of the PR titleRelease Pending