Feature: [Ubuntu, no-CVM] Adding reboot, hibernate checks and aligning all pre-reqs together#363
Conversation
…g all pre-reqs together
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #363 +/- ##
==========================================
- Coverage 94.08% 94.03% -0.06%
==========================================
Files 109 109
Lines 20099 20348 +249
==========================================
+ Hits 18911 19134 +223
- Misses 1188 1214 +26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR extends the UEFI certificate update flow (used during default patching) by enforcing additional pre-requisites (CVM exclusion, hibernation-off, latest-certs check, and uptime-based reboot handling) and updating unit tests accordingly.
Changes:
- Adds prerequisite gating in
PatchInstallerbefore attempting UEFI certificate updates, including reboot/hibernate/latest-certs checks. - Adds Apt-specific implementations for uptime and hibernation detection to support the new prerequisites.
- Expands test coverage to validate prerequisite branching and status/error recording behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/core/src/core_logic/PatchInstaller.py | Adds certificate-update prerequisite checks and records status/errors for prerequisite failures and update failures. |
| src/core/src/package_managers/AptitudePackageManager.py | Implements uptime-based reboot check and hibernation-state detection for cert-update prerequisites. |
| src/core/src/package_managers/PackageManager.py | Refactors certificate update entrypoints and adds shared mokutil availability gating for cert checks. |
| src/core/src/package_managers/YumPackageManager.py | Adds stub implementations for new certificate prerequisite APIs. |
| src/core/src/package_managers/TdnfPackageManager.py | Adds stub implementations for new certificate prerequisite APIs. |
| src/core/src/package_managers/ZypperPackageManager.py | Adds stub implementations for new certificate prerequisite APIs. |
| src/core/src/package_managers/Dnf5PackageManager.py | Adds stub implementations for new certificate prerequisite APIs. |
| src/core/tests/Test_PatchInstaller.py | Adds/updates tests to validate prerequisite ordering and installation-status error recording. |
| src/core/tests/Test_AptitudePackageManager.py | Adds/updates tests for mokutil/cert-check behavior and uptime-based reboot decisioning. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kjohn-msft
left a comment
There was a problem hiding this comment.
Review code coverage + minor comments
This PR defines all pre-requisites for updating certificates in Canonical VMs, some of which were already existing and are now re-aligned in appropriate sections and some are added as new.
The pre-reqs for certificate updates are:
This change also introduces a parent package manager flag, is_certificate_update_enabled_for_package_manager, which can be overridden by individual distro package managers as certificate update support is added.
In-VM Test logs: