From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4A35C64EC4 for ; Fri, 10 Mar 2023 14:31:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232466AbjCJObp (ORCPT ); Fri, 10 Mar 2023 09:31:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232554AbjCJOba (ORCPT ); Fri, 10 Mar 2023 09:31:30 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E9A4F8290 for ; Fri, 10 Mar 2023 06:30:41 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C451CB822DA for ; Fri, 10 Mar 2023 14:30:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22C39C433D2; Fri, 10 Mar 2023 14:30:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678458638; bh=Bf55X8+gsvIs72BtaogHGyQPCnqaSXX1aDuXTdi5k/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v5F4clvPwGWAS/Z4LxHRFwsm+NPhnA3qXOkL//773QTScra1tSTrfriv9JprBl4ps nrtvmiLeUaOLgJ3W5x4Xjx/nyyF236u78tF9BzBGHxitV100Vu8oOhcNTlt9/tPs1m GJrsv+1j351IGMK+ktl0SU9ZRX2GnK8pQjVc+OP0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Roxana Nicolescu , Paolo Abeni , Sasha Levin Subject: [PATCH 5.4 095/357] selftest: fib_tests: Always cleanup before exit Date: Fri, 10 Mar 2023 14:36:24 +0100 Message-Id: <20230310133738.196010755@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310133733.973883071@linuxfoundation.org> References: <20230310133733.973883071@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Roxana Nicolescu [ Upstream commit b60417a9f2b890a8094477b2204d4f73c535725e ] Usage of `set -e` before executing a command causes immediate exit on failure, without cleanup up the resources allocated at setup. This can affect the next tests that use the same resources, leading to a chain of failures. A simple fix is to always call cleanup function when the script exists. This approach is already used by other existing tests. Fixes: 1056691b2680 ("selftests: fib_tests: Make test results more verbose") Signed-off-by: Roxana Nicolescu Link: https://lore.kernel.org/r/20230220110400.26737-2-roxana.nicolescu@canonical.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- tools/testing/selftests/net/fib_tests.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh index 6986086035d6c..24d67fa66d037 100644 --- a/tools/testing/selftests/net/fib_tests.sh +++ b/tools/testing/selftests/net/fib_tests.sh @@ -1662,6 +1662,8 @@ EOF ################################################################################ # main +trap cleanup EXIT + while getopts :t:pPhv o do case $o in -- 2.39.2