Skip to content

Conversation

@PaulYuuu
Copy link
Contributor

@PaulYuuu PaulYuuu commented Nov 26, 2025

Add /lib/modules/{kernel_version}/build/.config as a configuration location to search for kernel config files. This is a common location where the kernel configuration is stored in the build directory.

Summary by CodeRabbit

  • Bug Fixes
    • Improved kernel configuration detection by expanding the search to include additional standard system locations, increasing the likelihood of finding and parsing the active kernel config. This should make kernel-related checks more reliable across more environments.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 26, 2025

Walkthrough

A new kernel config file location (/lib/modules/\{kernel_version\}/build/.config) was added to the list of search paths used by check_kernel_config in avocado/utils/linux_modules.py. The change only extends the set of config locations checked; no other logic or public interfaces were modified.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify /lib/modules/\{kernel_version\}/build/.config is a valid/standard location on supported targets.
  • Confirm kernel\_version substitution/formatting is correct and safe.
  • Check ordering/priority relative to existing search paths.
  • Ensure no redundancy with existing paths in the search list.

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a kernel build directory config path to the check_kernel_config function.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9d30e3e and 3bfce6b.

📒 Files selected for processing (1)
  • avocado/utils/linux_modules.py (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (45)
  • GitHub Check: rpm-build:epel-9-x86_64
  • GitHub Check: rpm-build:fedora-42-x86_64
  • GitHub Check: rpm-build:fedora-41-x86_64
  • GitHub Check: rpm-build:fedora-41-aarch64
  • GitHub Check: rpm-build:centos-stream-9-x86_64
  • GitHub Check: rpm-build:fedora-43-x86_64
  • GitHub Check: rpm-build:fedora-rawhide-x86_64
  • GitHub Check: rpm-build:fedora-41-ppc64le
  • GitHub Check: rpm-build:fedora-41-s390x
  • GitHub Check: rpm-build:fedora-41-ppc64le
  • GitHub Check: rpm-build:fedora-43-x86_64
  • GitHub Check: rpm-build:fedora-41-s390x
  • GitHub Check: rpm-build:centos-stream-9-x86_64
  • GitHub Check: rpm-build:epel-9-x86_64
  • GitHub Check: rpm-build:fedora-41-x86_64
  • GitHub Check: rpm-build:fedora-41-aarch64
  • GitHub Check: rpm-build:fedora-42-x86_64
  • GitHub Check: rpm-build:fedora-rawhide-x86_64
  • GitHub Check: Linux with Python 3.12
  • GitHub Check: Linux with Python 3.13
  • GitHub Check: Linux with Python 3.11
  • GitHub Check: Linux with Python 3.10
  • GitHub Check: Linux with Python 3.9
  • GitHub Check: rpm-build:fedora-42-x86_64
  • GitHub Check: rpm-build:fedora-41-x86_64
  • GitHub Check: rpm-build:fedora-rawhide-x86_64
  • GitHub Check: rpm-build:fedora-41-aarch64
  • GitHub Check: rpm-build:fedora-41-s390x
  • GitHub Check: rpm-build:epel-9-x86_64
  • GitHub Check: rpm-build:centos-stream-9-x86_64
  • GitHub Check: rpm-build:fedora-43-x86_64
  • GitHub Check: rpm-build:fedora-41-ppc64le
  • GitHub Check: Egg task ubuntu:24.04
  • GitHub Check: Egg task ubuntu:22.04
  • GitHub Check: Egg task debian:11.0
  • GitHub Check: Egg task debian:12.4
  • GitHub Check: Egg task fedora:40
  • GitHub Check: Podman spawner with 3rd party runner plugin
  • GitHub Check: Fedora selftests
  • GitHub Check: Version task ubuntu:22.04
  • GitHub Check: Version task debian:12.4
  • GitHub Check: macOS with Python 3.11
  • GitHub Check: Version task ubi:8.8
  • GitHub Check: Static checks
  • GitHub Check: Code Coverage (3.11)
🔇 Additional comments (1)
avocado/utils/linux_modules.py (1)

247-247: Add test coverage for the new kernel config location.

The path /lib/modules/{kernel_version}/build/.config is a valid location for custom kernel builds. Verify that the existing test suite has coverage for this new config location, and update tests if needed to ensure the expanded search path is properly validated.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mr-avocado mr-avocado bot moved this to Review Requested in Default project Nov 26, 2025
@PaulYuuu
Copy link
Contributor Author

Hello @richtja, this is a fix for kernel build from source code, please help to review, thanks.

ls /lib/modules/$(uname -r)/build/.config
/lib/modules/6.11.0+/build/.config

@PaulYuuu PaulYuuu changed the title feat: add kernel build directory config path to check_kernel_config fix: add kernel build directory config path to check_kernel_config Nov 26, 2025
@codecov
Copy link

codecov bot commented Nov 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.50%. Comparing base (4ff9e2c) to head (3bfce6b).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6244   +/-   ##
=======================================
  Coverage   73.50%   73.50%           
=======================================
  Files         206      206           
  Lines       22497    22497           
=======================================
  Hits        16536    16536           
  Misses       5961     5961           

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@richtja richtja self-requested a review November 26, 2025 12:18
@clebergnu
Copy link
Contributor

@PaulYuuu can you please rebase this so that it picks up the CI fixes? Thanks!

Add /lib/modules/{kernel_version}/build/.config as a configuration
location to search for kernel config files. This is a common location
where the kernel configuration is stored in the build directory.

Signed-off-by: Yihuang Yu <[email protected]>
@PaulYuuu
Copy link
Contributor Author

@PaulYuuu can you please rebase this so that it picks up the CI fixes? Thanks!

Hello @clebergnu, sure, I have updated. But still 2 failures not related to this PR.

  • test_timeout_when_condition_never_true: AssertionError: 0.7173380851745605 not less than 0.7, The performance of the GH machine is not quite good, for timing-sensitive/performance self tests, I would suggest remove them from GitHub CI check, causes even if we increase the time threshold to 0.8/0.9, it may also fail sometime, as it's not 100% reproducible.
  • job_timeout: AssertionError: 9 != 8 : Avocado did not return rc 8, this is also a performance issue, if the test send SIGTERM but the PassTest still setting up or running, so the Passtest cannot finish at 1s in the GH environment, then we will receive 9 instead of 8,

The runner catch all exception into error

except Exception as e:
queue.put(messages.StderrMessage.get(traceback.format_exc()))
queue.put(
messages.FinishedMessage.get(
"error",
fail_reason=str(e),
fail_class=e.__class__.__name__,
traceback=traceback.format_exc(),
)
)
, but with TestInterrupt, I assume we should handle it gracefully like

  except TestInterrupt as e:
      queue.put(
          messages.FinishedMessage.get(
              "interrupted",
              fail_reason=str(e),
          )
      )
  except Exception as e:

This is another topic, I also meet some failure in the pyproject migration, we should fix them 1 by 1.

Copy link
Contributor

@richtja richtja left a comment

Choose a reason for hiding this comment

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

Hi @PaulYuuu, it LGTM. Thank you

@richtja richtja merged commit 8d05e73 into avocado-framework:master Dec 16, 2025
64 of 66 checks passed
@github-project-automation github-project-automation bot moved this from Review Requested to Done 113 in Default project Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done 113

Development

Successfully merging this pull request may close these issues.

3 participants