public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/2] tst_test: Add $LTP_SINGLE_ITERATION to limit variant
Date: Thu, 16 Apr 2026 09:01:28 +0200	[thread overview]
Message-ID: <20260416070128.GA286748@pevik> (raw)
In-Reply-To: <20250224100016.2857704-1-pvorel@suse.cz>

Hi,

> Allow to test only single struct tst_test->test_variants.
> This is a similar feature to $LTP_SINGLE_FS_TYPE.

> Value is ignored when test does not specify test_variants.
> When value is higher than test_variants value lastest variant is used.

Gently ping for this patch. IMHO it can be useful in some corner case debugging.

Kind regards,
Petr

> 	# LTP_SINGLE_VARIANT=0 LTP_SINGLE_FS_TYPE=ext4 ./getdents02
> 	..
> 	tst_test.c:1918: TINFO: WARNING: testing only variant 0 of 3
> 	tst_supported_fs_types.c:161: TINFO: WARNING: testing only ext4
> 	tst_supported_fs_types.c:97: TINFO: Kernel supports ext4
> 	tst_supported_fs_types.c:62: TINFO: mkfs.ext4 does exist
> 	tst_test.c:1834: TINFO: === Testing on ext4 ===
> 	tst_test.c:1171: TINFO: Formatting /dev/loop0 with ext4 opts='' extra opts=''
> 	mke2fs 1.47.2 (1-Jan-2025)
> 	tst_test.c:1183: TINFO: Mounting /dev/loop0 to /tmp/LTP_getx2HrGH/mntpoint fstyp=ext4 flags=0
> 	getdents.h:148: TINFO: Testing the SYS_getdents syscall
> 	tst_buffers.c:57: TINFO: Test is using guarded buffers
> 	getdents02.c:77: TPASS: fd=-5 dirp=0x7f0587803ee9 size=279 : EBADF (9)
> 	getdents02.c:77: TPASS: fd=3 dirp=0x5641617a31e8 size=1 : EINVAL (22)
> 	getdents02.c:77: TPASS: fd=4 dirp=0x7f0587803ee9 size=279 : ENOTDIR (20)
> 	getdents02.c:77: TPASS: fd=5 dirp=0x7f0587803ee9 size=279 : ENOENT (2)
> 	getdents02.c:77: TPASS: fd=3 dirp=0x7f0587802000 size=279 : EFAULT (14)

> 	# LTP_SINGLE_VARIANT=2 LTP_SINGLE_FS_TYPE=ext4 ./getdents02
> 	...
> 	tst_test.c:1918: TINFO: WARNING: testing only variant 2 of 3
> 	tst_supported_fs_types.c:161: TINFO: WARNING: testing only ext4
> 	tst_supported_fs_types.c:97: TINFO: Kernel supports ext4
> 	tst_supported_fs_types.c:62: TINFO: mkfs.ext4 does exist
> 	tst_test.c:1834: TINFO: === Testing on ext4 ===
> 	tst_test.c:1171: TINFO: Formatting /dev/loop0 with ext4 opts='' extra opts=''
> 	mke2fs 1.47.2 (1-Jan-2025)
> 	tst_test.c:1183: TINFO: Mounting /dev/loop0 to /tmp/LTP_getWtBnGE/mntpoint fstyp=ext4 flags=0
> 	getdents.h:157: TCONF: libc getdents() is not implemented

> 	# LTP_SINGLE_VARIANT=99 LTP_SINGLE_FS_TYPE=ext4 ./getdents02 # higher value is max value
> 	tst_test.c:1918: TINFO: WARNING: testing only variant 3 of 3
> 	tst_supported_fs_types.c:161: TINFO: WARNING: testing only ext4
> 	tst_supported_fs_types.c:97: TINFO: Kernel supports ext4
> 	tst_supported_fs_types.c:62: TINFO: mkfs.ext4 does exist
> 	tst_test.c:1834: TINFO: === Testing on ext4 ===
> 	tst_test.c:1171: TINFO: Formatting /dev/loop0 with ext4 opts='' extra opts=''
> 	mke2fs 1.47.2 (1-Jan-2025)
> 	tst_test.c:1183: TINFO: Mounting /dev/loop0 to /tmp/LTP_get1fX70n/mntpoint fstyp=ext4 flags=0
> 	getdents.h:162: TINFO: Testing libc getdents64()
> 	tst_buffers.c:57: TINFO: Test is using guarded buffers
> 	getdents02.c:77: TPASS: fd=-5 dirp=0x7fcf140f3ee8 size=280 : EBADF (9)
> 	getdents02.c:77: TPASS: fd=3 dirp=0x55a76e4531e8 size=1 : EINVAL (22)
> 	getdents02.c:77: TPASS: fd=4 dirp=0x7fcf140f3ee8 size=280 : ENOTDIR (20)
> 	getdents02.c:77: TPASS: fd=5 dirp=0x7fcf140f3ee8 size=280 : ENOENT (2)
> 	getdents02.c:77: TPASS: fd=3 dirp=0x7fcf140f2000 size=280 : EFAULT (14)

> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Hi all,

> Andrea wanted to run only single variant.

> Kind regards,
> Petr

>  lib/tst_test.c | 17 ++++++++++++++---
>  1 file changed, 14 insertions(+), 3 deletions(-)

> diff --git a/lib/tst_test.c b/lib/tst_test.c
> index 3823ea109e..6edc310209 100644
> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -581,6 +581,7 @@ static void print_help(void)
>  	fprintf(stderr, "LTP_DEV              Path to the block device to be used (for .needs_device)\n");
>  	fprintf(stderr, "LTP_DEV_FS_TYPE      Filesystem used for testing (default: %s)\n", DEFAULT_FS_TYPE);
>  	fprintf(stderr, "LTP_SINGLE_FS_TYPE   Testing only - specifies filesystem instead all supported (for .all_filesystems)\n");
> +	fprintf(stderr, "LTP_SINGLE_VARIANT   Testing only - specifies tst_variant to be run\n");
>  	fprintf(stderr, "LTP_TIMEOUT_MUL      Timeout multiplier (must be a number >=1)\n");
>  	fprintf(stderr, "LTP_RUNTIME_MUL      Runtime multiplier (must be a number >=1)\n");
>  	fprintf(stderr, "LTP_VIRT_OVERRIDE    Overrides virtual machine detection (values: \"\"|kvm|microsoft|xen|zvm)\n");
> @@ -1887,6 +1888,7 @@ void tst_run_tcases(int argc, char *argv[], struct tst_test *self)
>  	int ret = 0;
>  	unsigned int test_variants = 1;
>  	struct utsname uval;
> +	const char *only_variant;

>  	lib_pid = getpid();
>  	tst_test = self;
> @@ -1899,7 +1901,6 @@ void tst_run_tcases(int argc, char *argv[], struct tst_test *self)

>  	tst_res(TINFO, "LTP version: "LTP_VERSION);

> -
>  	uname(&uval);
>  	tst_res(TINFO, "Tested kernel: %s %s %s", uval.release, uval.version, uval.machine);

> @@ -1908,10 +1909,20 @@ void tst_run_tcases(int argc, char *argv[], struct tst_test *self)

>  	set_overall_timeout();

> -	if (tst_test->test_variants)
> +	if (tst_test->test_variants) {
>  		test_variants = tst_test->test_variants;
> +		only_variant = getenv("LTP_SINGLE_VARIANT");
> +		if (only_variant && only_variant[0] != '\0') {
> +			tst_variant = MIN(SAFE_STRTOL((char *)only_variant, 0, INT_MAX),
> +							  test_variants - 1);
> +			tst_res(TINFO, "WARNING: testing only variant %d of %d",
> +					tst_variant, test_variants - 1);
> +			test_variants = tst_variant + 1;
> +		}
> +	}
> +
> +	for (; tst_variant < test_variants; tst_variant++) {

> -	for (tst_variant = 0; tst_variant < test_variants; tst_variant++) {
>  		if (tst_test->all_filesystems || count_fs_descs() > 1)
>  			ret |= run_tcases_per_fs();
>  		else

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2026-04-16  7:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24 10:00 [LTP] [PATCH 1/2] tst_test: Add $LTP_SINGLE_ITERATION to limit variant Petr Vorel
2025-02-24 10:00 ` [LTP] [PATCH 2/2] tst_supported_fs_types: Ignore empty $LTP_SINGLE_FS_TYPE value Petr Vorel
2025-02-24 10:11 ` [LTP] [PATCH 1/2] tst_test: Add $LTP_SINGLE_ITERATION to limit variant Li Wang
2025-02-24 10:21   ` Petr Vorel
2025-02-24 10:32     ` Li Wang
2025-02-24 13:52       ` Petr Vorel
2025-02-24 10:22 ` Petr Vorel
2025-02-24 12:29 ` Andrea Cervesato via ltp
2025-02-24 15:16 ` Cyril Hrubis
2025-02-24 18:00   ` Petr Vorel
2025-02-24 18:46     ` Cyril Hrubis
2025-02-25  8:02       ` Petr Vorel
2026-04-16  7:01 ` Petr Vorel [this message]
2026-04-16  7:25   ` Andrea Cervesato via ltp
2026-04-16  8:19   ` Li Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260416070128.GA286748@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox