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

[RHELC-752] Fix "missing boot files" test #748

Merged
merged 1 commit into from
Feb 22, 2023

Conversation

bocekm
Copy link
Member

@bocekm bocekm commented Feb 22, 2023

On CentOS and Oracle Linux 7 the test was failing because we were renaming the vmlinuz, thinking that it's enough to simulate that they are not present. But leaving them renamed in the /boot/ folder caused that the grub2-mkconfig picked them up and generated a new grub configuration using these renamed boot files:

09:39:43             out: [02/22/2023 09:39:43] TASK - [Final: Update GRUB2 configuration] ********************************
...
09:39:44             out: [02/22/2023 09:39:44] DEBUG - Output of the grub2-mkconfig call:
09:39:44             out: Found linux image: /boot/vmlinuz-3.10.0-1160.83.1.el7.x86_64.backup
09:39:44             out: Found initrd image: /boot/initramfs-3.10.0-1160.83.1.el7.x86_64.backup.img

Full test failure log: http://artifacts.osci.redhat.com/testing-farm/686cea0f-2101-49a5-9a57-0424d12e2d53/work-kernel_boot_files_missing_initramfs_and_vmlinuzqarmzy43/log.txt.

This test fix stops renaming the boot files and instead it simply removes them, simulating better the core test scenario of this integration test (the kernel rpm scriptlet failure to copy/generate the boot files). After verifying that convert2rhel detected this situation of missing boot files correctly, the test goes on to do what the user is instructed to do in such a case - that is reinstalling the kernel and re-runing grub2-mkconfig.

Fixes #721.

Jira Issue: RHELC-752

Checklist

  • PR meets acceptance criteria specified in the Jira issue
  • PR has been tested manually in a VM (either author or reviewer)
  • Jira issue has been made public if possible
  • [RHELC-] is part of the PR title
  • Code and tests are documented properly
  • The commits are squashed to as few commits as possible (without losing data)
  • When merged: Jira issue has been updated to Release Pending

@bocekm bocekm requested review from r0x0d and danmyway February 22, 2023 13:45
@codecov
Copy link

codecov bot commented Feb 22, 2023

Codecov Report

Base: 92.82% // Head: 92.82% // No change to project coverage 👍

Coverage data is based on head (b5812f7) compared to base (a93b177).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #748   +/-   ##
=======================================
  Coverage   92.82%   92.82%           
=======================================
  Files          24       24           
  Lines        3316     3316           
  Branches      580      580           
=======================================
  Hits         3078     3078           
  Misses        171      171           
  Partials       67       67           
Flag Coverage Δ
centos-linux-7 88.14% <ø> (ø)
centos-linux-8 89.14% <ø> (ø)

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

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.
@bocekm bocekm force-pushed the fix-missing-kernel-boot-files-test branch from 9ee2990 to b5812f7 Compare February 22, 2023 13:52
Copy link
Member

@danmyway danmyway 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, thanks @bocekm

@danmyway
Copy link
Member

The kernel_boot_files_* tests dispatched separately to get the results sooner.
CentOS 7.9
http://artifacts.osci.redhat.com/testing-farm/78944f60-99ca-4dcf-9418-c30b7e60bf48/

Oracle Linux 7.9
http://artifacts.osci.redhat.com/testing-farm/934de073-5fbf-4df5-a4f5-76c8bb3469aa/

Given there was just one file modified, there is no risk in merging, when the pipelines above finish and PASS.

@danmyway
Copy link
Member

All related tests passed in their separate runs.
Merging

@danmyway danmyway merged commit 8875f2c into oamg:main Feb 22, 2023
@Venefilyn Venefilyn added the skip/changelog If it should be excluded from changelog or Release notes. Such as infra, reverted PRs, etc. label Feb 22, 2023
Venefilyn pushed a commit that referenced this pull request Jun 19, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip/changelog If it should be excluded from changelog or Release notes. Such as infra, reverted PRs, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants