Bug 2185890

Summary: IPU 7->8: wrong grubenv should inhibit upgrade
Product: Red Hat Enterprise Linux 7 Reporter: Manuel Moran <mmoran>
Component: leapp-repositoryAssignee: Leapp Notifications Bot <leapp-notifications-bot>
Status: NEW --- QA Contact: upgrades-and-conversions
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.9   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Manuel Moran 2023-04-11 14:15:11 UTC
Description of problem:

During tests for https://bugzilla.redhat.com/show_bug.cgi?id=2159288 we found another grubenv configuration that could also make leapp upgrade fail.

How reproducible:
Always

Steps to Reproduce:
1. Get a 7.9 machine, install leapp-upgrade, run leapp preupgrade until it has no inhibitors and the report is successful
2. cd into the directory where grubenv is located
3. execute:

truncate --size=1023 grubenv
echo -n 'a' >> grubenv

4. run leapp preupgrade (it does not inhibit)
5. run leapp upgrade (it works). 
6. reboot

Actual results:
On reboot, the wrong grub entry is selected by default. If the correct entry is manually selected (upgrade initramfs), the machine ends up in emergency shell.

Expected results:
Inhibit leapp upgrade if such a format is found in grubenv.

Additional info:
Test MR (the test is already written and for now the test case will be commented out until this is resolved): https://gitlab.cee.redhat.com/oamg/leapp-tests/-/merge_requests/214