Skip to content

Get kernel package info (New) #1886

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

fernando79513
Copy link
Collaborator

@fernando79513 fernando79513 commented Apr 23, 2025

WARNING: This modifies com.canonical.certification::sru-server

Description

We have added a new test to get the kernel package and add it as a resource job.
For snaps, it is quite simple, as there is already a functionality in checkbox (system.get_kernel_snap)
In the case of classic images, following this comment in mattermost we:

  • Find the linux-modules: linux-modules-{uname -r}
  • Get the source from the package metadata: apt-cache show linux-modules-{uname -r} -> Find "Source:"

These packages correspond to the ones in https://git.launchpad.net/~canonical-kernel/+git/kernel-versions/plain/info/kernel-series.yaml

Resolved issues

https://warthogs.atlassian.net/browse/CHECKBOX-1713

Documentation

TBD

Tests

Tested in a few core and classic devices:

Classic:
202004-27866 - Ubuntu 24 - rpi4b8g-002:
Kernel package: linux-raspi
Release version: 24.04
202310-32202 - Ubuntu 24 - rpi5b8g:
Kernel package: linux-raspi
Release version: 24.10
202111-29635 - Ubuntu 20 - dell-inspiron-5520-c29635:
Kernel package: linux-hwe-5.15
Release version: 20.04
202301-31087 - Ubuntu 20 - dell-xps-9320-c31087:
Kernel package: linux-oem-6.0
Release version: 22.04
202303-31333 - Ubuntu 20 - lenovo-thinkstation-px-c31333:
Kernel package: linux-oem-6.5
Release version: 22.04
202212-31026 - Ubuntu 20 - dell-g16-7630-c31026:
Kernel package: linux-oem-6.0
Release version: 22.04
202006-27952 - Ubuntu 20 - hp-prodesk-400-g7-sff-pc-c27952:
Kernel package: linux-oem-5.6
Release version: 20.04
202008-28167 - Ubuntu 20 - HP EliteOne 800 G6 24 All-in-One PC:
Kernel package: linux
Release version: 24.04
202008-28156 - Ubuntu 20 - limerick-zcu102:
Kernel package: linux-xilinx-zynqmp
Release version: 20.04
202008-28166 - Ubuntu 20 - hp-eliteone-800-g6-all-in-one-pc-c28166:
Kernel package: linux
Release version: 24.10

Core:
202008-28166 - Core 24 - hp-eliteone-800-g6-all-in-one-pc-c28166:
Kernel package: pc-kernel
Release version: 24
202106-29198 - Core 22 - uc22fde-001:
Kernel package: pc-kernel
Release version: 22
202111-29636 - Core 20 - advantech-uno-2271g-v2-c29636:
Kernel package: intel-kernel
Release version: 20
202203-30047 - Core 20- zhongyi-001:
Kernel package: asus-aiot-pe100a-kernel
Release version: 20
202403-33827 - Core 20 - shiner-imx8-med-pdk-001:
Kernel package: hbt-imx-kernel
Release version: 20
201803-26157 - Core 16 - tillamook-007:
Kernel package: cascade-kernel
Release version: 16

@fernando79513 fernando79513 changed the title Get kernel package info Get kernel package info (New) Apr 23, 2025
Copy link

codecov bot commented Apr 23, 2025

Codecov Report

Attention: Patch coverage is 95.65217% with 1 line in your changes missing coverage. Please review.

Project coverage is 50.48%. Comparing base (bd47976) to head (9459f77).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
providers/resource/bin/kernel_package_resource.py 95.65% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1886      +/-   ##
==========================================
+ Coverage   50.46%   50.48%   +0.02%     
==========================================
  Files         382      383       +1     
  Lines       41039    41062      +23     
  Branches     6892     6897       +5     
==========================================
+ Hits        20709    20731      +22     
  Misses      19585    19585              
- Partials      745      746       +1     
Flag Coverage Δ
provider-base 26.68% <ø> (ø)
provider-resource 38.19% <95.65%> (+1.40%) ⬆️

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.

@fernando79513
Copy link
Collaborator Author

@Hook25 Let me know what do you think about having this information in a resource job. I could move directly to the checkbox submission as suggested in the ticket.

@boukeas This implementation differs a bit with your approach of walking the apt dependency, but after reading the mentioned thread, I think this should be enough.

@Hook25
Copy link
Collaborator

Hook25 commented Apr 24, 2025

This is a known limitation of the workflow/the debian package, feel free to disregard that

Hook25
Hook25 previously approved these changes Apr 28, 2025
Copy link
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

ty for the many tests, consider the tips below

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants