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 99CBDC05027 for ; Mon, 20 Feb 2023 11:04:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231580AbjBTLES (ORCPT ); Mon, 20 Feb 2023 06:04:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229913AbjBTLEQ (ORCPT ); Mon, 20 Feb 2023 06:04:16 -0500 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 836C3A5F5 for ; Mon, 20 Feb 2023 03:04:04 -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-1.canonical.com (Postfix) with ESMTPS id 0D1FF3F71A for ; Mon, 20 Feb 2023 11:04:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1676891043; bh=8s2ZZvrSW+uH/rhz7pK/tGrl1ulPHLMkcDQleiMlk1E=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=nYqdSQyP9F1YGDhONpy5OxRcdiJn0GqrdRd+5J+YuO5NV2IjKm5LL3aqRKxVxE2UJ W3lROrRmUMGDWqYBfZxpjBNlSeNOAe/91YDHk/Dl7byB+uz7d4AoAyt4v6HihQfdu9 /+wML3UfyPm21kJ73TsqV7RsPOjfJuzq/J44clxus9cEbPz53O7LMFxNlLeLwQvX9l SSZ1zN49jjIdTo/QEQElP33eApS7juI2sY2mlER8I7IOclnQU1+hYnBgubKk1sY5PV G8tLM5thr/OpZW17p5oMICmfg5R/P/XQWCbMTGi6L2zzuVUZLeTZ8BoteAKAZ4EzND zgTR/fYgucnIw== Received: by mail-ed1-f71.google.com with SMTP id b1-20020aa7dc01000000b004ad062fee5eso1251490edu.17 for ; Mon, 20 Feb 2023 03:04:03 -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:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8s2ZZvrSW+uH/rhz7pK/tGrl1ulPHLMkcDQleiMlk1E=; b=KxKj9R3P2O+Qb+5RlrGMo0VuQkM0OHi657AMebTpOU7YvE29/r2FsPewv/y90veDTW CMAcxQ3H2/Yg3/HA3MHPrQLfE7HVuSJYCbP5vJ+ubttubynb1QwfrsXU+8OR76AFbP7W RXJTxzYz/GY1r4PUI6M89am66OOZIvbr40cbNMxHGno6SqK5+SkmclkIAgb6wrm4H4he ee6E8Mj2zILfzs6Tcsa+ijjItiKj+tanm5Rmz6RQJqPN60E2GgU9PnFKV970yUz983m+ 07hxVAisCojnGGE+HnrrRXqJvaMoNefS+y117n5asb1GIeg92GhzXzeaJGyy9pRV/Zbj RJ/g== X-Gm-Message-State: AO0yUKXzZh7k7aMhA0EXobBUjrcjJXKLog/9XFjuNQq8q4j7wCB2tupz mxTz5R58Wyan2PY8ExkqDxoFJl2T99AuE5g+WO5m8mRZx7xiKWb6jkURvuMJ3UO8uuunl2dXccy YB1M5QwmXsI+En7bJWpmI/bn7kUjAZncnN/kv0tRjDQ== X-Received: by 2002:a17:906:f88c:b0:8b2:8857:5963 with SMTP id lg12-20020a170906f88c00b008b288575963mr10167717ejb.8.1676891042743; Mon, 20 Feb 2023 03:04:02 -0800 (PST) X-Google-Smtp-Source: AK7set90wDqto+2q0VKKfX4TGmc7OSMp/t3KCccA9ptGYfkhYgpoWsEjZZzx//l8J+KfKcAh1aBtUg== X-Received: by 2002:a17:906:f88c:b0:8b2:8857:5963 with SMTP id lg12-20020a170906f88c00b008b288575963mr10167703ejb.8.1676891042503; Mon, 20 Feb 2023 03:04:02 -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.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 03:04:01 -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 0/1] selftest: fib_tests: Always cleanup before exit Date: Mon, 20 Feb 2023 12:03:59 +0100 Message-Id: <20230220110400.26737-1-roxana.nicolescu@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Usually when a subtest is executed, setup and cleanup functions are linearly called at the beginning and end of it. In some of them, `set -e` is used before executing commands. If one of the commands returns a non zero code, the whole script exists without cleaning up the resources allocated at setup. This can affect the next tests that use the same resources, leading to a chain of failures. To be consistent with other tests, calling cleanup function when the script exists fixes the issue. Steps to reproduce it: 1. Build with CONFIG_IP_ROUTE_MULTIPATH disabled. 2. Run net kselftest suite 3. fib_tests:fib_unreg_multipath_test fails when executing `ip -netns ns1 route add 203.0.113.0/24 nexthop via 198.51.100.2 dev dummy0 nexthop via 192.0.2.2 dev dummy1` because CONFIG_IP_ROUTE_MULTIPATH is disabled. This results in resources allocated during setup (e.g namespace ns1) not being cleaned up. 4. When icmp.sh tries to create namespace ns1 during its setup, it fails with the following error: Cannot create namespace file "/run/netns/ns1": File exists Roxana Nicolescu (1): selftest: fib_tests: Always cleanup before exit tools/testing/selftests/net/fib_tests.sh | 2 ++ 1 file changed, 2 insertions(+) -- 2.34.1