From patchwork Wed Jan 24 17:02:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Poirier X-Patchwork-Id: 765842 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2085.outbound.protection.outlook.com [40.107.244.85]) (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 3155E42A93; Wed, 24 Jan 2024 17:03:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.85 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706115827; cv=fail; b=MfZ86xOX0AZf0jUNv3IBQPQ00uEnCIsD1MoirvEXm/9M6YROjNvkZJQvR4F4mKbKtCSUdkKGf89gQYdlfVcqyL3+BVXdlp5oFCo9tSDNEH++soV53whiYB64WfeCpI65pYQyhtRmOjUYkxHKMzVNS0UMKPeV6IBUubx/MTZzjc0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706115827; c=relaxed/simple; bh=YSQhDJykU47Owc6qfhe1aVsTLaFEYEGR0vpmqBkes9U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=k/dggkbkUg5kdqyzRT5p9D9FVrjXTq6YhyUE+4QkRkez3zhM6mFQcmBBxl41UoWGuizNaUD9Q77M4xUuvylodjRXaMLqjRxIw5ZVzyvL/8p36kchYegi1n4/7s1/DRaX/JD+5/xZ5/N6CovBvbrAaB60SAOzpAY1O5a69QYBEDM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=YutR+70b; arc=fail smtp.client-ip=40.107.244.85 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="YutR+70b" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QFkxY7yDS1IeDIl5ryj9NJu+eJo5sAJG/awGPrEd2UH+DYxKoaUauxDU9ZB5yGzN2oDwyOn/bsQ5rTGQQnGz2ILlBloclW25O/JfzpdzJ7Zk9fGMIX2J1iF9EVczN2G0rkiNjs65eT5Bb3JCycAV39PIPtBLqSE+28rZIhFeahLp/GJ1CyYfpC6UtM8LTv7kDhZjoX0wKeOaijTQ75+9JdeTBws7wGkuq1NqVX9qg/8LkHEiOshWkfSMTkVhrsvhJXw6PpJYnfsQZEVFhgtPfU+TWU74recha/6Knz61zUEolzQ5xq+OX4e27gLhpZxAJE2psgqnidPT4tHt8e3GXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/IUOox1IeoJ8tugTQ4s5DY7/8kWj6L/sephbyGHdHuA=; b=Ruhb09TWAO1m7DxvtxMRgLZgP/6+PsVBjxPEcH5hmuZRbBW9pEjqw6vMTm/tWfDyNJr6dNk9wgtp2oWW4QAz4wPEu2PpI9eqjXERLGShiDVIsdAkVQD4e3hLUTulN2cxIQMgQGP5ggUsuv1pyunQwQBc85IkkFBSezpcAtNgQfGzbl+ZE4cmWg/W1VEXujlSa4r6pyYsLwueO6WugJtvjEPZAN0Ruop2B04Vx00hyMO0VBJRyzxpCv+4dKFKuIIOB7YxTETUGwm229Xz+k/PtKnfKuA7pMg6QrHtw9RhxsITZwPuZEJTp31TzDu1gIB3iKeu7UQc9VPPRaEEiQ/s2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/IUOox1IeoJ8tugTQ4s5DY7/8kWj6L/sephbyGHdHuA=; b=YutR+70bnoc1RXj2WIbOB5/Sz8CT1QplhKaad50eZiUMcH5gdEQB1S0WVDIN0qFhHlTntfJHCcBHRJbfhqlTDwZiMP7Rl+x2JiArhH0x9N80e5I0vezeY2/zEorVLORfqMwemq8MQXkccpgabDNOqgEDcmkUqmFfI1Q6BnYt5nGnZA0G9pDQjxYdnxJMDJiNAkM7IwyCH7uusP3veahAeCUCj9+ynvHKN02k2eg9mRcxJTBugdeXAmCIln2yvnHObdbG59O/LThuQITfLgzdBXNWZ7gtQH17d7UMKtCpWXhusRelDZ296+kqwOFGyE+T0tSaunolcJ3g77S1uTsKJg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MN2PR12MB4373.namprd12.prod.outlook.com (2603:10b6:208:261::8) by DS7PR12MB5935.namprd12.prod.outlook.com (2603:10b6:8:7e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Wed, 24 Jan 2024 17:02:47 +0000 Received: from MN2PR12MB4373.namprd12.prod.outlook.com ([fe80::ff68:f81b:d451:9765]) by MN2PR12MB4373.namprd12.prod.outlook.com ([fe80::ff68:f81b:d451:9765%4]) with mapi id 15.20.7228.023; Wed, 24 Jan 2024 17:02:45 +0000 From: Benjamin Poirier To: netdev@vger.kernel.org Cc: Shuah Khan , Jonathan Corbet , Jay Vosburgh , Andy Gospodarek , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Petr Machata , Danielle Ratson , Nikolay Aleksandrov , Ido Schimmel , Johannes Nixdorf , Davide Caratti , Tobias Waldekranz , Zahari Doychev , Hangbin Liu , linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH net-next 1/6] selftests: Introduce Makefile variable to list shared bash scripts Date: Wed, 24 Jan 2024 12:02:17 -0500 Message-ID: <20240124170222.261664-2-bpoirier@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124170222.261664-1-bpoirier@nvidia.com> References: <20240124170222.261664-1-bpoirier@nvidia.com> X-ClientProxiedBy: YQBPR01CA0072.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:2::44) To MN2PR12MB4373.namprd12.prod.outlook.com (2603:10b6:208:261::8) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR12MB4373:EE_|DS7PR12MB5935:EE_ X-MS-Office365-Filtering-Correlation-Id: 42f01260-ba35-44bf-a252-08dc1cfe48f4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uKTV0awXoRqXQF7YbJ1XikWZTIgNkm8QiKSLckRHeGKZ4nXjFLPnWqroY3raKR+rSM6U0OFUzXB3MYjMSAdBHn72s8toS9E8165J8WEwwxgt30kRK6hl/EHok9ndaxq/DJdpVYMWcZR/HWJwgQWO1uqHzjjQK/DXr9gO/eS+dx8oOe1uu+pNNymquxxUzpZaisCRweW1in/H1q37yzDE7fLFjuMw+3uvHkrAl0A9B4ieuuYNctzhIxujvFr6thpXWH8tzO9O1IaXuXfM0VVQfvclIEGcOuiiigHf1ZqWza8BEbm0NWPeJxA1Pi2vPLkGK8DeRFlsL+FxcFF4x0bYk1MjRl386k/mIlI7Xo+bEte3gPRum8QYmrT6LE1BtyreIQal4QTPpjQJuF08YTPtAkZG9MfTpgEdJkUZES+2z6KFZE193T+bHya7m0kAPKz0smcg5CeyQpOvxUr+4s8EblcTf+IdG9ViyrfG7NGoeGuk4eK90tlE8U5UMsATrLTrqwE1tSw1O6WAmGpjS7Y1ndXJpnq30GEztG2r4688pAiiOuBPS0qxgTJNfLLFHWg7 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR12MB4373.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(396003)(136003)(366004)(376002)(39860400002)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(2906002)(7416002)(5660300002)(6916009)(66946007)(66556008)(66476007)(54906003)(316002)(4326008)(8936002)(8676002)(478600001)(6512007)(6486002)(36756003)(38100700002)(86362001)(1076003)(26005)(6666004)(2616005)(83380400001)(41300700001)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5TyNqFH8giMzvpZmUaaoiVzC+A6TcvzBN1Bji+OeN7oCJHVau3rrCo2f69iBEf9uXjZhLE6h7d8pfL8ycaGfr7Ak7B9uvlMLLUkn1o0PsqZxajVtJ4N3dlLSbEeP9gAMvhK9ApwLbg+Xcvx7CPEuUgJIX5iNl//QCyQ9upFVnSRf6Ur/afyLkQ+bKceDbLxEf8KF6lIkHJfV92d6QfbikaJhiMTA0qu9h1WA0TpnwIPIV3nfueuaCjtT/oCPsXGoSWwRDtOULYQmHX29BHiW7VFwE8JsJzBR9ShGdTYvYnztA4PqgUVT1fYdFJlHUWuNQwrvdXHGH1hnqvpHoG5CpbhDuxzUiTPT/QnOnPK6oaT8cFt2act5uAHWUzemidd/xtLF5lhJWU9Ynke0U+TDQn7vcKwkt4KEeG+WficoI8lpySakLFve6ObnLGBvvdkujsSBBV5UUKwlieFbMNyisnUCGBXGoRbeXxYUmeErsicf4HeOtS9zZdfjN0wqh1JXiBOch1IPZ7M2EOhBHEKz9Heh6Z2GuVm99rsZIRmgDJm6JBKuULaC+ZzSAk/6Pu6iZArcS3YE8ikC+m5DZZQfMK0XUCjXXvrTjZDV2PnzyRsY/7qPWYwTksIrZ1sj9zcQalgzIPu5AfWG2Cn7EzifNePBDWLXHPWkFRd9D6GBhylJNCBPBM8Zk430Qrca1bIHVqB5h9tAZP1j2UfZ6oGB+WK0UTMS4mR4kXqYy46AU3CkRQ4nnhPgfHS5korqclJtbQiWSOsPCHnLWJlV9WIs5EmseNb0EkWM9caLbmHQKiC01xF6G/g9W86T/RH1GY/JbLrBEIIKNNEC6PQkQNEoInN6irfT3njqAu90rCU8t1t5ZEWuyprgV7RreKDQYP5mLAERXpMMj1LFDLsIQXX2fHRSb+qdwoMQzYB1J6OMeWn9DPKpRKYt1OBhQCxfVqF8diHNVoh0zKJnDI4ZRGsmWCRch07tQ98qJJLMvsAO00VTRmN62ugym93bTc2cEglooBkqflDtm5uRfceF5BH4sDnt+Nmcrnzxybt/tHdnlLuQwWPdhmRRVJN/omIfsdV4iQXfbyCzZMhP65lnfqEeO19eVPWDhCGj9jEVIwV9FfqvrUx1V0O1NpLRFM4WU5ks46oZx2UkWbMKtbwzY8/u0PCoKM8p7DI4QtTOqnnbjYCcJUr+2SCZKovEIFsioHT7NWmjfxzbbIUEF8Cwn97zT9ZngIdmRs6Vhg835uWCJisInircGfELjUVpgI+xfxn8k0KqLtqIqH6ZXbKj2bO6iHMbS/imwxxY1iYrhyFO5uKShNkBR8UrnB4mLgRYWQlPcybLrlJkQ1jRqXkK/G8EFdAquciYrd9HjwCw+F7/S0oqNzkfjWYk3C1HzVXUQIEy/a8UWDUibikbJRQHb/ELJtDeAIxznrGxlI1ir6FVSdhFBiYackxHd0ruDMJDzuYopCaUi8DzKZx0uYigqOS2kAwFWmL7d3d9Tbw23A5exm6wFIzX+EQIIf7C8jmKGCDX2IQaaJdDPQRi6r/GJvfxHmMkDbsPdBELgphI2NHqCgTsKQuOtLhHLwTyfWvXUxIh X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 42f01260-ba35-44bf-a252-08dc1cfe48f4 X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2024 17:02:45.2766 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: L8OVHDAG0/Ffe25ix/CH4JcPa7MMuhqdG9JXEfAzH0cQkYOWY09vlsW2XTiV6t7ozCKxhkuAyO2tDF9l6Him2g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5935 Some tests written in bash source other files in a parent directory. For example, drivers/net/bonding/dev_addr_lists.sh sources net/forwarding/lib.sh. If a subset of tests is exported and run outside the source tree (for example by using `make -C tools/testing/selftests gen_tar TARGETS="drivers/net/bonding"`), these other files must be made available as well. Commit ae108c48b5d2 ("selftests: net: Fix cross-tree inclusion of scripts") addressed this problem by symlinking and copying the sourced files but this only works for direct dependencies. Commit 25ae948b4478 ("selftests/net: add lib.sh") changed net/forwarding/lib.sh to source net/lib.sh. As a result, that latter file must be included as well when the former is exported. This was not handled and was reverted in commit 2114e83381d3 ("selftests: forwarding: Avoid failures to source net/lib.sh"). In order to allow reinstating the inclusion of net/lib.sh from net/forwarding/lib.sh, add a mechanism to list dependent files in a new Makefile variable and export them. This allows sourcing those files using the same expression whether tests are run in-tree or exported. Dependencies are not resolved recursively so transitive dependencies must be listed in TEST_INCLUDES. For example, if net/forwarding/lib.sh sources net/lib.sh; the Makefile related to a test that sources net/forwarding/lib.sh from a parent directory must list: TEST_INCLUDES := \ ../../../net/forwarding/lib.sh \ ../../../net/lib.sh v1 (from RFC): * changed TEST_INCLUDES to take relative paths, like other TEST_* variables (Vladimir Oltean) * preserved common "$(MAKE) OUTPUT=... -C ... target" ordering in Makefile (Petr Machata) Reviewed-by: Petr Machata Tested-by: Petr Machata Signed-off-by: Benjamin Poirier --- Documentation/dev-tools/kselftest.rst | 10 ++++++++++ tools/testing/selftests/Makefile | 7 ++++++- tools/testing/selftests/lib.mk | 19 +++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Documentation/dev-tools/kselftest.rst b/Documentation/dev-tools/kselftest.rst index ab376b316c36..470cc7913647 100644 --- a/Documentation/dev-tools/kselftest.rst +++ b/Documentation/dev-tools/kselftest.rst @@ -255,9 +255,19 @@ Contributing new tests (details) TEST_PROGS_EXTENDED, TEST_GEN_PROGS_EXTENDED mean it is the executable which is not tested by default. + TEST_FILES, TEST_GEN_FILES mean it is the file which is used by test. + TEST_INCLUDES is similar to TEST_FILES, it lists files which should be + included when exporting or installing the tests, with the following + differences: + * symlinks to files in other directories are preserved + * the part of paths below tools/testing/selftests/ is preserved when copying + the files to the output directory + TEST_INCLUDES is meant to list dependencies located in other directories of + the selftests hierarchy. + * First use the headers inside the kernel source and/or git repo, and then the system headers. Headers for the kernel release as opposed to headers installed by the distro on the system should be the primary focus to be able diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index 15b6a111c3be..082db6b68060 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -191,6 +191,8 @@ run_tests: all @for TARGET in $(TARGETS); do \ BUILD_TARGET=$$BUILD/$$TARGET; \ $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests \ + SRC_PATH=$(shell readlink -e $$(pwd)) \ + OBJ_PATH=$(BUILD) \ O=$(abs_objtree); \ done; @@ -241,7 +243,10 @@ ifdef INSTALL_PATH @ret=1; \ for TARGET in $(TARGETS); do \ BUILD_TARGET=$$BUILD/$$TARGET; \ - $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install \ + $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install \ + INSTALL_PATH=$(INSTALL_PATH)/$$TARGET \ + SRC_PATH=$(shell readlink -e $$(pwd)) \ + OBJ_PATH=$(INSTALL_PATH) \ O=$(abs_objtree) \ $(if $(FORCE_TARGETS),|| exit); \ ret=$$((ret * $$?)); \ diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index aa646e0661f3..087fee22dd53 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -69,11 +69,29 @@ define RUN_TESTS run_many $(1) endef +define INSTALL_INCLUDES + $(if $(TEST_INCLUDES), \ + relative_files=""; \ + for entry in $(TEST_INCLUDES); do \ + entry_dir=$$(readlink -e "$$(dirname "$$entry")"); \ + entry_name=$$(basename "$$entry"); \ + relative_dir=$${entry_dir#"$$SRC_PATH"/}; \ + if [ "$$relative_dir" = "$$entry_dir" ]; then \ + echo "Error: TEST_INCLUDES entry \"$$entry\" not located inside selftests directory ($$SRC_PATH)" >&2; \ + exit 1; \ + fi; \ + relative_files="$$relative_files $$relative_dir/$$entry_name"; \ + done; \ + cd $(SRC_PATH) && rsync -aR $$relative_files $(OBJ_PATH)/ \ + ) +endef + run_tests: all ifdef building_out_of_srctree @if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then \ rsync -aq --copy-unsafe-links $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(OUTPUT); \ fi + @$(INSTALL_INCLUDES) @if [ "X$(TEST_PROGS)" != "X" ]; then \ $(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) \ $(addprefix $(OUTPUT)/,$(TEST_PROGS))) ; \ @@ -103,6 +121,7 @@ endef install: all ifdef INSTALL_PATH $(INSTALL_RULE) + $(INSTALL_INCLUDES) else $(error Error: set INSTALL_PATH to use install) endif From patchwork Wed Jan 24 17:02:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Poirier X-Patchwork-Id: 767880 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2077.outbound.protection.outlook.com [40.107.244.77]) (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 EB7D17E789; Wed, 24 Jan 2024 17:03:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.77 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706115787; cv=fail; b=SKbz3hxtMzVmGNdNHXOVGvdoUXEMyqVIGocp57Ur75TpfZjsP1AVfk1pHOf8emQLr2dIPZjSONUa6mLU0MkWCM/V3mBG5E6ltgGKlnjlwIgACJ+rumJdsuApPBL9DKwJnS6lxRHxubaPxmscvT/D4aJl71j4jWXM6vNzLe66yD0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706115787; c=relaxed/simple; bh=Navva8HD5CFuUUqdCmRawabtkrHccePY+5woWFWtrNQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=diF6UHiOGsNLsJDig+Tiylu2wE1PUdEVPj3J8eE2sAdemAhsyRlCDpPA4X2XoHpxgZPUs6F9VAhp1B2SY0m7Fz356zm/xLNWy9/Hwi6wkvZWxSoFHbpo6KcZZJQ5xslXHPCyzyFpHq2vkKR2+/veA4wOQrjisjeP7Flf3ZcXTjs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=enOdgA9q; arc=fail smtp.client-ip=40.107.244.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="enOdgA9q" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XbdHzEvCodoX6vDEeh5N9XCGlJ/mqICUVkJhxsionBExZ4+Q/VeCrM2w61VfJDYmrkOngTKIMhIXXM3vRFnkiyPx4tLNn9jBA8bn1ncqy21eJ54DLqpDWmDQbJIdp+VXtQk3PzzoFW5/iaRSbJTaP7Rw0BaVkWTceP4c32/BNmL8CyTaTNLgOyLyji+bmEdEMYMESAj5NIJFlOTOixErThzyNdqE6zhdFnmwNjX2VcuUV9L6nFKgyE3ODu69DEIiFGbpugun1zBRtr5mK7GHyQT3reyJC+xdzbwKn8SZOxJq23IRI3VvVlPA5vxh0p69ma+bYmqC57VpEKbfoexGpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9v2TICNu80vHy6BTeREIvT13ft/HggZxpAwN5hYtpGY=; b=cB8+LTlWYx6vzPi6H+erp+2+FM9X7NApw4g2emG9HAD/ATnc9OD4ezCw8KKDG8krvpRpCnNvGkVaHDfpjSdq6IMYjczTJ4AjmLmrgenHKtPSw6VmDfB5Ag2QdJsTEEBHQYcNheUaAMYPiS+rpb4rLx67yCLhQ6Ac/MeXopQQKBQBOftVfJhiIYdwf7/Nsqcu6XAk7S7LSU1Z7LLUAaXBwev3hW5wVGC1sioBfoJXuYO17j5yHCngD+wTOcppA/Av4z9vIZ0C2nHxp+A49P6NrOZcT26JX61+w8ZjKA3yZ96S9yKnnYBgeh8+9KSTJlY5Jw10NZ9P7p4YGwHTvpRUdg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9v2TICNu80vHy6BTeREIvT13ft/HggZxpAwN5hYtpGY=; b=enOdgA9qUVt8xcPT2+9veYLMPKDk4wmWAPWSJOuAgR1sGAIWJoOYKIT5ggFeOsd3jLqYJxxn818lIArSlL+g2B+gQjnyRE44fv/txB7AN25UEI+oxMMx+Tgny/guylRLmdQ3jMWZDjkOB4L6Dj2778FivKpfPD6KTLYpPQMBt21nCxfktTyUAzauz9S47AQJhaJqDWqLDl5NWQF/CT7T/aqrB3Jw6XcfdRo85arXXEFbidLDu+zyy+dZrARXMqPD2M5SOy+DNTseaIGlozO0cD/8+mi8al10XGMC6BRobM6yPHy+MFleY17J6vLQtvCbmezRkC5uWqm/OOmNY2o3hQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MN2PR12MB4373.namprd12.prod.outlook.com (2603:10b6:208:261::8) by DS7PR12MB5935.namprd12.prod.outlook.com (2603:10b6:8:7e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Wed, 24 Jan 2024 17:02:47 +0000 Received: from MN2PR12MB4373.namprd12.prod.outlook.com ([fe80::ff68:f81b:d451:9765]) by MN2PR12MB4373.namprd12.prod.outlook.com ([fe80::ff68:f81b:d451:9765%4]) with mapi id 15.20.7228.023; Wed, 24 Jan 2024 17:02:47 +0000 From: Benjamin Poirier To: netdev@vger.kernel.org Cc: Shuah Khan , Jonathan Corbet , Jay Vosburgh , Andy Gospodarek , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Petr Machata , Danielle Ratson , Nikolay Aleksandrov , Ido Schimmel , Johannes Nixdorf , Davide Caratti , Tobias Waldekranz , Zahari Doychev , Hangbin Liu , linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH net-next 2/6] selftests: bonding: Add net/forwarding/lib.sh to TEST_INCLUDES Date: Wed, 24 Jan 2024 12:02:18 -0500 Message-ID: <20240124170222.261664-3-bpoirier@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124170222.261664-1-bpoirier@nvidia.com> References: <20240124170222.261664-1-bpoirier@nvidia.com> X-ClientProxiedBy: YQBPR0101CA0138.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:e::11) To MN2PR12MB4373.namprd12.prod.outlook.com (2603:10b6:208:261::8) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR12MB4373:EE_|DS7PR12MB5935:EE_ X-MS-Office365-Filtering-Correlation-Id: a3fd54fc-dd0a-47e9-bb4f-08dc1cfe4a20 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1mDrbCpP9wIOCt/v92EdtnliuqzPe1asNE4LehsHeMZOv3PeBYe9FNoQoru57HACK+2q1SzamyUiEEPWq/2P2+kkeGaFUBPhRCeLXR3+pOGcBTyOTXYcDpfmE7/M8PPw/hycD1OkIi4kPG2giNtucsjLMdElH03x969PIhvCf1TFWcInfZtfPq6LFJ1lhiVv8WbtjvyDre0LdCXzSpsGwZtL/hW3MCFHDQ5R6o+gB83cOmO/ynG00tkiEX3Y76j/LPwH6scjKmUGfNZunP9GGpH3YVdPWcmoqfuwdRkYWPvjVyZCALuBQSiTIAc0G9cQNdjp75sTGe/WsIwXr9T59CHRLIJxwN9AR2oILN2DfvACLf40oGwgI/YERX5Hz0aRA76VwqPypB0WefUAQuuOaUn1etY6HQk/lr97ZwWxKdMc4lkNsbQdGv8rfv5Ykp/f4Ggt2kIV2xLZ5wlkubCeklqGZMT1Q0kayII6eZd/bt7KTvN3uOJM/qXIhLJlhdnSPaTNs+CZNyx4O3ufTLs4635lHB495h2y2O4D7OyD5t+7ciUTuGCywSVGZMeyL3q8 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR12MB4373.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(396003)(136003)(366004)(376002)(39860400002)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(2906002)(7416002)(5660300002)(6916009)(66946007)(66556008)(66476007)(54906003)(316002)(4326008)(8936002)(8676002)(478600001)(6512007)(6486002)(36756003)(38100700002)(86362001)(1076003)(26005)(6666004)(2616005)(83380400001)(41300700001)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: A9EAE7xB0vJepgynChy40NvE4S2fcdoLt4BuDCCrsEYw/hpXKmGMRybdg/Rvwn/jYqKwrDIVDeq5p3nk957LQOZTqMkzdE1rNt/3yvkG84D5XVHaqojePofWL64e9epw5YdH5vOIJw2rkWttZjmCzSW/6/QHoPITincWcFNTkqdvNBbJUv8lNvm9OQBRhd2MQiaoKN2VYajPRUoCnsQLMh4yue5aHeYZ5w8oy2G+sC+J8CYqU2n8LFm9I5dErF98VHZFh1PJAh5fLmGaZFYbUZOsxCkXBKQccqyuqtpqyXH4qTJwbLdMnm6IUj26owW2ScMBghadP+Us8L+y+EZ9Hn279nSilLVwjR+ScOMqcwFSMrxUrK8Eomx4a4WupMh8Ebz9UHCwcnknPK5EwYldqj2Lq8CWdstx2mOQ0FJ4IDZCzp02Q2nYvRXsHER78kbqNGc77kpbBQhS59fq01Y+wHRska2B0ouVJafiFHuPvnzrY6D9/19/hepYpThatLj+5NPuPtXropHhDYVttHtyKt2eBgsQGzgMJGtOd9jV7RRrr89inGE/Etujb3/LqbMljeCdSqwxqvAsO66APAB6L8Lz6iSaGabs0/StJBkF+tmqlfaBK9EZj9Mts9gsvv8tsZsJpjIFtxyvWVNjybDvcCqz48UBLEYAoKCpEdPDymcGL6XHwzmsCquiFHrwSv+wsFCAueJNfY2QpvS9+zJ2eQ4dhifCk6DHphh1/s50LagIupO4MKrP4dikJXpd2TgK9ZY6/hJhl7cqIwAkAYPy3z/HHN0g/WrDi0sDUs5cB5I4g3EZS6ESLNzMi4T6J4a6XlnlbXGl5CUfxEZ/tQsg0lKgVas6JhH0f1TklKqX7Df+OVn1kmjMsO/zmyhEyIJnco35eagILEXhXZHF/6yyw+xhZP+M9E/sLxT2pG+3yuVV0dlzn2nrKn75TQh7KzSsWXhr5AYSGozPrh3AajZdvnOn+YDjg4MMnGWEIiKzAxWtKhNn2bpu00PUFA9YBXiMft8gA6NaxfU0OmaDAjKgKZko4KGJ+ldEYu2wXNsh+RjnqjZhJaqzSphUmDLxwr5t0+HzbXhU8DnBUktxQoaHdrMfjdhKdnp2TrWel4eJin2KliDJ5sQiRSwNPTY8l2I4lW3fTDYEQzF0dVCbYV2mkuThFfo/GUCd+O2V2dxZw9IpHrBkWzdFZOQK8Jg8EUGCHr3Y0gRBDs0D7Bk+DBxOgQz0eiCeBJ2214eVp1eZ97I1aE5J5FYyxiyeH1oLU1XVY1n8wWZ7r8QpUot1DullX/04gLALJ10sz7AE8XKQM2GKE2S0eP4+7iWhhAANZA3eXVKHQECKqa1bcz3Vw/NJWFQOcSiz/2qffn5BNJKRASgiV52j1FN0AqXkVKda5LnZov5nYK5mBxix4FIwM3/OGw4R33e7UF8Tu+2aGbUxWmgfqm+52pkT538pTtPtK13vp9J2c1bRSvMD4NGMK38a3rYKB28Or+LJJ1OjFvriaTitJ0bRUG+7QkNsimfwf34cxhV0PFDXwgU0/YA4obVJjBUJiCrJA0UsC5k/mqyPyv+rUe7q7nFRUd5GkBo0kBQH X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3fd54fc-dd0a-47e9-bb4f-08dc1cfe4a20 X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2024 17:02:47.1932 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8Ht44T038V+eHJKyOX8BUaBnre3WzPQi4LvI7StJnezkTEqrPVBJZc6O/7XxwDrJyrnYHk/JTQjBoF3G8g6png== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5935 In order to avoid duplicated files when both the bonding and forwarding tests are exported together, add net/forwarding/lib.sh to TEST_INCLUDES and include it via its relative path. Reviewed-by: Petr Machata Tested-by: Petr Machata Signed-off-by: Benjamin Poirier --- tools/testing/selftests/drivers/net/bonding/Makefile | 6 ++++-- .../selftests/drivers/net/bonding/bond-eth-type-change.sh | 2 +- .../testing/selftests/drivers/net/bonding/bond_topo_2d1c.sh | 2 +- .../testing/selftests/drivers/net/bonding/dev_addr_lists.sh | 2 +- .../drivers/net/bonding/mode-1-recovery-updelay.sh | 2 +- .../drivers/net/bonding/mode-2-recovery-updelay.sh | 2 +- .../selftests/drivers/net/bonding/net_forwarding_lib.sh | 1 - 7 files changed, 9 insertions(+), 8 deletions(-) delete mode 120000 tools/testing/selftests/drivers/net/bonding/net_forwarding_lib.sh diff --git a/tools/testing/selftests/drivers/net/bonding/Makefile b/tools/testing/selftests/drivers/net/bonding/Makefile index 8a72bb7de70f..1e10a1f06faf 100644 --- a/tools/testing/selftests/drivers/net/bonding/Makefile +++ b/tools/testing/selftests/drivers/net/bonding/Makefile @@ -15,7 +15,9 @@ TEST_PROGS := \ TEST_FILES := \ lag_lib.sh \ bond_topo_2d1c.sh \ - bond_topo_3d1c.sh \ - net_forwarding_lib.sh + bond_topo_3d1c.sh + +TEST_INCLUDES := \ + ../../../net/forwarding/lib.sh include ../../../lib.mk diff --git a/tools/testing/selftests/drivers/net/bonding/bond-eth-type-change.sh b/tools/testing/selftests/drivers/net/bonding/bond-eth-type-change.sh index 862e947e17c7..8293dbc7c18f 100755 --- a/tools/testing/selftests/drivers/net/bonding/bond-eth-type-change.sh +++ b/tools/testing/selftests/drivers/net/bonding/bond-eth-type-change.sh @@ -11,7 +11,7 @@ ALL_TESTS=" REQUIRE_MZ=no NUM_NETIFS=0 lib_dir=$(dirname "$0") -source "$lib_dir"/net_forwarding_lib.sh +source "$lib_dir"/../../../net/forwarding/lib.sh bond_check_flags() { diff --git a/tools/testing/selftests/drivers/net/bonding/bond_topo_2d1c.sh b/tools/testing/selftests/drivers/net/bonding/bond_topo_2d1c.sh index a509ef949dcf..0eb7edfb584c 100644 --- a/tools/testing/selftests/drivers/net/bonding/bond_topo_2d1c.sh +++ b/tools/testing/selftests/drivers/net/bonding/bond_topo_2d1c.sh @@ -28,7 +28,7 @@ REQUIRE_MZ=no NUM_NETIFS=0 lib_dir=$(dirname "$0") -source ${lib_dir}/net_forwarding_lib.sh +source "$lib_dir"/../../../net/forwarding/lib.sh s_ns="s-$(mktemp -u XXXXXX)" c_ns="c-$(mktemp -u XXXXXX)" diff --git a/tools/testing/selftests/drivers/net/bonding/dev_addr_lists.sh b/tools/testing/selftests/drivers/net/bonding/dev_addr_lists.sh index 5cfe7d8ebc25..e6fa24eded5b 100755 --- a/tools/testing/selftests/drivers/net/bonding/dev_addr_lists.sh +++ b/tools/testing/selftests/drivers/net/bonding/dev_addr_lists.sh @@ -14,7 +14,7 @@ ALL_TESTS=" REQUIRE_MZ=no NUM_NETIFS=0 lib_dir=$(dirname "$0") -source "$lib_dir"/net_forwarding_lib.sh +source "$lib_dir"/../../../net/forwarding/lib.sh source "$lib_dir"/lag_lib.sh diff --git a/tools/testing/selftests/drivers/net/bonding/mode-1-recovery-updelay.sh b/tools/testing/selftests/drivers/net/bonding/mode-1-recovery-updelay.sh index b76bf5030952..9d26ab4cad0b 100755 --- a/tools/testing/selftests/drivers/net/bonding/mode-1-recovery-updelay.sh +++ b/tools/testing/selftests/drivers/net/bonding/mode-1-recovery-updelay.sh @@ -23,7 +23,7 @@ REQUIRE_MZ=no REQUIRE_JQ=no NUM_NETIFS=0 lib_dir=$(dirname "$0") -source "$lib_dir"/net_forwarding_lib.sh +source "$lib_dir"/../../../net/forwarding/lib.sh source "$lib_dir"/lag_lib.sh cleanup() diff --git a/tools/testing/selftests/drivers/net/bonding/mode-2-recovery-updelay.sh b/tools/testing/selftests/drivers/net/bonding/mode-2-recovery-updelay.sh index 8c2619002147..2d275b3e47dd 100755 --- a/tools/testing/selftests/drivers/net/bonding/mode-2-recovery-updelay.sh +++ b/tools/testing/selftests/drivers/net/bonding/mode-2-recovery-updelay.sh @@ -23,7 +23,7 @@ REQUIRE_MZ=no REQUIRE_JQ=no NUM_NETIFS=0 lib_dir=$(dirname "$0") -source "$lib_dir"/net_forwarding_lib.sh +source "$lib_dir"/../../../net/forwarding/lib.sh source "$lib_dir"/lag_lib.sh cleanup() diff --git a/tools/testing/selftests/drivers/net/bonding/net_forwarding_lib.sh b/tools/testing/selftests/drivers/net/bonding/net_forwarding_lib.sh deleted file mode 120000 index 39c96828c5ef..000000000000 --- a/tools/testing/selftests/drivers/net/bonding/net_forwarding_lib.sh +++ /dev/null @@ -1 +0,0 @@ -../../../net/forwarding/lib.sh \ No newline at end of file From patchwork Wed Jan 24 17:02:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Poirier X-Patchwork-Id: 767879 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2085.outbound.protection.outlook.com [40.107.244.85]) (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 F2A9342A93; Wed, 24 Jan 2024 17:03:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.85 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706115835; cv=fail; b=dR2Woky1DSkBRKhhjM5f0x3s06NesdZlzvyyySXSwzXzJS5jbgpscNQuoMXRRaYRmZFgEm5LCiUz7EuelxpxZKeyY2GmgwHgt1PicvmJH49s9+R4uXu6sSDsvRntMvuz1A4Arj3A9YPrSEgmTbyYUiH9WYZQ3HVw9V3aTu0E9rc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706115835; c=relaxed/simple; bh=XAAEW8FKo5KaFrpo7ZpnLrP3U2rrSawZ2m8Y8w2Jwj0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=aJD4jBclOEVpB4mzU4v+sfjk9HNxq7mdsAsNH3AZQGXdaalJ+3vjlLwhAenVDezwkv0TinmvQYQp2b/jmFVKd+mm2Ijn7DNjmyCStih+ydovrBxeXv7X/IRekczFm/10ydLS8ibyfETM7JuPbo9XKqP4oZ6ktjZKzyLRUQmUqN4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=GZ7/xk+s; arc=fail smtp.client-ip=40.107.244.85 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="GZ7/xk+s" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jWzp5xL1TQabSw05SYeGxbbhWOELz9LZleqsn4ng/8Gz7ojGmxWy3H6k9ZoBzADlzWIdlz3JrQJunQ95nJWKpQHwYxbs3eScvCvR2ofb5RF3+3/DAj1kI03ngv+CwXAVf5NVPxMoB/i8Wda2KeeMEtFnZjOARKF7Wk4Fne/fcwbK8zG+nrg6XUA10HYdsJrUsAGLpB+9JCQCuqN+lTjGt8LSayRuuJFYw6678J8qBRR7u7JW/aPcyORjOxgO22VKgUxVcuOgQhd2y0D6C5NtyJcDaVxA4ZpjX2hM3WY/ZuequPuZGyoc6oWlDJAfKTeuZUI7PiIF5m6ptmIe3HG7Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=itAIixG77wUhv2LVVUp3StYiRLE0EYtaJQwD+2XohfM=; b=RoXU/WAsh0TqAjioHVyq2bOE1wiTQXJrIHbgtUO+1Ftxm9VSlBGddd5CIxb/XH9l4wZ/KkW7j7f/Xs3GekKxlEzBoulKPRdOgKM/vjsglNTCkAfiMZwFmduT1elRfddC6/2fjqZW8ZDGhDvKyr05yatMyBkf2yPV8TyZfLcIdYXMCKzY5OIqdMehU130hTdnIs9cniyVebxPpYKtO4LDhzqkH5MRSGxVHLjipBGMSYkTcCDg+q221ooPRd9ljsARl4aIuzP9jZ09Zoop8QBjMUC4Fy2HLC3OxVhR2UgDeFiadQLx6WiHxYtF1FI8QuCIy/YpL2Sm60KEEhqeXAtAJA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=itAIixG77wUhv2LVVUp3StYiRLE0EYtaJQwD+2XohfM=; b=GZ7/xk+sPK74fFunJGrjGLy4T3Jp8fmdg4cPDm7RiQ07ubDLXRnbphdJMXuem+ynHPtrzbEv07BLF5t1PRQJerb2gAOuCFu2QLSpXwXa4XYqc3E7lExVTAjQIiD9yRQCrW5iC6HjNrsrBesIthjac4lsQQfV7w74iEJojPl17xNIDN6jMEGreIK9yAix2oE3TzjkzeWdmQEA6B2np31ttU4nemCtZImZcUEQLcv87OtWD0DGdRanfg9Rx7rmBDxDJ8dOVUlyo2n3HPaWJf66jOhodbBlz02uLmTNJqongqklE03nNStx358araaW378OT3gEr1iNs04GMI+TJLm4RQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MN2PR12MB4373.namprd12.prod.outlook.com (2603:10b6:208:261::8) by DS7PR12MB5935.namprd12.prod.outlook.com (2603:10b6:8:7e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Wed, 24 Jan 2024 17:02:50 +0000 Received: from MN2PR12MB4373.namprd12.prod.outlook.com ([fe80::ff68:f81b:d451:9765]) by MN2PR12MB4373.namprd12.prod.outlook.com ([fe80::ff68:f81b:d451:9765%4]) with mapi id 15.20.7228.023; Wed, 24 Jan 2024 17:02:50 +0000 From: Benjamin Poirier To: netdev@vger.kernel.org Cc: Shuah Khan , Jonathan Corbet , Jay Vosburgh , Andy Gospodarek , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Petr Machata , Danielle Ratson , Nikolay Aleksandrov , Ido Schimmel , Johannes Nixdorf , Davide Caratti , Tobias Waldekranz , Zahari Doychev , Hangbin Liu , linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH net-next 3/6] selftests: team: Add shared library scripts to TEST_INCLUDES Date: Wed, 24 Jan 2024 12:02:19 -0500 Message-ID: <20240124170222.261664-4-bpoirier@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124170222.261664-1-bpoirier@nvidia.com> References: <20240124170222.261664-1-bpoirier@nvidia.com> X-ClientProxiedBy: YQBPR01CA0039.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:2::11) To MN2PR12MB4373.namprd12.prod.outlook.com (2603:10b6:208:261::8) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR12MB4373:EE_|DS7PR12MB5935:EE_ X-MS-Office365-Filtering-Correlation-Id: a614979a-950f-4d7a-1060-08dc1cfe4b08 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dqaAm2NJBU59nTDjmdPFG1fDK6PsDevVi6sINPFOW64X0gwMZUMOGobF/ftierlO00CGHxRTUtF5IJxPKRT96QgPclAQ5DJeYHt71bVYCOuQXQPS5JzxSih3jYOlO0oYJ3RwOE2ekWqYBoL0gi34XdM8XE/mgYdIBBGt6oYe8IpsxmyvpqjQNq4d91SB2tIbnkIVE3rbScZIKD6SY9UV/EpC1WP2+Y87cVqFWZaHxgBnLO4mF0RhVTh6OrO/83lICxBiyWvAQDfbCzBgOcMSI8YgK+ImnU2/nHt5sozrwEsaJY6wuELo9Ge5PyNO5FDDvE6hVdeO+hQvdv/FuL0QexDwhAMq0dcZKJuZxmt1gCaft5FJI5H5CAj35Ma0QpeYygI0M4IHTvLuHdfAvZU5BvstZof1NngRSNJ4jEQQmuzUkqenmk2ST7BYlGhNAt8+cwhr4yI2pcGh3uegZwvSm0neIJgxgNGzOgAQk2eCSNAft3dndYr1yqdm5c1EoHRTxJowHVLsq5wxqToVEshr4R3vr9yBgcIoGiLtPfgtU/ARuYwe949zATUOCdYH+6TI X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR12MB4373.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(396003)(136003)(366004)(376002)(39860400002)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(2906002)(7416002)(5660300002)(6916009)(66946007)(66556008)(66476007)(54906003)(316002)(4326008)(8936002)(8676002)(478600001)(6512007)(6486002)(36756003)(38100700002)(86362001)(1076003)(26005)(6666004)(2616005)(83380400001)(41300700001)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +B7kAnaOw5jex7O2q1VtrdPirorz9KtDJvlZAt94wDGDGCQH5S4ZtYgHTAuydBiqukXBjWsOnm5eAUvH5risj3ySescNa9xtpYfgjA7R9LgIMT791LxSkxY6t/BsDAS21S0Y+TQ0Bm58VmA7lgF1IQWRqTr0cthQlbYvKUZGj2DBVsuhwashvbW3LBMxiapccnN94ESUoOvq4NsvSbc4KKE1NWmerIVWjKd6+z9Z2bYA2sVAFEqRi7LSCiarb3Zd7QQQWjX84AxJImURAfskm+nByb3QPo2Ggiq5XvFmBLD0TmOsMvR5QVgFPUx12AA5jSE1nlNZGEjfbOHrdz6kSrHCQJ+SWRrV3ft40IV/OApI1kYsGLAfdoFVE6afzY4HwoFP1foPzhWRCOQpusEuRcgg7BaVuSa+kBxFAaMO+W80zszQS5fRF9Xai8u/3i/uKP1EeWqP19nTGWLZ8M9Hgr5za3xM50hBf37MyM+QCo/r/T8GVE3xThJ4TOTl20SbeFCXvK28i9SzZn3OVmq9T8nmVjh9TN7yt/KOaZdGpkfE52IkZN03AcElwS3OUYHRiZDkTJ2pefL/fAPCinEEFDLiS5tvXJ5nCCHg77Ly7xx7EFT2QOwwCUiqTr8cZZJc0t+UtMbBfsuSuq7hkebg/Savshmx/Z01vuHF/g4LQ6dptQiCpkcgBFfP2WR3r5nTvjgf13j/ZA84B9lkw0AZ92s54vjzVVYwW/8r3QiaUFRNsag938aH2W9l8804LLy/P7QkiZUfuEVHTAqUKSGGgHMmfBdKAY3C4OP560G8Cno8Q1tUk48L3+bPA6CoJyykJLpRgdrAm0KsYDYzqsxV8FMK5UTsqkD9EZQjZ+OmmjlrCeWyBBUGkFpPg6Llq4Mav9WSug+DrweYYIcHjplgqmBpPrWREr1276N7cgFjm5jEsu6HncqGfZ2RAX2AXEjbiAJG4ahHRCphUGuEZBe2J31Ic5tgNs5TV5l8lBXa4anHLsbMLCZ7O0s3HfYDjBPGHXv0UEkoPmWmmLHzZBWhq1zpI3ZQcu6yiIxlGWd+NhHjcvMF9QQLRssvohLzklxDc6ZHfpqtHMog++MABW7EJGsRycG7eYgDxAFg8YpwIrE2F6YZ7NG14qTbXRRJ6oZCdC7O/ELKNkyRHuYJTMGF8bdjAAZeV18ctkLduv7g0K+Vg3Ok3fIg12AZPVR76RfXlrljXHycyuWKRrqD5FfuX5K9VhKKXJqHjfORxOYY9PgL3X9nQRwRlyG6tXE3k/VkdJO2V5LqrPNbDqBCgM8tUorWYA8IWr8+tvrd8jtijSr8/L8hr5yYkzNrZ0w1ETrLvrBtKXQdgrKxV5gv6DsGWMEkC7nP4o4QEsU07lVtl7euzK2MWtiNOn2ALkOnjke2vWjKHaQcVxPFItnp6AU8l8u8kCMm8h/gEVOowhIl7PFsjuO1L6GYHVPPCh0UM5+rqPIIi76kV2DVOQtBC5umKb/WzqsevYFWkFj64YeLMH4qe7p+z3oivHaeIH6sNteJa7dwX+UiNPw28yPCiAX/sb+SjD6+uYF7fCGsL1+qtIJOFgENvN9vGVE/LpFHdFDB X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a614979a-950f-4d7a-1060-08dc1cfe4b08 X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2024 17:02:48.7055 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6VsapjlMoIoY5qqgDQMWCjZutbFIZV4ZzmcfCC4KWr7EXeAAIgMYNUB1AsdBFfClS7NYGTZjZd8xbsWQ+RQ1Sw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5935 In order to avoid duplicated files when both the team and bonding tests are exported together, add lag_lib.sh to TEST_INCLUDES. Do likewise for net/forwarding/lib.sh regarding team and forwarding tests. Reviewed-by: Petr Machata Tested-by: Petr Machata Signed-off-by: Benjamin Poirier --- tools/testing/selftests/drivers/net/team/Makefile | 6 +++--- tools/testing/selftests/drivers/net/team/dev_addr_lists.sh | 4 ++-- tools/testing/selftests/drivers/net/team/lag_lib.sh | 1 - .../selftests/drivers/net/team/net_forwarding_lib.sh | 1 - 4 files changed, 5 insertions(+), 7 deletions(-) delete mode 120000 tools/testing/selftests/drivers/net/team/lag_lib.sh delete mode 120000 tools/testing/selftests/drivers/net/team/net_forwarding_lib.sh diff --git a/tools/testing/selftests/drivers/net/team/Makefile b/tools/testing/selftests/drivers/net/team/Makefile index 6a86e61e8bfe..708bdfce37f5 100644 --- a/tools/testing/selftests/drivers/net/team/Makefile +++ b/tools/testing/selftests/drivers/net/team/Makefile @@ -3,8 +3,8 @@ TEST_PROGS := dev_addr_lists.sh -TEST_FILES := \ - lag_lib.sh \ - net_forwarding_lib.sh +TEST_INCLUDES := \ + ../bonding/lag_lib.sh \ + ../../../net/forwarding/lib.sh include ../../../lib.mk diff --git a/tools/testing/selftests/drivers/net/team/dev_addr_lists.sh b/tools/testing/selftests/drivers/net/team/dev_addr_lists.sh index 33913112d5ca..b1ec7755b783 100755 --- a/tools/testing/selftests/drivers/net/team/dev_addr_lists.sh +++ b/tools/testing/selftests/drivers/net/team/dev_addr_lists.sh @@ -11,9 +11,9 @@ ALL_TESTS=" REQUIRE_MZ=no NUM_NETIFS=0 lib_dir=$(dirname "$0") -source "$lib_dir"/net_forwarding_lib.sh +source "$lib_dir"/../../../net/forwarding/lib.sh -source "$lib_dir"/lag_lib.sh +source "$lib_dir"/../bonding/lag_lib.sh destroy() diff --git a/tools/testing/selftests/drivers/net/team/lag_lib.sh b/tools/testing/selftests/drivers/net/team/lag_lib.sh deleted file mode 120000 index e1347a10afde..000000000000 --- a/tools/testing/selftests/drivers/net/team/lag_lib.sh +++ /dev/null @@ -1 +0,0 @@ -../bonding/lag_lib.sh \ No newline at end of file diff --git a/tools/testing/selftests/drivers/net/team/net_forwarding_lib.sh b/tools/testing/selftests/drivers/net/team/net_forwarding_lib.sh deleted file mode 120000 index 39c96828c5ef..000000000000 --- a/tools/testing/selftests/drivers/net/team/net_forwarding_lib.sh +++ /dev/null @@ -1 +0,0 @@ -../../../net/forwarding/lib.sh \ No newline at end of file From patchwork Wed Jan 24 17:02:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Poirier X-Patchwork-Id: 767878 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2085.outbound.protection.outlook.com [40.107.244.85]) (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 E60797E79F; Wed, 24 Jan 2024 17:03:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.85 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706115841; cv=fail; b=YzpY646tsaCrohGN4vIzxhl89nhrtzXKJCU97zCoeA8W6OoWi4kdeyr33Q+N2Tx0wmajhAl+1VrWS+jkvH7S4F/MDIc086B1uMjENc52taCpUdfdtm0brhEphxfZ1BqNxQKePPzZV2JXcVVGw63Z2z/Yvi84eEs3KqoyAGTRTCM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706115841; c=relaxed/simple; bh=Uw09HnO1RGrPYPpqehDOd9nH5dtg87/DP6mBr00tohs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=ZQcCrBgOjCdwJ2mfTBfweMRfTspnBe+EGQv6wIoAxzn/HJXdm9gr3SBLTZCuaFvPVgDRbg10ed/Ki2DbeQjFKmXxgqit4+CEtu3IROE9RhM6g0cn215CofHWrelhKLaOLnpmbwWcUnhnI2k2eINdXM5aFiTQEhGANQwQ+QMHjjQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=WkSOdvd1; arc=fail smtp.client-ip=40.107.244.85 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="WkSOdvd1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jgg3fmqRTU8GQoaNWg2dzTkiyKLAEXVEzRDLeb/LL/sA9Z9hiPyGS23X3LHq4ujx3rzwZ57lKrHZ3lE1t9iSvH15XaDjTcj/VV2qXl/fqfHogGjIBracHHfpOx5lpyb05mHY8SXOFz61jg02QED/zirnh5pjhM5LGrElB1UMoYJcPpFtjNom8U7GGxYnohFau/1OzG3Sv6kRktCluLEUFDpXcETokOcZc+qRH2Nju7uo8EZ1JYmhtHgQDX2tt0k4LreyJJKGpqn386disaRw0cdrA25kuGJOz4V758UwJ7tIIO7ava618iCzccM07Sz0zbejgppy4YRja7CW6CkZpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3IZ9oAN02i2JdaTWyezQ7UmPk1kKYInDUHcbe4bi2TE=; b=WGL5NL01t0p8Ecv1W88tFO8GWKhh2GEfDgfCsOFOGuNxkf3kiWBtHD8gsfhjr6tREFbvfZSpM5nEtjcBMXmZG9wnE61qo9xzrjfCoD0U+7zlkkfZaX9g0Wf9u2gSGBiBRdJ8b4dU+n9B1d3EXDMoh6If7/jeRUoxNJ879XAw4pRjfYtIqBZu47A921emn5bGS7Wyw0dXW6q/XSvTp9ke+N5DVoGnRYu0ZsSYG27JtNGQe41MvoxofSSAmvTsp/9H83YvfgXxPjnXVHkQO0ly10eq5pzNTSfzEbCwJIibfjJQvC4TKX4hJ3qd+Z3iBRp1RPIPHan2/wN9OeDh5zgmwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3IZ9oAN02i2JdaTWyezQ7UmPk1kKYInDUHcbe4bi2TE=; b=WkSOdvd1cEkFmcbrkJH3GK1FL33BO6BZylbw0THmvnRKC7rnbdi7Z0WlDDQSKNSi+lstON4m4n8TbWCF/PHqzlfhuiRw34xV8M7MvQz3iF+QPpFjXainF8lDnIpimaZrC7i3ZP9ISXUpDetTgZoLYP66aihLRaqbCSildvnTHEFWZ1RMa/j85Fv0lmjLXcZ/egNf34Y7hxrGqB1r7/0rHX0BxB3pVuPwuonMVqzK9vc/rGXRiaF6Ne62ay90stGk4g2Qqemfp6Y3YkSXapeNWgeLvgisDkGHbPyvzbWnaiQQp6QeOKxWgMZ/0we4sYCWiJEseE0jQ3I4m4efVc646g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MN2PR12MB4373.namprd12.prod.outlook.com (2603:10b6:208:261::8) by DS7PR12MB5935.namprd12.prod.outlook.com (2603:10b6:8:7e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Wed, 24 Jan 2024 17:02:51 +0000 Received: from MN2PR12MB4373.namprd12.prod.outlook.com ([fe80::ff68:f81b:d451:9765]) by MN2PR12MB4373.namprd12.prod.outlook.com ([fe80::ff68:f81b:d451:9765%4]) with mapi id 15.20.7228.023; Wed, 24 Jan 2024 17:02:51 +0000 From: Benjamin Poirier To: netdev@vger.kernel.org Cc: Shuah Khan , Jonathan Corbet , Jay Vosburgh , Andy Gospodarek , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Petr Machata , Danielle Ratson , Nikolay Aleksandrov , Ido Schimmel , Johannes Nixdorf , Davide Caratti , Tobias Waldekranz , Zahari Doychev , Hangbin Liu , linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH net-next 4/6] selftests: dsa: Replace test symlinks by wrapper script Date: Wed, 24 Jan 2024 12:02:20 -0500 Message-ID: <20240124170222.261664-5-bpoirier@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124170222.261664-1-bpoirier@nvidia.com> References: <20240124170222.261664-1-bpoirier@nvidia.com> X-ClientProxiedBy: YQBPR01CA0065.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:2::37) To MN2PR12MB4373.namprd12.prod.outlook.com (2603:10b6:208:261::8) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR12MB4373:EE_|DS7PR12MB5935:EE_ X-MS-Office365-Filtering-Correlation-Id: 60523cbc-d8d3-4d1c-07fd-08dc1cfe4bd5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: USM4/kL4gV4KXCsEL37nSJBnoiKEwTSl7YcGWUmbx/6B2RBsAljomaE4BbiE8EO9bHNuBsszSAjjnI1hmGm8bXl1D4UnrxxsUz6iuI9Mf7P5DSbrnn8zOhPYNGnlA5b0lh97/3IQ9gdLfrIe5hM45X34skNXG+uRSRI13IaY/n9MENznvphncqO0Bk13qBiSqayWokZP9ZXAqCDZblPKPPzPKmBTO1v1tlxP1eQzawjSps59MdP/xta0dTH9GYGE6ejnKLWZIbSK8gO+zrSMh3yE38EDtv21AewQ6SDof/O3Giy6tFtSDYEPYXrk6DJwKkGcDbw9bUOuGraPhnntDZTajbX2cBn+ekHULnJe9S+kPtMEQkWbMWj4Eu4eURE5aizfcPMVjf/X+bte/UWJLH16W7RAe8aSqIO3JISTwDwXKxmztz10rSWleGT9B6pLVekMKloUxPydJH9SSTAk/fbwA0fw5SAQnt0RaIDgAJ1xQkMRxZsIZFKnvDcF2YdGngWIxNvyHxrDDiwoxSzF727FespP4whuqsIoViIo9i3/hDlC1DkmQc8pUyuhlaDi X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR12MB4373.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(396003)(136003)(366004)(376002)(39860400002)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(2906002)(7416002)(5660300002)(6916009)(66946007)(66556008)(66476007)(54906003)(316002)(4326008)(8936002)(8676002)(478600001)(6512007)(6486002)(36756003)(38100700002)(86362001)(1076003)(26005)(6666004)(2616005)(83380400001)(41300700001)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kSBemLXY2oXSs/S/jVgy+ac5mnJM5fxbQezNsKFAeUrys820/aTf3+6XtOFIG2vtkg07kBKjDJ9mbMisEo8Hf0PbgWyq3e0i1BGSRX6UqPH5Brz/iRmCJ/eChKkbOCJKxSPuRkMYHWMrGijJPosivem4vZ3S4vkENosaQHsJbAv/aZOwAcYnnDcLd9pT8MWPyUXzRt15aNgutuY0W8fE8k9WFNbAhAhmkhn6RZ1BP8b3qJvV6cX3k3LKTd9sIx2ogk702zqhQS8HIFvfM09xkn9xh9SoGQz4BKzLio3tew9Qb4Cczu5Xef7ZO2XxoFyE/qN2xwIlQUH9/J0CJSLB5hc+e27cO4FOv8cqRN1gsnqluhdY1QeYpJifdmFSsF2vQ8o7yG5r9DbbvWMu7L7PqD0gGVq+yRUlMHP9GA1t7v6DP12G6JLr5RrgofxtMPYLMaIpynW+o7QOEO61pyZ/x5t40mCUN3QBMeQVKuFTARaHufV1mIyAASHio539aKADRL511CBLcdgs/dFji2wW0KLPfyozQXj3pbz/X3/tloVeMBWdGutWN+hVj/v7CoovZ2mQxsrWN2S9vfyFTjWtE00SUc9fiR1L0zaGAXLlwlaUsu6b5e9qktt0vAk2anrfsunsQnW5r1G7ZccDEGQ33esboTGmX+oIxT5SJpbVtXepOv6sLkkgYS3F0IIjHLCKAvsFZanU2pcNHgy5Hysq9qqjdx0hZAf0K2Woxwo+M2/kO5LhKV0+Amo3DpfGcq4McZOt35k3/6/Fg9gqYZGLL60xP2WCd+DADcdtBedNNf6uOz5S0hBU8qkcX26e+wfdYZPUiz+Q3wZnHoDvxhVaxD3L22e2eUFVsA/Syhdb2rGLsSphuqoo2Lr/KSN27rs12EEU66rg2HoUFeTu4DTSk2Iman0QyPMp1iH7SLIkCDYILKmUWHwegC5CpM3VcClXyyrXM7iwynKEDJ4bhA8GHg2WkC/M8EjH1oMMN1WGLJyzXOgA0qBfyU4cU+WmIYZG02TfuDJwbHjxqPn8oPrbJ4aK0Yg8qh32giZUjTYxuWpxjwI3gvxUsXvf7F+eN2X2Tpq185meZ/qTtwAU7v6LvaTc5vNQZ+MjbkB0frrcyln3qA7rakzZZwEB3Jhemaz4P3ywvAfoDL7owY8QiooxLexwoNdo+NBAm6q947tiR69jCMieF4lyLrpGOIEy5PXuP5drTCXjPkGlHL8kOnPBO9bGhkqjhp3pykAjakSEd2FeLjSBKPELFXOW67ZIw3oJE90zTSWFHVbFXevAKHgD5Mm+NIhPJQqW1x2p/lKzFpHF4GIstXy+PB2j8kUv+50knywbwEKd1dTChEv/5dfPReNndgO371ggYwaqxiMrfVCXwGJczl0LfIO0HDvZSTqDvuMg3GatDkBRT+3GlrSSiSpzSlwaSpyU7rG3upd+prbOq6h/flDBWRq1Yq4PGOET1bGN8xqoJEI4FoAD6BkN5oVwsNqKPnmMH6AMJLPFv9nH6KyTMQvyapUpEsPrQ9IND4f3bbwU8TDWx9kgi9+Y1SzKqCFzuIY6LmcHGPssyzPkEMG3DGnv723xgZwb/VNi X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60523cbc-d8d3-4d1c-07fd-08dc1cfe4bd5 X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2024 17:02:50.0484 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: r+E3h4muFJRuJebzk5qCb4/+bnRolE0SuKZXMlldC8CDS35WxmXAN0n5nP6v7iVlyWwf4IsdgQT4/HziHKA3lA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5935 The dsa tests which are symlinks of tests from net/forwarding/ (like tc_actions.sh) become regular files after export (because `rsync --copy-unsafe-links` is used) and expect to source lib.sh (net/forwarding/lib.sh) from the same directory. In the last patch of this series, net/forwarding/lib.sh will source lib.sh from its parent directory (ie. net/lib.sh). This would not work for dsa tests because net/lib.sh is not present under drivers/net/. Since the tests in net/forwarding/ are not meant to be copied and run from another directory, as a preparation for that last patch, replace the test symlinks by a wrapper script which runs the original tests under net/forwarding/. Following from that, the links to shared library scripts in dsa/ are no longer used so remove them and add all the original files needed from parent directories to TEST_INCLUDES. Suggested-by: Hangbin Liu Reviewed-by: Petr Machata Tested-by: Petr Machata Signed-off-by: Benjamin Poirier --- .../testing/selftests/drivers/net/dsa/Makefile | 17 +++++++++++++++-- .../drivers/net/dsa/bridge_locked_port.sh | 2 +- .../selftests/drivers/net/dsa/bridge_mdb.sh | 2 +- .../selftests/drivers/net/dsa/bridge_mld.sh | 2 +- .../drivers/net/dsa/bridge_vlan_aware.sh | 2 +- .../drivers/net/dsa/bridge_vlan_mcast.sh | 2 +- .../drivers/net/dsa/bridge_vlan_unaware.sh | 2 +- tools/testing/selftests/drivers/net/dsa/lib.sh | 1 - .../drivers/net/dsa/local_termination.sh | 2 +- .../selftests/drivers/net/dsa/no_forwarding.sh | 2 +- .../drivers/net/dsa/run_net_forwarding_test.sh | 9 +++++++++ .../selftests/drivers/net/dsa/tc_actions.sh | 2 +- .../selftests/drivers/net/dsa/tc_common.sh | 1 - .../drivers/net/dsa/test_bridge_fdb_stress.sh | 2 +- 14 files changed, 34 insertions(+), 14 deletions(-) delete mode 120000 tools/testing/selftests/drivers/net/dsa/lib.sh create mode 100755 tools/testing/selftests/drivers/net/dsa/run_net_forwarding_test.sh delete mode 120000 tools/testing/selftests/drivers/net/dsa/tc_common.sh diff --git a/tools/testing/selftests/drivers/net/dsa/Makefile b/tools/testing/selftests/drivers/net/dsa/Makefile index c393e7b73805..83da1d721017 100644 --- a/tools/testing/selftests/drivers/net/dsa/Makefile +++ b/tools/testing/selftests/drivers/net/dsa/Makefile @@ -11,8 +11,21 @@ TEST_PROGS = bridge_locked_port.sh \ tc_actions.sh \ test_bridge_fdb_stress.sh -TEST_PROGS_EXTENDED := lib.sh tc_common.sh +TEST_FILES := \ + run_net_forwarding_test.sh \ + forwarding.config -TEST_FILES := forwarding.config +TEST_INCLUDES := \ + ../../../net/forwarding/bridge_locked_port.sh \ + ../../../net/forwarding/bridge_mdb.sh \ + ../../../net/forwarding/bridge_mld.sh \ + ../../../net/forwarding/bridge_vlan_aware.sh \ + ../../../net/forwarding/bridge_vlan_mcast.sh \ + ../../../net/forwarding/bridge_vlan_unaware.sh \ + ../../../net/forwarding/lib.sh \ + ../../../net/forwarding/local_termination.sh \ + ../../../net/forwarding/no_forwarding.sh \ + ../../../net/forwarding/tc_actions.sh \ + ../../../net/forwarding/tc_common.sh include ../../../lib.mk diff --git a/tools/testing/selftests/drivers/net/dsa/bridge_locked_port.sh b/tools/testing/selftests/drivers/net/dsa/bridge_locked_port.sh index f5eb940c4c7c..d16a65e7595d 120000 --- a/tools/testing/selftests/drivers/net/dsa/bridge_locked_port.sh +++ b/tools/testing/selftests/drivers/net/dsa/bridge_locked_port.sh @@ -1 +1 @@ -../../../net/forwarding/bridge_locked_port.sh \ No newline at end of file +run_net_forwarding_test.sh \ No newline at end of file diff --git a/tools/testing/selftests/drivers/net/dsa/bridge_mdb.sh b/tools/testing/selftests/drivers/net/dsa/bridge_mdb.sh index 76492da525f7..d16a65e7595d 120000 --- a/tools/testing/selftests/drivers/net/dsa/bridge_mdb.sh +++ b/tools/testing/selftests/drivers/net/dsa/bridge_mdb.sh @@ -1 +1 @@ -../../../net/forwarding/bridge_mdb.sh \ No newline at end of file +run_net_forwarding_test.sh \ No newline at end of file diff --git a/tools/testing/selftests/drivers/net/dsa/bridge_mld.sh b/tools/testing/selftests/drivers/net/dsa/bridge_mld.sh index 81a7e0df0474..d16a65e7595d 120000 --- a/tools/testing/selftests/drivers/net/dsa/bridge_mld.sh +++ b/tools/testing/selftests/drivers/net/dsa/bridge_mld.sh @@ -1 +1 @@ -../../../net/forwarding/bridge_mld.sh \ No newline at end of file +run_net_forwarding_test.sh \ No newline at end of file diff --git a/tools/testing/selftests/drivers/net/dsa/bridge_vlan_aware.sh b/tools/testing/selftests/drivers/net/dsa/bridge_vlan_aware.sh index 9831ed74376a..d16a65e7595d 120000 --- a/tools/testing/selftests/drivers/net/dsa/bridge_vlan_aware.sh +++ b/tools/testing/selftests/drivers/net/dsa/bridge_vlan_aware.sh @@ -1 +1 @@ -../../../net/forwarding/bridge_vlan_aware.sh \ No newline at end of file +run_net_forwarding_test.sh \ No newline at end of file diff --git a/tools/testing/selftests/drivers/net/dsa/bridge_vlan_mcast.sh b/tools/testing/selftests/drivers/net/dsa/bridge_vlan_mcast.sh index 7f3c3f0bf719..d16a65e7595d 120000 --- a/tools/testing/selftests/drivers/net/dsa/bridge_vlan_mcast.sh +++ b/tools/testing/selftests/drivers/net/dsa/bridge_vlan_mcast.sh @@ -1 +1 @@ -../../../net/forwarding/bridge_vlan_mcast.sh \ No newline at end of file +run_net_forwarding_test.sh \ No newline at end of file diff --git a/tools/testing/selftests/drivers/net/dsa/bridge_vlan_unaware.sh b/tools/testing/selftests/drivers/net/dsa/bridge_vlan_unaware.sh index bf1a57e6bde1..d16a65e7595d 120000 --- a/tools/testing/selftests/drivers/net/dsa/bridge_vlan_unaware.sh +++ b/tools/testing/selftests/drivers/net/dsa/bridge_vlan_unaware.sh @@ -1 +1 @@ -../../../net/forwarding/bridge_vlan_unaware.sh \ No newline at end of file +run_net_forwarding_test.sh \ No newline at end of file diff --git a/tools/testing/selftests/drivers/net/dsa/lib.sh b/tools/testing/selftests/drivers/net/dsa/lib.sh deleted file mode 120000 index 39c96828c5ef..000000000000 --- a/tools/testing/selftests/drivers/net/dsa/lib.sh +++ /dev/null @@ -1 +0,0 @@ -../../../net/forwarding/lib.sh \ No newline at end of file diff --git a/tools/testing/selftests/drivers/net/dsa/local_termination.sh b/tools/testing/selftests/drivers/net/dsa/local_termination.sh index c08166f84501..d16a65e7595d 120000 --- a/tools/testing/selftests/drivers/net/dsa/local_termination.sh +++ b/tools/testing/selftests/drivers/net/dsa/local_termination.sh @@ -1 +1 @@ -../../../net/forwarding/local_termination.sh \ No newline at end of file +run_net_forwarding_test.sh \ No newline at end of file diff --git a/tools/testing/selftests/drivers/net/dsa/no_forwarding.sh b/tools/testing/selftests/drivers/net/dsa/no_forwarding.sh index b9757466bc97..d16a65e7595d 120000 --- a/tools/testing/selftests/drivers/net/dsa/no_forwarding.sh +++ b/tools/testing/selftests/drivers/net/dsa/no_forwarding.sh @@ -1 +1 @@ -../../../net/forwarding/no_forwarding.sh \ No newline at end of file +run_net_forwarding_test.sh \ No newline at end of file diff --git a/tools/testing/selftests/drivers/net/dsa/run_net_forwarding_test.sh b/tools/testing/selftests/drivers/net/dsa/run_net_forwarding_test.sh new file mode 100755 index 000000000000..4106c0a102ea --- /dev/null +++ b/tools/testing/selftests/drivers/net/dsa/run_net_forwarding_test.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 + +libdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") +testname=$(basename "${BASH_SOURCE[0]}") + +source "$libdir"/forwarding.config +cd "$libdir"/../../../net/forwarding/ || exit 1 +source "./$testname" "$@" diff --git a/tools/testing/selftests/drivers/net/dsa/tc_actions.sh b/tools/testing/selftests/drivers/net/dsa/tc_actions.sh index 306213d9430e..d16a65e7595d 120000 --- a/tools/testing/selftests/drivers/net/dsa/tc_actions.sh +++ b/tools/testing/selftests/drivers/net/dsa/tc_actions.sh @@ -1 +1 @@ -../../../net/forwarding/tc_actions.sh \ No newline at end of file +run_net_forwarding_test.sh \ No newline at end of file diff --git a/tools/testing/selftests/drivers/net/dsa/tc_common.sh b/tools/testing/selftests/drivers/net/dsa/tc_common.sh deleted file mode 120000 index bc3465bdc36b..000000000000 --- a/tools/testing/selftests/drivers/net/dsa/tc_common.sh +++ /dev/null @@ -1 +0,0 @@ -../../../net/forwarding/tc_common.sh \ No newline at end of file diff --git a/tools/testing/selftests/drivers/net/dsa/test_bridge_fdb_stress.sh b/tools/testing/selftests/drivers/net/dsa/test_bridge_fdb_stress.sh index 92acab83fbe2..74682151d04d 100755 --- a/tools/testing/selftests/drivers/net/dsa/test_bridge_fdb_stress.sh +++ b/tools/testing/selftests/drivers/net/dsa/test_bridge_fdb_stress.sh @@ -19,7 +19,7 @@ REQUIRE_JQ="no" REQUIRE_MZ="no" NETIF_CREATE="no" lib_dir=$(dirname "$0") -source "$lib_dir"/lib.sh +source "$lib_dir"/../../../net/forwarding/lib.sh cleanup() { echo "Cleaning up" From patchwork Wed Jan 24 17:02:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Poirier X-Patchwork-Id: 765840 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2085.outbound.protection.outlook.com [40.107.244.85]) (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 534EB7F7CA; Wed, 24 Jan 2024 17:04:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.85 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706115842; cv=fail; b=BhLsP+aPtEfvBrdoJHZoXuDCuLic40qowVGYChz72tKv5vU7TTmoi9a/uOuyqn6hHL8Sd0PQq9bt6psNzlLdrDkiT4dX/6oA3ASVaOPB+f0Uj0mzy6z3fWGBxHCDdsZ0YAA9lCZ9yOn0QdDS38ecwM2rfYNsQrSDRtm3E08vxdQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706115842; c=relaxed/simple; bh=MXYcopAOAcGd9XoG3HOdytzR9tD8ot43sB4qf8mJ0dw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=j590HxCoJSZKfYsanER1Omsk3WL7M/TMX2KOrPmsaQ3RMzJ2gkEluGT5ll27/EocqQ4BI9bNRyT1wdVRH3x0QXdbIs6iokQnOlshSxMabD/GzZKZX3yaKq0Hj7lgvS7fJDqp6/4LuIiLnBxJk7dvWRCyMTVhb1gx49lKAt02RpU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=ctIx2PVB; arc=fail smtp.client-ip=40.107.244.85 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="ctIx2PVB" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jhqQERvBPgi94Ywi4lPdz9KMfQLASl3BmiaxI68QQxzVYPpNcB+qUipLyL5HsvKbJEvJrUujm/NssavRgKXhJaO0fG2td7wjUG4PAntK2IPTPip/2wpoiuVAV6Xc6o3sg9P66ZpVu+4J41b2OFmQaUZ+WgEyeVyQ9xAKE/CoN4HHbiH0/FsrenETlPGyeq21P95o865ONgUr31id37AAzcOI3epHZqlgZdJz6fyGtgnueKFcdnLn+FlvVwPymvIAQRd5fa76iGZpojkFqwtgI5iMUIdI4tKSSy7Et4EK8f9GTGmdzxg+VF2t915QIkDi2aZx7EMG0udoyOrUxVu7uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=88nCtg3EmJgWMImNXLFTCuuQs10ypVAq5YprtByVasY=; b=VBCoQHA/l46MIL4Un/fa3dwtolD12/hIlzfgeo04adgyFJcYh7c/XrlLAblK4IpuRqzs5O1gFnpir1vj4Ng5BIhQyS3o2r6flLe0zrnuvglyrAo2WPGHgXdniyDBuBvocJ8Jjol0ClIRSSPDo2I5mRzVAI2ginSdls33KEaCmr9KrtWt7d9oWg2hSdZf36s/EhmK/I6ibeXfSGOu2QsASMfEBs/WCV3vT6CjJme8jDCWJ4so1d3qEj0Cs0ISmA4OsGQxV0aOHEBmiO8BoRbx1XOaNCukOr68f0t4VQjeY62hwKKZ3jaCNenoqGvbr5ZYy6y3q4gH6eHc+eJ1K8TvTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=88nCtg3EmJgWMImNXLFTCuuQs10ypVAq5YprtByVasY=; b=ctIx2PVBmNUxbYgg2LUcKKNS5f9ZQzXOZQkInJbku1WbrRZQGUSHfgkyVgCoYhizzQ1jcbbyRMFUJkRYDTMODyHYnQvQF3wXcbBVDNMDkNVN8dPZBVmCFU7PdUOcF5KN1Ppu5YQPfiHLfbNPMMBJByUNTHopePUgzo5OajEBkJGJj4Nyqx/XiaWUSKIoyvmedPhN60IhIEdNzWF5RA6+ThaGN081tLfgJHksW9moHxPvLb2kbVu4QXW9yOV3hXasAz6Bw1ZW/YytUAZ/bnClxhu/cEE8JlFgq6lG8KixH1gwLQEookrBaNw00c08TE3v7KRFo0bdxsChw9C2Knqf6w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MN2PR12MB4373.namprd12.prod.outlook.com (2603:10b6:208:261::8) by DS7PR12MB5935.namprd12.prod.outlook.com (2603:10b6:8:7e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Wed, 24 Jan 2024 17:02:51 +0000 Received: from MN2PR12MB4373.namprd12.prod.outlook.com ([fe80::ff68:f81b:d451:9765]) by MN2PR12MB4373.namprd12.prod.outlook.com ([fe80::ff68:f81b:d451:9765%4]) with mapi id 15.20.7228.023; Wed, 24 Jan 2024 17:02:51 +0000 From: Benjamin Poirier To: netdev@vger.kernel.org Cc: Shuah Khan , Jonathan Corbet , Jay Vosburgh , Andy Gospodarek , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Petr Machata , Danielle Ratson , Nikolay Aleksandrov , Ido Schimmel , Johannes Nixdorf , Davide Caratti , Tobias Waldekranz , Zahari Doychev , Hangbin Liu , linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH net-next 5/6] selftests: forwarding: Redefine relative_path variable Date: Wed, 24 Jan 2024 12:02:21 -0500 Message-ID: <20240124170222.261664-6-bpoirier@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124170222.261664-1-bpoirier@nvidia.com> References: <20240124170222.261664-1-bpoirier@nvidia.com> X-ClientProxiedBy: YQBPR01CA0146.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:7e::14) To MN2PR12MB4373.namprd12.prod.outlook.com (2603:10b6:208:261::8) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR12MB4373:EE_|DS7PR12MB5935:EE_ X-MS-Office365-Filtering-Correlation-Id: e4b87f8f-e5ac-4698-a497-08dc1cfe4cac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: quQX//S1LnmUQycxcz5EFk3SeRh0PZp8UVSsz57Kh3itquzvSCylpgC3tECTZ6+0O5LmpUOrTtziCP9dwLplPwKunpyLZNm2BBgkeqGVE0iTAzyKFSVQMiyh/WwPnY4PGEZ+J8K3PE86mrybmxDBu3J3sRi9pP26nGqt+LghehJ3Oe3bTKEiOtu2VaKsuB9IVaEheIF78EXjGBcGcdxZDujRDnjmezXOsO9VRzzazoUROx7jmiJciIWP0nr1ZN8sny0k5xbZ1+SOpipUxCJEVlRvPGFBs2tqyxMBvAOGY/lcFy55dp4ICF3CAwwWjATzwFxFk9fU8wqjtPugzugHa+xtFQC7k2UaT5qcN94IG7KYKY7nykV0VxO28UfhLnnRGP/l2WxaUxF9lcTouLOb00rAgnoLBTvQySG8pDPE+4d6SNQW3Sg0Z1zGlPnrZseayQqwkZ1qdbZXjxi4OZUumltQlOR/Xe6OGv+FNJ1lbPSKk3nQ+NqYNnrjFxBFkxtoH1XXx9IcQk3Kl0qllUS8Mrp5zc9wQkMB6OTxsBY9fglctmmqT0nVCffYvekBydt0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR12MB4373.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(396003)(136003)(366004)(376002)(39860400002)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(2906002)(7416002)(5660300002)(6916009)(66946007)(66556008)(66476007)(54906003)(316002)(4326008)(8936002)(8676002)(478600001)(6512007)(6486002)(36756003)(38100700002)(86362001)(1076003)(26005)(6666004)(2616005)(83380400001)(41300700001)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZOFVHxNVaDWZOdtMMDpYgTyYTsgOZAFLqb32Pvn3QB2fKD3+rHl5EC8spxIRlqcNbrd0GTa55fq8vi/ZOvwOuONA5Qup9C23RdgphDS6ShvIiVrwJoICgKtdMQykrxFm1JaZ4EKSyHxpctg/DUzZiNHm/sY9b/B/ASHVovku2NdT+hp1NcRg2btpQL+cNkr+LeZggudgh7U0lpscQ5ZEYF3RSxuJnrFM/4qw0fTfJty4e5Nibae8KDt9jhenfiqIGnj2/LDPK5TqiY3Gebo8iDJCCWA8dt8LPrn2Wm169nC3mf51Yil5UmB/kOlim514Kd6thyeYj/b6LFs+/nx22BtpQIty29rDTLrpa9aRC0AkFsOZ07t72gXwn4wrWmlP5PHAGiFMJ1vzDdJSqliIaos9VR1tMeXarNEp0IA34g294Wf0bonukc5VnTcLdME1oM8/AaoeaLkp86MQ1h+jis7t8IpejlTy+YFe4TSJE/4CEx1N3QTqjmldemsr9jYCYCQKega3bVm1jUvyV6yHRFdGrphpY1nfDpBXIQXJQBsuFHOuY6FtTVtQSy01lX4igV3pldGCxg3veZw09N097Xgq4LEytIQB5oCIJRjcR+0Kzy1aldPrn5zYFZSuTVPU0+T8itwndo6yE/8JRDvAgcskhYG5tsZZCha8ia1y8cqZIgBNl4jQpx/2PPkAXxozT4fgKL3ngBv9ogw9cettWyJhQMlDkRjWhj5kcKbc4En4qbwvG90gIfMjEIIY100eby3KJAxgMvyg8uLQMpEDdqA7GChb0bz3dwjK4FFPfTG1ld9zkQmhAsECZ56XTnNy0ld93wLDMrq1AKe3LQqs1mFEBzWWtrrGotwXiG0Lh5FYWqqY3it7g82EAJVbw6SWlo9M0czJ+xabxRuNiUVgoP/yU8CEfUDBFgfgaSdK6KtrPCnlP64yW5N24POQ0Gq3boe18pSdAmsAIF76zCWGPa02R3dnVQrg9ceAzkqMHNBOT2Jv9DG45n/mWe7u/HtC8BJkfCs+nmtpDIDaI2v/qYive4/gOBi2zQaTVHy14a+AsRPcd5lzspdLmFsx6uC84yTlknrXy6iTAVeyAGMcUxw3yBblcIxZ2rWqeqeNA4JhsISYt+zhWb7SvHaUrWvIO7F6iffBYUrfBSHFVw5/GMdeWkS/b0PutI74ILIjLScQ+/c4+NjiXvqiNzWMg4OXxqL2rMxDL+n0tskw6KjymxXJAlWuCTZ/0PamPN5vpNSIEaCbH3dajecdasnLFMm2YcO6sPv3o72BscKQY9u4wfE+0ddA7o/d1ihSJ9XEYifRfFod9X7n+O6g3dm5i2ua4tLdn2ZG2aNW55xl9OVZnaa4hgeC2DuS3qlffKlnSgSN5iCt9GP0fbrQZTl3SB2p0xbCvLO7NWc0/1Au3/OD0MtkyLXdTBOJzP9rpim6Cbmy5jss4AZn7gX1EIwJMrXNvh5anBls+Fk6Vzcux1VPfaxDWisxu6OC6KRjDRgZKhAj30vNcj7LUX6xpnxCR/DCcIbzQXuXiQPNKPCRmPteyVa0gMjx4bOGbv3GMBm//7y0GQ2xphzPg2+t6hreDbRj X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4b87f8f-e5ac-4698-a497-08dc1cfe4cac X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2024 17:02:51.4855 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /u0rrdNjOqBz8miURDK/JKEem/KT1gd9AOhMT0V9KKGLtjKcU/GGuLfOpi0BBhoyKMyjEThzsJc6w8hPnDFT1w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5935 The following code which is part of lib.sh: relative_path="${BASH_SOURCE%/*}" if [[ "$relative_path" == "${BASH_SOURCE}" ]]; then relative_path="." fi reimplements functionality that is part of `dirname`: $ dirname "" . To avoid this duplication, replace "relative_path" by "net_forwarding_dir", a new variable defined using dirname. Furthermore, to avoid the potential confusion about what "relative_path" is about (cwd, test script directory or test library directory), define "net_forwarding_dir" as the absolute path to net/forwarding/. Tested-by: Petr Machata Signed-off-by: Benjamin Poirier --- tools/testing/selftests/net/forwarding/lib.sh | 9 +++------ tools/testing/selftests/net/forwarding/mirror_gre_lib.sh | 2 +- .../selftests/net/forwarding/mirror_gre_topo_lib.sh | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index 8a61464ab6eb..cf0ba4bfe50d 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -29,13 +29,10 @@ STABLE_MAC_ADDRS=${STABLE_MAC_ADDRS:=no} TCPDUMP_EXTRA_FLAGS=${TCPDUMP_EXTRA_FLAGS:=} TROUTE6=${TROUTE6:=traceroute6} -relative_path="${BASH_SOURCE%/*}" -if [[ "$relative_path" == "${BASH_SOURCE}" ]]; then - relative_path="." -fi +net_forwarding_dir=$(dirname "$(readlink -e "${BASH_SOURCE[0]}")") -if [[ -f $relative_path/forwarding.config ]]; then - source "$relative_path/forwarding.config" +if [[ -f $net_forwarding_dir/forwarding.config ]]; then + source "$net_forwarding_dir/forwarding.config" fi # Kselftest framework requirement - SKIP code is 4. diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh index fac486178ef7..0c36546e131e 100644 --- a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -source "$relative_path/mirror_lib.sh" +source "$net_forwarding_dir/mirror_lib.sh" quick_test_span_gre_dir_ips() { diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh b/tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh index 39c03e2867f4..6e615fffa4ef 100644 --- a/tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_topo_lib.sh @@ -33,7 +33,7 @@ # | | # +-------------------------------------------------------------------------+ -source "$relative_path/mirror_topo_lib.sh" +source "$net_forwarding_dir/mirror_topo_lib.sh" mirror_gre_topo_h3_create() { From patchwork Wed Jan 24 17:02:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Poirier X-Patchwork-Id: 765843 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) (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 3F09E7E76D; Wed, 24 Jan 2024 17:02:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706115778; cv=fail; b=G+CdMxn6RxYKp5RScpBOmuctorTAWm+4PAImT53yR9SGs/yYzP4Td8fn3JrNL2nddvUhTMZ3iunJ537FDyEjrcM3dPThhsXqCzbUn8QPUK3QSFN55k4THiTs/DHrWQ5REqlkZ31UvakyF42uQsbSKP2r5gQNIUEvIa0MLXxvaAo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706115778; c=relaxed/simple; bh=OOnpurWc4QXknd7lAbnPIBAR9h4mxM/nUa+2/8mIbNY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=D11Hb9VIhVkfdmYBqYCCeXlWjagSuJuGgFGVsI0/8WuljRteFWTv5lUbsJXdqBWWIKQKhIvIaMEIh+GG80CEJA/kM1eYO+waQLI42B7r4qJGKZqZDznSfQQXd1qRttbEKvtZB6aFWBoJCThRwafdhV+Xg27TGWVN38xZE+S0HlE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=F1hg11Nm; arc=fail smtp.client-ip=40.107.236.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="F1hg11Nm" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R9rX+uDs7OhVMPXR9cMgoABS0Huv/i/JNzzO3GGvP2uRnSv3MMc2dBWO1BS2/RTHnCwyN6WPJ5tGiYCUe0XWOTJSWpZch1ksPSJswANZBKCxi1/UAkkj7pTq508wBjte7RSAjsgZPJuUcjK4DK2xENz/zYwAfQDAzN1CsWH3qrEGxISYwmPVUhcxrE6KJtI/0O0z3ZpAJYF1ORYpHq1HbwKfGHiMXdyCWQh/snvgY6qmw4tXRTTpaLFBDvBBsq43h2CmhYbHp2b6oRgIxLLw1NBOVnpWZSlhxjJvZV0ni+cWGB8Sm+REqpL2U2vtcEKF3yIX4hLXWVKHLqNgwLyFpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Fo3c5SZ5FPDTHi+SjWCepqIVuNSWTrm4yypFFqsLFTY=; b=bm0Ys+0IAU/1bW+bJ7GzvN6+qucxtEAfEJAvOXDSb3XRH+bv1kcYxzcPriZcYNXWJpBVa+wv7m/2iZKx85lL0SrkijBtv5fUsWuoKVlhVT897CcHvXrPUzWi0RDHdQLYjtBq24h6MuZPUkDNNpcKG8QQIy34ow023Vil4nPzb3hnEaW39Fr6rAkS/y99lRUAu5iodU/yMI2z53xD/QofZPwiTpQZjCloJDIDgMgZcSU04q04IEfCryRynCWqpToU0FS9kiyAEJMQHuuS6ZjY09Q/4bgOUGV1axTNCDgcsHcThcoLFgvw0GYWdY+Dq4kW4Fd3SlsCVBPdNtIfPJoIXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Fo3c5SZ5FPDTHi+SjWCepqIVuNSWTrm4yypFFqsLFTY=; b=F1hg11NmGinLJR88KRX5x0ckC89RnSTPiu/7SSxY6ernWNcngi7vJus67uVZjSeX9mINWyRUf1S7fPp2vwm3BJysTZcBPYrr28TKF8Qm/QZNgOK6tAhBJDiduVVhOlIkQVTG997f1gKXB32nkUIlPccXqhN/lBRMHt70+bHG8HbO8rC0v7KEcLiwPUX07diXS3+CjcYHEZXR5u67zgFKA9EMYJdFdH3gIOQ84OI24OzS5wy0e4zgzNznNPYUVhJiqnM4QeLkyvsEJRNTomJ+TGOLwXkpSU7an6ZYsqXpy5h0AkIArQy7I9hewWxq2IG5HTDQo0oAUP0NFZBDWtoW3A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MN2PR12MB4373.namprd12.prod.outlook.com (2603:10b6:208:261::8) by CH3PR12MB8901.namprd12.prod.outlook.com (2603:10b6:610:180::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Wed, 24 Jan 2024 17:02:52 +0000 Received: from MN2PR12MB4373.namprd12.prod.outlook.com ([fe80::ff68:f81b:d451:9765]) by MN2PR12MB4373.namprd12.prod.outlook.com ([fe80::ff68:f81b:d451:9765%4]) with mapi id 15.20.7228.023; Wed, 24 Jan 2024 17:02:52 +0000 From: Benjamin Poirier To: netdev@vger.kernel.org Cc: Shuah Khan , Jonathan Corbet , Jay Vosburgh , Andy Gospodarek , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Petr Machata , Danielle Ratson , Nikolay Aleksandrov , Ido Schimmel , Johannes Nixdorf , Davide Caratti , Tobias Waldekranz , Zahari Doychev , Hangbin Liu , linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH net-next 6/6] selftests: forwarding: Remove duplicated lib.sh content Date: Wed, 24 Jan 2024 12:02:22 -0500 Message-ID: <20240124170222.261664-7-bpoirier@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124170222.261664-1-bpoirier@nvidia.com> References: <20240124170222.261664-1-bpoirier@nvidia.com> X-ClientProxiedBy: YQBPR01CA0138.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:1::38) To MN2PR12MB4373.namprd12.prod.outlook.com (2603:10b6:208:261::8) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR12MB4373:EE_|CH3PR12MB8901:EE_ X-MS-Office365-Filtering-Correlation-Id: 393446f4-d624-4bd5-06b6-08dc1cfe4d7c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4s+lmfUK0jP6EjDdJSEQpyGdj12/kALjxu0TBj4TcpcDWxjK9o3Rbi5Y2wixBH7qRo/av+v307pGoQD6Dv/waDmqJ2r+ApNUDCsoXLDs0F/0ihOA41AcsCH3PlwiYXQ3Zfe3fDl0HrKpO9kUgcl8y2um7pU+CA+PFW6QJI6vllURMzTTn//VzXM+S/DLLjLm80Q2U4rARGOeWZMcEANFBTLG6VTCHsSdQ8JICAVV5BLqcsXfSaqtxbn4cy0VENAFru8A0ynmLs4wA8Ll3WI5TmvHYEAL0ziqBFzvCUHm41dwYm8FxoYiDLjZKUANgPAs1RIsvXZv5yA//gT7AKZEUV3pZBz3hFgUtXykdWj4Dq/0sOW6ShpeNTHKuCRWLban0fKAKiFWOKkbdGMKJskI1eTU3e6Q5FanVRw7ywJQKRs24hnWTtT225tBAaV7mMT6KqvwQhxncEH87e34E2f9ERBuX8cVF2/g8xGOGlIHvsOMfFrlPV0/4kWSIyiNafVO6t3LAejXXq5ayfYhaisDki5ac9Oi8ONA1ZnkYE0AA04RfLCOBvn+Vh/HrXWrVxHs X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR12MB4373.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(346002)(396003)(376002)(366004)(136003)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(83380400001)(1076003)(2616005)(2906002)(6512007)(26005)(38100700002)(4326008)(7416002)(8676002)(8936002)(5660300002)(478600001)(6506007)(54906003)(6486002)(6916009)(66476007)(6666004)(66946007)(66556008)(316002)(41300700001)(86362001)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AE9Xg8Yis4Y9mpyUOjnDkoF9Wb2qopENfhLb5CBGtEVbWp7pFPg04M26Hk+ZXGIn1EqZGO7RAGOZqjup8PKUSE09RMpjqjwp0bXaJ1+eoRDgHxy/vw2F+CEH957GB8AoIc3Q2Dim0iJWjp/DYmqThBcEx6WFiecDab+dwJoJUKReKKfvyFNaSE2gIbUt+pz8e+6R3So6tyjOiDT0JFNZLpZTU6VAqViOKODhOx9G5Xj78HPwE37GqGnW20cwzbM4eFru2NIvyjGZhGBOEyMf78OetrfRLOYK6X0FYBoUu14N26Ly1a3HCvuVpUnCoBInqryXXMnWX0aaLad75Zg2eU02apJHXPoIZyK9ZrMHPPF1ieXDMW/UUssPbnv1j8LR0hboeA6/WwXvQsvOgqCo0U3MpO8jMJMpSnqlQt5WSoO08TXGzfoDrNutRuNbEtz7jJv7K6DdzRzM3bu8PFwrTcKtqOsbvN+bIbcUeqv4lfjgJIZqSpYAuL6kGYfM0Dd+hPm+f+X6BQQ4r54tkps97OIGYzGkTbhUYdhqtmW70CziLgWmNd6V4hTPeaozPafSiMfqhTJkItOjiB0k4E/d5HNmyfPLAaCcGLQkzUxWTpkvpN/Xpr70BgVUncnnE+JF7Gs+/+RhMn3PPRt3rlTVyzbSQDOJTXMJqJ5Ng0UmLf5WS2NW8Dryxf3IgoEkWzf14OcbH1VBkqtSCE5ONeuiOy3dn0OCChHtPksbcSR89bSi+HSOGKJzOwrG4fwPPP3oTj8ZVDiXp0GmJq57uAYUP243Ln0VpLDFEUANSSO7BKwij66VjtxhJEIVDdwCDXy5nNCU6Qs0G8maroKc1CQB21Z2PS8BaEuh86LiHk9RzVeaoJdKz6xmb2R7OthO6SwrWj1f5B9EtqXD7pWXuspg726w9PJe6/vWosZZRufdOgLT3BF9ERIJs7z2o5CpUmSI7vblW/5u/OExuuZPfXUo9UlOTZcgB+Ziwr9iF9yCvK9+dBZ6WY5x3IqFcWVUpE3f/2cwiLBHa868GWKiN/iDvrrCauEZcs1fGJ9/gDnOmQcdRGumQXtlyVBqKOHzHbfS9gmu/Yxsym4/OVeJ+tvyTa6voqV/tiUPAmDCp8wzDeH8sgwzxfUigUvctgzjQprkGBOBRw7U9o+e5eSA6jSA0NzqxltX3IEZms1gulc1rxPwWNqKG1AhnJlik7CxHX163feTlVlPFwKlfHVRTw3Xc85h19DlkAkM6ll70wljn47frqRKZ09Jhsrgqns5rRO7hKs30AldP+IRHG4BH6JH3cPOJcmLGt+8In5Pgg0Eon4PqbzyukAurNNoFevpauJL1s3k0V3f9azFL5oIGU/2XeiWd2PrPhvXadNhM1gzpV4a5hT+YFF6N4mgxwrAbT53+5YSUolW9oLHL0WvEZhdlWm1vjsAAVXLsuS8go9MlnaGeLxEZUA3mhU6Yfm02PJcbfZghum/AYqWPARhapla9MtdYvhY0ZQccJfnvRt3tz2NxajmYqoDib1Ghf5a2is9qUvQSlLDTt84rbNT7oMb3HMDhhHzTQfnpMJHUXeXf4rM/azwXzWQwQyLInqTYMSe X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 393446f4-d624-4bd5-06b6-08dc1cfe4d7c X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2024 17:02:52.8390 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7UH02L5oyy/6W8bChe/hygXTpY+NUAuV4WtwBVN0IPFefBDYyfogGhQTmwyb7frLosbQu5mlGrk6/kCxDdzzJg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8901 From: Petr Machata commit 25ae948b4478 ("selftests/net: add lib.sh") added net/lib.sh to contain code shared by tests under net/ and net/forwarding/. However, this caused issues with selftests from directories other than net/forwarding/, in particular those under drivers/net/. Those issues were avoided in a simple way by duplicating some content in commit 2114e83381d3 ("selftests: forwarding: Avoid failures to source net/lib.sh"). In order to remove the duplicated content, restore the inclusion of net/lib.sh from net/forwarding/lib.sh but with the following changes: * net/lib.sh is imported through the net_forwarding_dir path The original expression "source ../lib.sh" would look for lib.sh in the directory above the script file's one, which did not work for tests under drivers/net/. * net/lib.sh is added to TEST_INCLUDES Since net/forwarding/lib.sh now sources net/lib.sh, both of those files must be exported along with tests which source net/forwarding/lib.sh. Suggested-by: Hangbin Liu Signed-off-by: Petr Machata Signed-off-by: Benjamin Poirier --- .../selftests/drivers/net/bonding/Makefile | 3 ++- .../selftests/drivers/net/dsa/Makefile | 3 ++- .../selftests/drivers/net/team/Makefile | 3 ++- .../testing/selftests/net/forwarding/Makefile | 3 +++ tools/testing/selftests/net/forwarding/lib.sh | 26 +------------------ 5 files changed, 10 insertions(+), 28 deletions(-) diff --git a/tools/testing/selftests/drivers/net/bonding/Makefile b/tools/testing/selftests/drivers/net/bonding/Makefile index 1e10a1f06faf..03a089165d3f 100644 --- a/tools/testing/selftests/drivers/net/bonding/Makefile +++ b/tools/testing/selftests/drivers/net/bonding/Makefile @@ -18,6 +18,7 @@ TEST_FILES := \ bond_topo_3d1c.sh TEST_INCLUDES := \ - ../../../net/forwarding/lib.sh + ../../../net/forwarding/lib.sh \ + ../../../net/lib.sh include ../../../lib.mk diff --git a/tools/testing/selftests/drivers/net/dsa/Makefile b/tools/testing/selftests/drivers/net/dsa/Makefile index 83da1d721017..cd6817fe5be6 100644 --- a/tools/testing/selftests/drivers/net/dsa/Makefile +++ b/tools/testing/selftests/drivers/net/dsa/Makefile @@ -26,6 +26,7 @@ TEST_INCLUDES := \ ../../../net/forwarding/local_termination.sh \ ../../../net/forwarding/no_forwarding.sh \ ../../../net/forwarding/tc_actions.sh \ - ../../../net/forwarding/tc_common.sh + ../../../net/forwarding/tc_common.sh \ + ../../../net/lib.sh include ../../../lib.mk diff --git a/tools/testing/selftests/drivers/net/team/Makefile b/tools/testing/selftests/drivers/net/team/Makefile index 708bdfce37f5..2d5a76d99181 100644 --- a/tools/testing/selftests/drivers/net/team/Makefile +++ b/tools/testing/selftests/drivers/net/team/Makefile @@ -5,6 +5,7 @@ TEST_PROGS := dev_addr_lists.sh TEST_INCLUDES := \ ../bonding/lag_lib.sh \ - ../../../net/forwarding/lib.sh + ../../../net/forwarding/lib.sh \ + ../../../net/lib.sh include ../../../lib.mk diff --git a/tools/testing/selftests/net/forwarding/Makefile b/tools/testing/selftests/net/forwarding/Makefile index 452693514be4..1fba2717738d 100644 --- a/tools/testing/selftests/net/forwarding/Makefile +++ b/tools/testing/selftests/net/forwarding/Makefile @@ -129,4 +129,7 @@ TEST_PROGS_EXTENDED := devlink_lib.sh \ sch_tbf_etsprio.sh \ tc_common.sh +TEST_INCLUDES := \ + ../lib.sh + include ../../lib.mk diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index cf0ba4bfe50d..a7ecfc8cae98 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -35,31 +35,7 @@ if [[ -f $net_forwarding_dir/forwarding.config ]]; then source "$net_forwarding_dir/forwarding.config" fi -# Kselftest framework requirement - SKIP code is 4. -ksft_skip=4 - -busywait() -{ - local timeout=$1; shift - - local start_time="$(date -u +%s%3N)" - while true - do - local out - out=$("$@") - local ret=$? - if ((!ret)); then - echo -n "$out" - return 0 - fi - - local current_time="$(date -u +%s%3N)" - if ((current_time - start_time > timeout)); then - echo -n "$out" - return 1 - fi - done -} +source "$net_forwarding_dir/../lib.sh" ############################################################################## # Sanity checks