Skip to content

tests: enable some nested tests by setting up proper kernel declarations on UC26#16452

Merged
ernestl merged 4 commits intocanonical:masterfrom
andrewphelpsj:kmod-component-spread-fix
Feb 2, 2026
Merged

tests: enable some nested tests by setting up proper kernel declarations on UC26#16452
ernestl merged 4 commits intocanonical:masterfrom
andrewphelpsj:kmod-component-spread-fix

Conversation

@andrewphelpsj
Copy link
Copy Markdown
Member

Additionally, work around a bug in pc-kernel in 26/edge, which contains duplicate kernel modules, breaking some of our repacking scripts.

Copilot AI review requested due to automatic review settings January 15, 2026 21:01
@andrewphelpsj
Copy link
Copy Markdown
Member Author

My first commit is also addressed by #16447. Whichever gets merged first will need to address this.

@andrewphelpsj andrewphelpsj requested review from alfonsosanchezbeato and ernestl and removed request for Copilot January 15, 2026 21:02
@andrewphelpsj andrewphelpsj force-pushed the kmod-component-spread-fix branch from 01e4b52 to 45d0e0b Compare January 15, 2026 21:03
Copilot AI review requested due to automatic review settings January 15, 2026 21:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables nested tests for Ubuntu Core 26 by setting up proper kernel declarations and working around a pc-kernel bug in 26/edge that contains duplicate kernel modules.

Changes:

  • Enabled Ubuntu 26 systems for kernel component and remodel tests
  • Added kernel snap declaration extras for UC26+ driver library slots
  • Modified kernel repacking script to handle duplicate modules in pc-kernel

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/nested/manual/remodel-with-components/task.yaml Enables test for ubuntu-26 and adds conditional kernel declaration extras
tests/nested/manual/remodel-with-components-offline/task.yaml Removes ubuntu-26 exclusion and adds conditional kernel declaration extras
tests/nested/manual/kernel-modules-components/task.yaml Removes ubuntu-26 exclusion to enable test
tests/lib/tools/build_kernel_with_comps.sh Narrows module search to avoid duplicates and adds conditional symlink creation
tests/lib/nested.sh Adds automatic kernel declaration extras for UC26+ kernels in fakestore
tests/lib/assertions/pc-kernel-26-snap-decl-extras.json Defines snap declaration extras for driver library slots

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/nested/manual/remodel-with-components/task.yaml
Comment thread tests/nested/manual/remodel-with-components-offline/task.yaml
Comment thread tests/lib/tools/build_kernel_with_comps.sh
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 15, 2026

Mon Feb 2 14:30:04 UTC 2026
The following results are from: https://github.com/canonical/snapd/actions/runs/21582376145

Failures:

Preparing:

  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/broken-model:tpm
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/uc20-storage-safety:preferunencrypted
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/uc-update-assets-secure:seed
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-kernel-failover:empty
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-factory-reset:nofde
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/core20-boot-config-update:nogadget
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core-gadget-mounted
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/kernel-revert-after-boot
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/save-data
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/remount-hotplug
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/core20-set-efi-boot-vars:UBUNTUDIR_NOSEC
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-fault-inject-on-install:snapd_reboot_auto_connect
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/core20-boot-config-update:gadgetextra
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-kernel-failover:bad_text
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/core20-set-efi-boot-vars:UBUNTUDIR
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/bad-try-kernel-no-reboot
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-kernel-failover:zeros
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/base-revert-after-boot
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/coreconfig-services
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/core20-fault-inject-on-update-config:gadget_panic_command_line
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-kernel-reseal
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/kernel-modules-components:plain
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-fault-inject
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-kernel-failover:bad_linux
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-kernel-failover:nolink
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/uc-grub-boot-chains
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-degraded
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-set-efi-boot-variables
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/core20-initramfs-time-moves-forward
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/core-broken-fde-state
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-gadget-reseal
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-kernel-failover:bad_initrd
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-kernel-failover:crash
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-factory-reset:fde
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-fault-inject-on-install:snapd_panic_auto_connect
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/remodel-with-components
  • openstack-ext:ubuntu-26.04-64:tests/nested/core/core20-basic
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/core20-fde-dbx
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/core20-boot-config-update:gadgetfull
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/devmode-snap-seeded-dangerous
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/core20-nofde-dbx
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/recovery-system:tested_and_default
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/recovery-system:tested
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/uc-update-command-line-secure
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/core20-custom-kernel-commandline
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/core20-da-lockout:encrypted
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/recovery-system:no_test_or_default
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/uc20-fde-hooks-v1
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/cmdline-remove-append
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/core20-set-efi-boot-vars:BOOTDIR
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/core20-4k-sector-size:physical_only
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/uc-update-assets-secure:both
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/core20-set-efi-boot-vars:BOOTDIR_NOSEC
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/recovery-system:default
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/broken-model:hook
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/kernel-modules-components:encrypted
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/core20-4k-sector-size:logical
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/remodel-with-components-offline
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/uc-update-assets-secure:boot

Executing:

  • openstack:debian-sid-64:tests/main/interfaces-network-status-classic
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/install-min-size
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/minimal-smoke:secboot_enabled
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/minimal-smoke:secboot_disabled
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/install-volume-assignment
  • openstack-ext:ubuntu-26.04-64:tests/nested/manual/core20-install-mode-shutdown-via-hook
  • openstack:ubuntu-26.04-64:tests/main/upgrade-from-release
  • openstack:ubuntu-26.04-64:tests/upgrade/basic

Copy link
Copy Markdown
Member

@alfonsosanchezbeato alfonsosanchezbeato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this - maybe we should make adding the slots the default for pc-kernel. Note that this declaration is now used even for pc-kernel in UC16, for instance, so actually it would make the tests closer to reality.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth including also nvidia-video-driver-libs, they will eventually use it and it is harmless to put it now in our declaration.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this, and made it the default when repacking a kernel.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.57%. Comparing base (d6fe403) to head (69cb522).
⚠️ Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #16452      +/-   ##
==========================================
- Coverage   77.58%   77.57%   -0.02%     
==========================================
  Files        1337     1339       +2     
  Lines      184908   184876      -32     
  Branches     2444     2444              
==========================================
- Hits       143465   143415      -50     
- Misses      32781    32803      +22     
+ Partials     8662     8658       -4     
Flag Coverage Δ
unittests 77.57% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI review requested due to automatic review settings January 16, 2026 16:32
@andrewphelpsj andrewphelpsj force-pushed the kmod-component-spread-fix branch from c3d8d1a to a00261f Compare January 16, 2026 16:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/lib/nested.sh
Comment thread tests/lib/tools/build_kernel_with_comps.sh
Copy link
Copy Markdown
Member

@alfonsosanchezbeato alfonsosanchezbeato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@andrewphelpsj andrewphelpsj added the Auto rerun spread Auto reruns spread up to 4 times in non-draft PRs w/ >=1 approval and <20 fails in any fund. system label Jan 21, 2026
Copy link
Copy Markdown
Member

@ernestl ernestl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@@ -39,15 +39,19 @@ description: kernel component for testing purposes
EOF
# Replace _ or - with [_-], as it can be any of these
glob_mod_name=$(printf '%s' "$mod_name" | sed -r 's/[-_]/[-_]/g')
module_path=$(find kernel -name "${glob_mod_name}.ko*")
# TODO: search only in kernel/modules to avoid duplicates (pc-kernel in
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to replace my previous workaround with this.

@ernestl
Copy link
Copy Markdown
Member

ernestl commented Feb 2, 2026

Failure analysis:
The targeted tests pass, none of the failures relates to the changes.

@ernestl ernestl force-pushed the kmod-component-spread-fix branch from a00261f to 69cb522 Compare February 2, 2026 08:16
@ernestl ernestl merged commit 6941bfb into canonical:master Feb 2, 2026
40 checks passed
@ernestl ernestl added this to the 2.74.1 milestone Feb 2, 2026
@ernestl ernestl mentioned this pull request Feb 2, 2026
ernestl pushed a commit to ernestl/snapd that referenced this pull request Feb 3, 2026
…ons on UC26 (canonical#16452)

* t/l/t/build_kernel_with_comps.sh: work around bug in current pc-kernel on 26/edge

* tests: enable some nested tests by setting up proper kernel declaration on uc26

* tests: always add extra driver lib decls when repacking kernel

* t/l/prepare.sh: change destination of systemd dropins for core26
ernestl pushed a commit that referenced this pull request Feb 9, 2026
…ons on UC26 (#16452)

* t/l/t/build_kernel_with_comps.sh: work around bug in current pc-kernel on 26/edge

* tests: enable some nested tests by setting up proper kernel declaration on uc26

* tests: always add extra driver lib decls when repacking kernel

* t/l/prepare.sh: change destination of systemd dropins for core26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto rerun spread Auto reruns spread up to 4 times in non-draft PRs w/ >=1 approval and <20 fails in any fund. system cherry-picked

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants