From patchwork Mon Nov 8 07:38:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Gongyi X-Patchwork-Id: 1552226 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HnjcP1rH2z9s1l for ; Mon, 8 Nov 2021 18:37:08 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 4DD9B3C7621 for ; Mon, 8 Nov 2021 08:37:06 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [217.194.8.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 0D1F23C702E for ; Mon, 8 Nov 2021 08:37:03 +0100 (CET) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id 00AEA1A004F6 for ; Mon, 8 Nov 2021 08:37:01 +0100 (CET) Received: from dggeml753-chm.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4HnjZL6pwtz8vFT for ; Mon, 8 Nov 2021 15:35:22 +0800 (CST) Received: from ubuntu1804.huawei.com (10.67.174.63) by dggeml753-chm.china.huawei.com (10.1.199.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.15; Mon, 8 Nov 2021 15:36:56 +0800 From: Zhao Gongyi To: Date: Mon, 8 Nov 2021 15:38:28 +0800 Message-ID: <20211108073828.33126-1-zhaogongyi@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.67.174.63] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggeml753-chm.china.huawei.com (10.1.199.152) X-CFilter-Loop: Reflected X-Virus-Scanned: clamav-milter 0.102.4 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=7.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH] lib/tst_test.c: add *cleanup() before exit X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" 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 Reviewed-by: Li Wang --- lib/tst_test.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.1 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); }