From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0D16BA46 for ; Tue, 7 Mar 2023 18:11:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E600C433D2; Tue, 7 Mar 2023 18:11:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678212677; bh=jW4Y9TXlQhbpL9v7g6GLu3u6A9yrmtr49rqyXC7ej3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MxiL+AnfueXibBG9HrWsZmT4XLuv+hGoYJXAaWR2fNymttiouEWSVQFcSlDjznhtP /b35ZLBRUh+k+QM8P/MFASvIBu2/Ds/OiCad5O2GssjYOAFWpYo2dq5Ueq58KcwqE6 SE/3Kgdl8CoYTs0MMdL+IgFkWPAgj3BxgeLDaoHA= 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 6.1 261/885] selftest: fib_tests: Always cleanup before exit Date: Tue, 7 Mar 2023 17:53:15 +0100 Message-Id: <20230307170013.358910361@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307170001.594919529@linuxfoundation.org> References: <20230307170001.594919529@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 5637b5dadabdb..70ea8798b1f60 100755 --- a/tools/testing/selftests/net/fib_tests.sh +++ b/tools/testing/selftests/net/fib_tests.sh @@ -2065,6 +2065,8 @@ EOF ################################################################################ # main +trap cleanup EXIT + while getopts :t:pPhv o do case $o in -- 2.39.2