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

Driver tests based on sysfs/bus/*/devices aren't future proof #55

Open
r-c-n opened this issue Mar 14, 2023 · 2 comments
Open

Driver tests based on sysfs/bus/*/devices aren't future proof #55

r-c-n opened this issue Mar 14, 2023 · 2 comments

Comments

@r-c-n
Copy link

r-c-n commented Mar 14, 2023

There are quite a few KernelCI regression reports from time to time that point to the same basic bootrr tests based on assert_device_present. These tests rely on sysfs nodes that aren't meant to be used as a stable ABI, so some changes like driver or device file renames and DT re-structuring can make these tests fail when, in fact, they shouldn't be considered as regressions.

Here's a recent example: https://groups.io/g/kernelci-results/message/39167 (this one is based on the KernelCI fork of bootrr)
Introduced by this patch: https://lore.kernel.org/all/[email protected]/

Fixing these tests to comply with the current changes or to run different checks depending on the kernel version seems more like a temporary workaround than a proper fix.

Do you think there'll be a better way to test this type of things in the future? Any suggestions from your side?

Here's a related discussion with a bit more background on this: https://lore.kernel.org/lkml/5095423.31r3eYUQgx@diego/

Thanks

@r-c-n
Copy link
Author

r-c-n commented Mar 15, 2023

Here's another similar failure, this time after a patch affecting PCIe enumeration: https://groups.io/g/kernelci-results/message/38558
Patch: http://lore.kernel.org/all/[email protected]/

@nfraprado
Copy link
Contributor

nfraprado commented Sep 7, 2023

I have a series on the kernel mailing list adding a kselftest that checks for device probe based on the Devicetree currently in use: https://lore.kernel.org/all/[email protected] . That should make most assert_device_present and assert_driver_present tests unnecessary. Since this DT kselftest relies on the DT and stable properties (compatibles) it should also be future-proof.

However that kselftest doesn't cover ACPI-based platforms, nor devices probed from discoverable busses like PCI and USB. For PCI and USB devices, checking for them statically in bootrr still seems to be the way to go. For that reason I have just opened a PR: #60 introducing a helper for testing USB devices only relying on documented ABI, as to make the tests future-proof. I intend to do the same for PCI.

@andersson Let me know if you have any feedback on the kernel series or the USB bootrr test.

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

No branches or pull requests

2 participants