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 186C98489 for ; Fri, 10 Mar 2023 14:16:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9232BC433D2; Fri, 10 Mar 2023 14:16:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678457806; bh=3AP2ffMQ3SuMsK+DrdXZvcZxoaw1M3EGXEmz/jf9NfI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sRA70ZcZkOY8JAiPf+zxyc3oPaPT64Qnu30asxmdDJnM+ewNwRzUkZaEFRIlFZOpS QkroMvh2PtAne0A5170MiSnMrnAkbYZM/5+pA4c7EhjtbwoPSjV2VVnn35HZCnCC30 uyts9HA6fi/cBtSRVZLTMbd2jyi6vz5KG+uQwMLo= 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 4.19 065/252] selftest: fib_tests: Always cleanup before exit Date: Fri, 10 Mar 2023 14:37:15 +0100 Message-Id: <20230310133720.803704226@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310133718.803482157@linuxfoundation.org> References: <20230310133718.803482157@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 a5ba149761bf9..f34e14e34d0d4 100755 --- a/tools/testing/selftests/net/fib_tests.sh +++ b/tools/testing/selftests/net/fib_tests.sh @@ -1379,6 +1379,8 @@ EOF ################################################################################ # main +trap cleanup EXIT + while getopts :t:pPhv o do case $o in -- 2.39.2