[LTP] [PATCH] lib/tst_test.c: add *cleanup() before exit

Li Wang liwang@redhat.com
Mon Nov 8 10:08:43 CET 2021


On Mon, Nov 8, 2021 at 3:37 PM Zhao Gongyi <zhaogongyi@huawei.com> wrote:

> If the main process exit without *cleanup() and when the lib process
> has exit, the test environment would not be reset when the testcase
> needs resource of device or tmpfs.
>
> Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com>
>

Reviewed-by: Li Wang <liwang@redhat.com>


> ---
>  lib/tst_test.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/lib/tst_test.c b/lib/tst_test.c
> index 02ae28335..4c7e3a97b 100644
> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -1226,6 +1226,8 @@ static void heartbeat(void)
>                  * We need kill the task group immediately since the
>                  * main process has exit.
>                  */
> +               do_test_cleanup();
> +               do_cleanup();
>                 kill(0, SIGKILL);
>                 exit(TBROK);
>         }
> --
> 2.17.1
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>
>

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20211108/ce2801ef/attachment-0001.htm>


More information about the ltp mailing list