[LTP] [PATCH v2 1/1] lib: Multiply slow config only for a real tests

Petr Vorel pvorel@suse.cz
Fri Jan 17 11:28:25 CET 2025


> Hi!
> > > This looks like there is something fundamentally wrong there. If there
> > > is a TST_NO_DEFAULT_MAIN defined in the test, the test does not call
> > > tst_run_tcases() and the timeout shouln't be set up.

> > FYI tst_test.c:510 safe_clone(): call tst_multiply_timeout()

> Found that one as well. I guess that we need to switch to tst_clone():

> diff --git a/testcases/lib/tst_ns_exec.c b/testcases/lib/tst_ns_exec.c
> index 6a8e39339..989bb8910 100644
> --- a/testcases/lib/tst_ns_exec.c
> +++ b/testcases/lib/tst_ns_exec.c
> @@ -100,7 +100,12 @@ int main(int argc, char *argv[])
>         for (i = 0; i < ns_fds; i++)
>                 SAFE_SETNS(ns_fd[i], 0);

> -       pid = SAFE_CLONE(&args);
> +       pid = tst_clone(&args);
> +       if (pid < 0) {
> +               printf("clone() failed");
> +               return 1;
> +       }
> +
>         if (!pid)
>                 SAFE_EXECVP(argv[3], argv+3);

Thanks, it works! Could you please merge it? Maybe update the comment?

-       .forks_child = 1, /* Needed by SAFE_CLONE */
+       .forks_child = 1, /* Needed by safe_clone() */

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Fixes: 893ca0abe7 ("lib: multiply the timeout if detect slow kconfigs")

Kind regards,
Petr



More information about the ltp mailing list