Add parameter descriptions to struct kunit_attr header for the
parameters attr_default and print.
Fixes: 39e92cb1e4a1 ("kunit: Add test attributes API structure")
Reported-by: kernel test robot <lkp(a)intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308180127.VD7YRPGa-lkp@intel.com/
Signed-off-by: Rae Moar <rmoar(a)google.com>
---
lib/kunit/attributes.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/kunit/attributes.c b/lib/kunit/attributes.c
index 5e3034b6be99..1b512f7e1838 100644
--- a/lib/kunit/attributes.c
+++ b/lib/kunit/attributes.c
@@ -30,6 +30,8 @@ enum print_ops {
* attribute value
* @filter: function to indicate whether a given attribute value passes a
* filter
+ * @attr_default: default attribute value used during filtering
+ * @print: value of enum print_ops to indicate when to print attribute
*/
struct kunit_attr {
const char *name;
base-commit: 582eb3aeed2d06b122fba95518b84506d3d4ceb9
--
2.42.0.rc1.204.g551eb34607-goog
I ran all kernel selftests on some test machine, and stumbled upon
cachestat failing (among others).
Those patches fix the cachestat test compilation and run on older
kernels.
Also I found that the but-last test (on a normal file) fails when run on
a tmpfs mounted directory, as it happens on an initramfs-only system, or
when the current directory happens to be /dev/shm or /tmp:
# Create/open tmpfilecachestat
# Cachestat call returned 0
# Using cachestat: Cached: 4, Dirty: 4, Writeback: 0, Evicted: 0, Recently Evicted: 0
# Cachestat call (after fsync) returned 0
# Using cachestat: Cached: 4, Dirty: 4, Writeback: 0, Evicted: 0, Recently Evicted: 0
# Number of dirty should be zero after fsync.
not ok 6 cachestat fails with normal file
That same test binary succeeds on the same machine right afterwards if
the current directory is changed to an ext4 filesystem.
I don't really know if this is expected, and whether we should try to
figure out if the test file lives on a tmpfs filesystem, or whether the
test itself is not strict enough, and requires more "flushing"
(drop_caches?) to cover tmpfs directories as well.
Any ideas how to fix this would be appreciated.
Cheers,
Andre
Andre Przywara (3):
selftests: cachestat: properly link in librt
selftests: cachestat: use proper syscall number macro
selftests: cachestat: test for cachestat availability
tools/testing/selftests/cachestat/Makefile | 2 +-
.../selftests/cachestat/test_cachestat.c | 29 +++++++++++++++----
2 files changed, 25 insertions(+), 6 deletions(-)
--
2.25.1
Regressions that cause a device to no longer be probed by a driver can
have a big impact on the platform's functionality, and despite being
relatively common there isn't currently any generic test to detect them.
As an example, bootrr [1] does test for device probe, but it requires
defining the expected probed devices for each platform.
Given that the Devicetree already provides a static description of
devices on the system, it is a good basis for building such a test on
top.
This series introduces a test to catch regressions that prevent devices
from probing.
Patch 1 introduces a script to parse the kernel source using Coccinelle
and extract all compatibles that can be matched by a Devicetree node to
a driver. Patch 2 adds a kselftest that walks over the Devicetree nodes
on the current platform and compares the compatibles to the ones on the
list, and on an ignore list, to point out devices that failed to be
probed.
A compatible list is needed because not all compatibles that can show up
in a Devicetree node can be used to match to a driver, for example the
code for that compatible might use "OF_DECLARE" type macros and avoid
the driver framework, or the node might be controlled by a driver that
was bound to a different node.
An ignore list is needed for the few cases where it's common for a
driver to match a device but not probe, like for the "simple-mfd"
compatible, where the driver only probes if that compatible is the
node's first compatible.
Even though there's already scripts/dtc/dt-extract-compatibles that does
a similar job, it didn't seem to find all compatibles, returning ~3k,
while Coccinelle found ~11k. Besides that, Coccinelle actually parses
the C files, so it should be a more robust solution than relying on
regexes.
The reason for parsing the kernel source instead of relying on
information exposed by the kernel at runtime (say, looking at modaliases
or introducing some other mechanism), is to be able to catch issues
where a config was renamed or a driver moved across configs, and the
.config used by the kernel not updated accordingly. We need to parse the
source to find all compatibles present in the kernel independent of the
current config being run.
Feedback is very much welcome.
Thanks,
Nícolas
[1] https://github.com/kernelci/bootrr
Nícolas F. R. A. Prado (2):
scripts/dtc: Add script to extract matchable DT compatibles
kselftest: Add Devicetree unprobed devices test
scripts/dtc/extract-matchable-dt-compatibles | 33 +++++++++++
scripts/dtc/matchable_dt_compatibles.cocci | 58 +++++++++++++++++++
tools/testing/selftests/Makefile | 1 +
tools/testing/selftests/dt/.gitignore | 1 +
tools/testing/selftests/dt/Makefile | 17 ++++++
.../selftests/dt/compatible_ignore_list | 3 +
.../selftests/dt/test_unprobed_devices.sh | 58 +++++++++++++++++++
7 files changed, 171 insertions(+)
create mode 100755 scripts/dtc/extract-matchable-dt-compatibles
create mode 100644 scripts/dtc/matchable_dt_compatibles.cocci
create mode 100644 tools/testing/selftests/dt/.gitignore
create mode 100644 tools/testing/selftests/dt/Makefile
create mode 100644 tools/testing/selftests/dt/compatible_ignore_list
create mode 100755 tools/testing/selftests/dt/test_unprobed_devices.sh
--
2.41.0
When naively running all kselftests on some systems, it was observed
that the landlock selftest is quite picky and reports failures, even
though the system is fine.
Those two patches relax some tests to make them pass on older kernels:
- The landlock ABI version is only "3" in recent kernels, so patch 1/2
relaxes the test to accept other numbers.
- Older kernels or some defconfig based kernels might not implement
the landlock syscall at all. Patch 2/2 catches this.
I couldn't find an easy way to not check for the syscall availability in
*every* test in base_test.c, short of not using TEST_HARNESS_MAIN at all.
If someone has a better idea, I am all ears, especially as this approach
will get quite annoying in fs_base.c.
Cheers,
Andre
Andre Przywara (2):
selftests: landlock: allow other ABI versions
selftests: landlock: skip all tests without landlock syscall
tools/testing/selftests/landlock/base_test.c | 29 +++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
--
2.25.1