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 4DC2EC05027 for ; Mon, 20 Feb 2023 11:04:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231638AbjBTLEV (ORCPT ); Mon, 20 Feb 2023 06:04:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231674AbjBTLER (ORCPT ); Mon, 20 Feb 2023 06:04:17 -0500 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDA6013DCE for ; Mon, 20 Feb 2023 03:04:06 -0800 (PST) Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 694AB3F586 for ; Mon, 20 Feb 2023 11:04:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1676891044; bh=PQ/e3yix0m9X8IeKW6PjCOf86G2Z7hFs9Ie/f4F1ppE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jARpOUNcIkLbXx9McVsaMufnktMVBZesAkUzUBOVEN0IMN41a5c58sfuIqthfoMOq ZfU1aGNrM3D1vFWejdxmBKq9srfxMt8vLTQrwiBX2MawLUDlGnDC9XP7IfmabQMflC hlCieqzZsdETvHLbRhLpsfCWcjXKz/Pwxaeb7ihBHfrrUmNfNR2oOE7uyb95a4qaVE TVt0fuJHohthe3S2HkCqYI8R2qq/+OU6uhThyratA6YtIlRNkTtl3WwnNm+K1Wp5gc dsDtNujVGPnoKGxc6Cc3FafYz+BkCabw6yFkN7wdOKNdx4ERKxhYdn6tADaur5c/2x KU3rlRefGTtyQ== Received: by mail-ed1-f71.google.com with SMTP id ck7-20020a0564021c0700b004a25d8d7593so722618edb.0 for ; Mon, 20 Feb 2023 03:04:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PQ/e3yix0m9X8IeKW6PjCOf86G2Z7hFs9Ie/f4F1ppE=; b=D68bJmBhCj08LsZL03MB+ogX5kR0iVnkvZUA4Ec6XO4j/XBEC2FA+tDLEUcPP+oeGz Syhf3cFv2Ai2DNULsjh43f0L3JHy+8BU5gCg43m+PqohoC0yWbWMlxK7seQ3wb0kuWEM 1Q8JtJ0Zdjsf5QtvIEWNz2y80eRFoJbheUW5A2pGOyWD3wttMRcFSIb0jZ6UscLDv3KX p4Br5tu//sTjRlWrngeTGYkt87j/KGnrNfWbkg4V4izmhMHezQCmN+DtHiaSlXcne7TG gUzT1t96JlFfcs12UapTstmLhxyjmRIe+LQK7+HqOlwYPF05azZpF9J2qwJOh6Apen6f 2dgg== X-Gm-Message-State: AO0yUKVGm5dEifQFUM/oiBfcSkeEbNtK4qA9H3Q5Nm0ARZM/JlpIlBRF +9LiyA8T1J1LqceEA6oVb9PBc92aZzLeu4g1uiwHYqc3jfDGpwGZ1C3BvP0vMhBHUATqwHbrjsC 92HLpKm14u1bB55k9ot/msC32hQr4mTtY3XWU3iw4Ow== X-Received: by 2002:a17:907:6e87:b0:871:dd2:4af0 with SMTP id sh7-20020a1709076e8700b008710dd24af0mr11742885ejc.26.1676891043832; Mon, 20 Feb 2023 03:04:03 -0800 (PST) X-Google-Smtp-Source: AK7set9K9DWYKm6njTRouQU2LGApclEmMni7DIBij60SxRmB3n34Dr/nplqD3hOHz76k2PwAFJ+yyQ== X-Received: by 2002:a17:907:6e87:b0:871:dd2:4af0 with SMTP id sh7-20020a1709076e8700b008710dd24af0mr11742867ejc.26.1676891043606; Mon, 20 Feb 2023 03:04:03 -0800 (PST) Received: from work.lan (77-169-125-32.fixed.kpn.net. [77.169.125.32]) by smtp.gmail.com with ESMTPSA id b11-20020a1709062b4b00b008b147ad0ad1sm5582552ejg.200.2023.02.20.03.04.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 03:04:03 -0800 (PST) From: Roxana Nicolescu To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] selftest: fib_tests: Always cleanup before exit Date: Mon, 20 Feb 2023 12:04:00 +0100 Message-Id: <20230220110400.26737-2-roxana.nicolescu@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230220110400.26737-1-roxana.nicolescu@canonical.com> References: <20230220110400.26737-1-roxana.nicolescu@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 5637b5dadabd..70ea8798b1f6 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.34.1