overlord/fdestate: run post install checks during auto repair - #16627
Conversation
|
Wed Jun 3 09:21:45 UTC 2026 Failures:Executing:
Skipped tests from snapd-testing-skipIf you wish to have any of the below tests run in your PR, in your PR description, add 'unskip:' followed by a copy-and-pasted list (without variants) of the below tests you wish to run (unskip plus test list must be valid yaml)
|
e7fa4b5 to
01afcdd
Compare
01afcdd to
70051ef
Compare
c01e2a5 to
4975a6c
Compare
|
This will need a spread test. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #16627 +/- ##
==========================================
+ Coverage 79.00% 79.03% +0.03%
==========================================
Files 1376 1367 -9
Lines 192016 192041 +25
Branches 2464 2464
==========================================
+ Hits 151693 151786 +93
+ Misses 31180 31089 -91
- Partials 9143 9166 +23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4975a6c to
ff7d44d
Compare
I could not add a spread test. While the spread test do exercise it, they do not do the case where post install check would fail. Unfortunately, most check fails are either disabled on VMs or require interaction with OVMF menu. Instead I manually tested it by disabling secure boot and making sure the state had the right value. |
ff7d44d to
70568ab
Compare
| } | ||
|
|
||
| const postInstall = true | ||
| if _, details, err := secbootPreinstallCheck(context.Background(), postInstall, images); len(details) > 0 || err != nil { |
There was a problem hiding this comment.
Is there a reason we are not logging the error details here?
| return nil, err | ||
| } | ||
|
|
||
| for _, runModeBootChain := range runModeBootChains { |
There was a problem hiding this comment.
This loop warrants some comments
|
I have to rebase... |
fcf7faa to
db1e994
Compare
| // To support testing, when the system is running in a Virtual Machine, the check | ||
| // configuration is modified to permit this to avoid an error. | ||
| func PreinstallCheck(ctx context.Context, bootImagePaths []string) (*PreinstallCheckContext, []PreinstallErrorDetails, error) { | ||
| func PreinstallCheck(ctx context.Context, postInstall bool, bootImagePaths []bootloader.BootFile) (*PreinstallCheckContext, []PreinstallErrorDetails, error) { |
There was a problem hiding this comment.
Might be worth having a separate PostinstallCheck helper, passing a post-install flag to PreinstallCheck is a little confusing even if the underlying secboot calls are like this
There was a problem hiding this comment.
I wonder about the returned "PreinstallCheckContext" "PreinstallErrorDetails". What should they be renamed to?
There was a problem hiding this comment.
something like "RunChecksContext" "RunChecksErrorDetails"? but I agree that might be a lot to refactor in this PR so maybe a follow up.
ZeyadYasser
left a comment
There was a problem hiding this comment.
LGTM, Thank you! small nitpick comments
| return rs.State, nil | ||
| } | ||
|
|
||
| func getBootChain() ([]bootloader.BootFile, error) { |
There was a problem hiding this comment.
does it make sense to move this under boot/seal.go?
There was a problem hiding this comment.
I think it would be nice to factorize with runModeBootChainsWithTrustedAssets. But it is not that easy. I will open a ticket to remember to do that.
There was a problem hiding this comment.
this is the run boot chain? maybe the function name should reflect that?
|
I have to rebase again... |
95f15bd to
c7b0f00
Compare
89ed402 to
179d439
Compare
| return AutoRepairNotAttempted, err | ||
| } | ||
|
|
||
| if _, details, err := secbootPostinstallCheck(context.Background(), images); len(details) > 0 || err != nil { |
There was a problem hiding this comment.
secbootPreinstallCheck where used in install.go uses context timeout. Considering adding.
| return AutoRepairNotAttempted, err | ||
| } | ||
|
|
||
| if _, details, err := secbootPostinstallCheck(context.Background(), images); len(details) > 0 || err != nil { |
There was a problem hiding this comment.
Should the use if secbootPostinstallCheck be limited to classic hybrid systems >= 25.10? (same as secbootPreinstallCheck)
There was a problem hiding this comment.
That is a very good point.
| break | ||
| } | ||
|
|
||
| // In theory we should only have one hash here. Multiple would be when we are trying |
There was a problem hiding this comment.
Perhaps test and warn if somehow this is not the case?
| // To support testing, when the system is running in a Virtual Machine, the check | ||
| // configuration is modified to permit this to avoid an error. | ||
| func PreinstallCheck(ctx context.Context, bootImagePaths []string) (*PreinstallCheckContext, []PreinstallErrorDetails, error) { | ||
| func preinstallCheck(ctx context.Context, postInstall bool, bootImagePaths []bootloader.BootFile) (*PreinstallCheckContext, []PreinstallErrorDetails, error) { |
There was a problem hiding this comment.
maybe Paths should become Files ? here and in the callers
| return rs.State, nil | ||
| } | ||
|
|
||
| func getBootChain() ([]bootloader.BootFile, error) { |
There was a problem hiding this comment.
this is the run boot chain? maybe the function name should reflect that?
|
I pushed something, but it is not showing up yet... |
4dffada to
944d18b
Compare
SNAPDENG-36452