[LTP] [PATCH v3 00/31] Add sysfs sanity tests

Li Wang li.wang@linux.dev
Fri Aug 28 10:32:58 CEST 2026


On Thu, Aug 27, 2026 at 01:21:26PM +0200, Cyril Hrubis wrote:
> This is a first bach of the sysfs sanity tests I've been working on
> recently.
> 
> The main goal of these tests is to make sure that these files contains
> expected data, e.g. files that are supposes to be boolean are 0 or 1,
> numeric files contain numbers, etc.
> 
> I've tried to make the code of the tests as clear as possible. Hence the
> first addition in this patchset is a library that implements common
> assertions for sysfs files to be done in a single line of a code.
> 
> Majority of these tests are just reading the files and checking that the
> content is sane. The exceptions are loop device, veth, tap tests that
> cerate virtual devices, which attributes can be changed freely.
> 
> v2:
> 
> Fixed all problems pointed out by Li and real problems by the LTP reviewer.
> 
> v3:
> 
> Fix for a CI compilation failure:
> 
>  - sys_net04 compilation on Leap 42.2
> 
> Fixes for issues found by OpenQA run by Peter:
> 
>  - sys_net04 use TST_RETRY_FUNC() for operstate
>  - sys_net02 use TST_RETRY_FUNC() for operstate
>  - sys_net01 make sure the we have a iface (directory) before run test
>  - sys_rtc01 use tst_is_virt() to multiply slack on VMs
>  - sys_cpu_topology02 use tst_is_virt() to relax package physical id checks
>  - sys_bdi01 max_bytes and min_bytes were added to 6.2
>  - sys_wakeup01 depend on CONFIG_PM_SLEEP=y
>  - sys_power01 In kernel lockdown disk state can be "disabled"
>  - sys_cpu_cache01 Report TCONF if no caches are exported
> 
> v4:
> 
>   - Added TST_SYSFS_TRY_OPENDIR() that handles ENOENT and produces
>     TCONF and hopefully finally fixed all possible missing directories
>     (e.g. hugepages could have been missing on ppc64le if lpar was
>     configured without support for them)
> 
>   - Fixed " vs `` in test doc spinx comments
> 
>   - Fixed copy&paste errors in tst_sysfs_assert.h
> 
>   - Fixed missing keywords in sys_cpu_vulnerabilities01 and sys_ata01
> 
>   - Fixed >= 0 vs != -1 in sys_net04

Patchset v4 looks good to me. I ran the tests and all passed on c9s, c10s,
and kernel v6.6 as well (x86_64 vm).

Feel free to add:

Reviewed-by: Li Wang <li.wang@linux.dev>
Tested-by: Li Wang <li.wang@linux.dev>


-- 
Regards,
Li Wang


More information about the ltp mailing list