All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/2] tst_test: Add $LTP_SINGLE_ITERATION to limit variant
Date: Mon, 24 Feb 2025 19:00:57 +0100	[thread overview]
Message-ID: <20250224180057.GA2897036@pevik> (raw)
In-Reply-To: <Z7yNVQAnQ5NPTtaz@yuki.lan>

Hi Cyril,
> Hi!
> >  	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

> Can we instead add a function that would set two integer variables,
> first_variant and last variant as:

> static void setup_variants(unsigned int *first_variant, unsigned int *last_variant)
> {
> 	//setup the defaults and parse the variables here
> }

Sure, I'll send v2 if you see the patch useful (Li was not sure if this is
useful).

> And the we can do:

> diff --git a/lib/tst_test.c b/lib/tst_test.c
> index e2803f04a..d19fe9aba 100644
> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -1885,7 +1885,7 @@ unsigned int tst_variant;
>  void tst_run_tcases(int argc, char *argv[], struct tst_test *self)
>  {
>         int ret = 0;
> -       unsigned int test_variants = 1;
> +       unsigned int first_variant, last_variant;
>         struct utsname uval;

>         lib_pid = getpid();
> @@ -1908,10 +1908,9 @@ void tst_run_tcases(int argc, char *argv[], struct tst_test *self)

>         set_overall_timeout();

> -       if (tst_test->test_variants)
> -               test_variants = tst_test->test_variants;
> +       setup_variants(&first_variant, &last_variant);

> -       for (tst_variant = 0; tst_variant < test_variants; tst_variant++) {
> +       for (tst_variant = first_variant; tst_variant <= last_variant; tst_variant++) {
>                 if (tst_test->all_filesystems || count_fs_descs() > 1)
>                         ret |= run_tcases_per_fs();
>                 else
> diff --git a/testcases/kernel/syscalls/pause/pause01.c b/testcases/kernel/syscalls/pause/pause01.c
> index adce0ddcf..74a7e514e 100644
> --- a/testcases/kernel/syscalls/pause/pause01.c
> +++ b/testcases/kernel/syscalls/pause/pause01.c
> @@ -20,6 +20,8 @@ static void do_child(void)
>         SAFE_SIGNAL(SIGINT, sig_handler);
>         TST_EXP_FAIL(pause(), EINTR);
>         TST_CHECKPOINT_WAKE(0);
> +
> +       tst_res(TPASS, "Process resumed from pause()");

I guess this is part of some other work, right? (there is no TST_EXP_FAIL() in
pause01.c).

Kind regards,
Petr

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

  reply	other threads:[~2025-02-24 18:01 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 [this message]
2025-02-24 18:46     ` Cyril Hrubis
2025-02-25  8:02       ` Petr Vorel
2026-04-16  7:01 ` Petr Vorel
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=20250224180057.GA2897036@pevik \
    --to=pvorel@suse.cz \
    --cc=chrubis@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.