Re: [LTP] [PATCH v1 30/31] testcases: sysfs: Add sys_swap01
Cyril Hrubis <[email protected]>
| Newsgroups | it.linux.lists.ltp |
|---|---|
| Message-ID | <[email protected]> |
Hi! > > @@ -25,3 +25,4 @@ sys_block_size01 sys_block_size01 > > sys_hugepages01 sys_hugepages01 > > sys_hugepages02 sys_hugepages02 > > sys_ksm01 sys_ksm01 > > +sys_swap01 sys_swap01 > > This should be sys_mm_swap01; otherwise, the runtest file cannot > find the correct test to execute. Fixed. > > --- /dev/null > > +++ b/testcases/kernel/sysfs/kernel/mm/swap/sys_mm_swap01.c > > @@ -0,0 +1,32 @@ > > +// SPDX-License-Identifier: GPL-2.0-or-later > > +/* > > + * Copyright (c) 2026 Cyril Hrubis <[email protected]> > > + */ > > + > > +/*\ > > + * Sanity check for /sys/kernel/mm/swap/vma_ra_enabled. > > + * > > + * Unlike most other boolean sysfs tunables which use 0/1, this one is > > + * formatted as the strings "true" or "false", so it needs its own check > > + * rather than TST_SYSFS_ASSERT_BOOL(). > > + * > > + * The test skips with TCONF when the attribute is not present. > > + */ > > + > > +#include "tst_test.h" > > +#include "tst_sysfs_assert.h" > > + > > +#define VMA_RA "/sys/kernel/mm/swap/vma_ra_enabled" > > I suggest adding all of those path definitions to tst_path_defs.h > and unifying the common macro names. I didn't fix that one yet, since I wanted to send v2 today. If we agree that we want that I will fix this in subsequent versions or before applying. > Also, we need to add the sysfs/ directory to testcases/kernel/Makefile > so they can build successfully by default. > > --- a/testcases/kernel/Makefile > +++ b/testcases/kernel/Makefile > @@ -36,6 +36,7 @@ SUBDIRS += connectors \ > sched \ > security \ > sound \ > + sysfs \ > thermal \ > tracing \ > uevents \ > Fixed. -- Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp