-
Notifications
You must be signed in to change notification settings - Fork 595
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
tests: several fixes to nested tests for UC24 #14761
tests: several fixes to nested tests for UC24 #14761
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #14761 +/- ##
==========================================
+ Coverage 78.95% 79.03% +0.07%
==========================================
Files 1084 1087 +3
Lines 146638 147941 +1303
==========================================
+ Hits 115773 116919 +1146
- Misses 23667 23778 +111
- Partials 7198 7244 +46
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…dget with core24 as a base for hybrid 24, fix how we add and check for section in kernel.efi
ce3232b
to
284c0fc
Compare
…nel is the same version between 24-hwe and 24. for now use beta to stable
@@ -17,7 +17,7 @@ snaps: | |||
name: pc | |||
type: gadget | |||
- | |||
default-channel: 24-oem/stable |
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.
no oem track
e4261d4
to
5e156ff
Compare
…ness to encounter same revision for UC24
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.
I don't know core parts well enough to approve. Just two random observations.
snap download --basename=pc-kernel --channel="$VERSION/stable" pc-kernel | ||
|
||
# download beta to increase the unlikeliness that we encounter the | ||
# same revision when remodelling. |
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.
So this can still randomly fail. What kind of option do we have for this to be fully robust regardless of releases?
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.
Idk, I was hoping someone might have a better idea - maybe repacking it and installing as an unasserted kernel would be fine.
@alfonsosanchezbeato idea?
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.
Why do not we repack the kernel here?
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.
Note that we will have to rewrite this test in the FDE branch. Because we will have to repack everything and remodel from the fakestore. So maybe we do not need to do the effort twice.
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.
Looks good thanks
@@ -775,6 +775,39 @@ uc20_build_corrupt_kernel_snap() { | |||
rm -rf "$REPACKED_DIR" | |||
} | |||
|
|||
uc_write_bootstrap_wrapper() { |
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.
nice
beforeDate="$(date --utc '+%s')" | ||
/usr/lib/snapd/snap-bootstrap.real "$@" | ||
if [ -d /run/mnt/data/system-data ]; then | ||
touch /run/mnt/data/system-data/the-tool-ran |
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.
I think we should clean that up. On 22+, it is not called the-tool
anymore. And since we have systemd re-execution in 22+ we can actually ask systemd directly if and when it was run.
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.
And of course, in a follow up PR
touch /run/mnt/data/system-data/the-tool-ran | ||
fi | ||
# also copy the time for the clock-epoch to system-data, this is | ||
# used by a specific test but doesn't hurt anything to do this for |
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.
It would be nice to find out which "specific test" needs it and add it in the comment. I really wonder if that is still needed.
local SKELETON_PATH="$1" | ||
local INJECT_ERR="${2:-false}" | ||
|
||
cp -a /usr/lib/snapd/snap-bootstrap "$SKELETON_PATH"/usr/lib/snapd/snap-bootstrap.real |
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.
I feel a lot of it should have been done by dropping a configuration for ExecStartPre and ExecStartPost. Maybe some clean up for the future.
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.
Thank you.
Nice that you extracted uc_write_bootstrap_wrapper
. We should really look at rewriting it now.
* tests: make sure we write the bootstrap wrapper for core24, repack gadget with core24 as a base for hybrid 24, fix how we add and check for section in kernel.efi * t/nested/manual/hybrid-remodel: update core base in snap.yaml as well * t/nested/manual/hybrid-remodel: so no reboot is happening because kernel is the same version between 24-hwe and 24. for now use beta to stable * t/nested/manual/hybrid-remodel: undo the channel switch * t/nested/manual/hybrid-remodel: use beta channel to increase unlikeliness to encounter same revision for UC24 * t/nested/manual/hybrid-remodel: fix the track check
* tests: make sure we write the bootstrap wrapper for core24, repack gadget with core24 as a base for hybrid 24, fix how we add and check for section in kernel.efi * t/nested/manual/hybrid-remodel: update core base in snap.yaml as well * t/nested/manual/hybrid-remodel: so no reboot is happening because kernel is the same version between 24-hwe and 24. for now use beta to stable * t/nested/manual/hybrid-remodel: undo the channel switch * t/nested/manual/hybrid-remodel: use beta channel to increase unlikeliness to encounter same revision for UC24 * t/nested/manual/hybrid-remodel: fix the track check
Rough summary of changes for some of the nested tests:
The remodel-min-size still needs to be fixed, will do that in a separate PR
The core20-early-config also needs its own PR (#14771)
REF: SNAPDENG-33308