Skip to content
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

Added tests for IOMMU config (New) #1715

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

Conversation

fernando79513
Copy link
Collaborator

@fernando79513 fernando79513 commented Feb 10, 2025

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

Description

We want to check if the CONFIG_INTEL_IOMMU_DEFAULT_ON config flag is present in versions of the kernel >=6.8.0-20

Note: I've included the test into the submission-cert-automated test-plan. It's already being run in all of the devices and it includes also some info tests, so it made sense for me to include it here. Let me know if you think it should be in another test-plan
Note: I had to remove the config iterator (see commit: removed iterator for python 3.5). I don't like this too much, but the unit tests failed in python 3.5 if I read the file line by line.

Resolved issues

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

Documentation

Tests

Tested with:
classic image, ubuntu 24, kernel "6.8.0-52-generic"

-------------[ Check if the kernel is compiled with IOMMU support ]-------------
ID: com.canonical.certification::info/kernel-config-iommu-flag
Category: com.canonical.plainbox::info
... 8< -------------------------------------------------------------------------
Flag CONFIG_INTEL_IOMMU_DEFAULT_ON is present and set to 'y'.

core image, ubuntu 24, pc-kernel "6.11.0-17-generic"
https://certification.canonical.com/hardware/201805-26252/submission/410961/test-results/

-------------[ Check if the kernel is compiled with IOMMU support ]-------------
ID: com.canonical.certification::info/kernel-config-iommu-flag
Category: com.canonical.plainbox::info
... 8< -------------------------------------------------------------------------
Flag CONFIG_INTEL_IOMMU_DEFAULT_ON is present and set to 'y'.

core image, ubuntu 22, pc-kernel "5.15.0-132-generic"
https://certification.canonical.com/hardware/201802-26085/submission/410964/test-results/

-------------[ Check if the kernel is compiled with IOMMU support ]-------------
ID: com.canonical.certification::info/kernel-config-iommu-flag
Category: com.canonical.plainbox::info
... 8< -------------------------------------------------------------------------
Skipping: kernel version 5.15.0-132 is lower than 6.8.0-20.

core image, ubuntu 22, pc-kernel "5.15.0-132-generic"
https://certification.canonical.com/hardware/201802-26085/submission/410964/test-results/

-------------[ Check if the kernel is compiled with IOMMU support ]-------------
ID: com.canonical.certification::info/kernel-config-iommu-flag
Category: com.canonical.plainbox::info
... 8< -------------------------------------------------------------------------
Skipping: kernel version 5.15.0-132 is lower than 6.8.0-20.

core image, ubuntu 24, pi-kernel "6.8.0-1016-raspi" (ARM)
https://certification.canonical.com/hardware/202310-32203/submission/411376/test-results/

-------------[ Check if the kernel is compiled with IOMMU support ]-------------
ID: com.canonical.certification::info/kernel-config-iommu-flag
Category: com.canonical.plainbox::info
... 8< -------------------------------------------------------------------------
Skipping: arm architecture detected.
------------------------------------------------------------------------- >8 ---

Copy link

codecov bot commented Feb 10, 2025

Codecov Report

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

Project coverage is 49.19%. Comparing base (9a81f3b) to head (25f884b).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
providers/base/bin/kernel_config.py 98.14% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1715      +/-   ##
==========================================
+ Coverage   49.12%   49.19%   +0.06%     
==========================================
  Files         372      373       +1     
  Lines       40338    40392      +54     
  Branches     6809     6821      +12     
==========================================
+ Hits        19816    19869      +53     
  Misses      19799    19799              
- Partials      723      724       +1     
Flag Coverage Δ
provider-base 25.05% <98.14%> (+0.25%) ⬆️

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.

Copy link
Collaborator

@pieqq pieqq left a comment

Choose a reason for hiding this comment

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

Good call on creating an attachment to have a copy of the kernel config in each submission.

I've provided a few comments inline. I think Checkbox resource jobs can be used to skip the job instead of running it when not needed.

Comment on lines +56 to +60
print(
"Skipping: kernel version"
" {} is lower than {}.".format(kernel_version, min_version)
)
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't Checkbox mechanism be used to skip the job instead of passing the job with a "skipping..." comment?

To do this, you can use the uname resource job that would contain the version number, for instance. Then you could use this as a requirement (uname.release >= "6.8.0-20") to decide whether or not to skip the job.

Comment on lines +71 to +73
if "arm" in line:
print("Skipping: arm architecture detected.")
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, you could use the cpuinfo.platform resource information to skip if not x86_64.

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