From patchwork Fri Jan 26 23:21: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: 767836 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2066.outbound.protection.outlook.com [40.107.223.66]) (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 D6F8A5A7BE; Fri, 26 Jan 2024 23:21:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706311320; cv=fail; b=VzJqNwxc8I9GRTHLllwSoe6PUrIknHwLHY+3ds++CZUaI9miatQ60EgLx4sVlBRRbLgQYoFrL7IUUZVEhTmagHYDVG8z9bcgu8f1IN+YV5oQgMHLFsLsMRaAhwcu0zhfZd4Z7uTRa2cS0agnVAgJZgybvG5+KQg/iZ1ZJYfL6fQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706311320; c=relaxed/simple; bh=ean8ZPumufKAKWyiTXjb7GosxMoDuU3csCT8BV4qIkk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=Y2MmR3VIJISAYqYoOuL0923mcJcqb4xci0XdggjR0AyPwHNmo53eDP2q+VamLCMo2l4xqOKuzi7EOkmXt9nbXpRnjoydQjDiZi6tSsNV0SAy7Knnh2XSKaB/zTMmcjnXAUlijqSzDeWrz5wxljs2k9/aLsvZGin9Som9JBDlJ6U= 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=QuU+KCLd; arc=fail smtp.client-ip=40.107.223.66 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="QuU+KCLd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=af5yt392jAP4Fyk/gExwoGPJpJ8XHvK66IX2Y0nJ4oNZlWtc7nDM9mDp4gWmFtGerBKw+Gq6pmXUkELNeusDN0WWLh7sEgcNxob+hoyA+wlFOxyPKENwp9FXRnBxUbpVsg+viPvO/FImMgVDh3MvJzWvq6uiC0lQxcLuQ5X+UoN8eCDZ0WP807jv6M6bNTy2BAfK1gT8NIyBf0Li4e1nauPgW3/5+KP8AB/ed8AD4f+nJH2mq55b3FWmbvakCm2/+dHdO7vqmlY9Xgzq5Iq8f/yrvxWUgs410oA5cxoRxvCY2Oqe90qoLW50YA4wkiQOiUqQDB8QqkBO4kMIjOxw4g== 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=284jL1MHzGAxL4g540ueighZGY8tnaCgztobRTLK4Ik=; b=PI0kQ9HG2powiX2fYhvX1MlPIJLFI9gYjM28BjZDziAJiHxEZRz4gSofr+aqzNS572OCy0xBIe7A4bKywRySlRSGvTxVo7Wln65xBKpkV02/3iVxnAVWHKkEWfbQ5o41zwwqhBESAQr9Pxkm2HxU8iO6XGHpJ/KxmL/S5P3V9wIDsw9012tZZbMxyuNH/Ym0OziWVQYHu9TR4g70YPMLjoVhW+FAg3tWEdAVFhpQvAmowQp4FNQlPvVJHl3HuFqZWBaSt1mpGV6Nu3sLs40b3wk9fwbxtsG8I/BYBBLHleuvv7R4c5y3XhbX/dcCsRfcSaksUcccAkrZXpl//wyZXA== 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=284jL1MHzGAxL4g540ueighZGY8tnaCgztobRTLK4Ik=; b=QuU+KCLdixS7xe488kkJQUAKKU38L/2IGS3H0R8ahs8pX5+J7oaP0QStmyfbzxRBhbJPcJHbgTJQuH4GXD7XMQeXYuDCUr6vZ3YW4F28mOFT+zSLeYXX0VRwwhMrLgcVTmhirYrcjiwBslSgsmp+lBmK/zxKRgrUWE85kRoUNrXDtFBeAsUv3EGSsdymRUyfyVapMzvKq1+eA/ASCh/MBPgpm85HabDsssnrekqO+TSyUMRXtb54sBeSYhmyyr2bneuTWhkFcEOsV2rgdi3qfhZjxtsJyZwKx5XSJwPiZvrvEwJKakp1ugODwkNQFtF0oL0e/los53/ny/KeGmgy4A== 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 DS0PR12MB8041.namprd12.prod.outlook.com (2603:10b6:8:147::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.24; Fri, 26 Jan 2024 23:21:55 +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.027; Fri, 26 Jan 2024 23:21:55 +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 v2 1/6] selftests: Introduce Makefile variable to list shared bash scripts Date: Fri, 26 Jan 2024 18:21:18 -0500 Message-ID: <20240126232123.769784-2-bpoirier@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240126232123.769784-1-bpoirier@nvidia.com> References: <20240126232123.769784-1-bpoirier@nvidia.com> X-ClientProxiedBy: YQBPR01CA0162.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:7e::25) 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_|DS0PR12MB8041:EE_ X-MS-Office365-Filtering-Correlation-Id: 618f66ab-93b0-4aca-98ae-08dc1ec595cb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YIJ7MVOt5zy/mgeJlC6o6dvE1tsWDxpbI73ZvET7V/b5hWVqiA7QKkQBsXVWmgOEkVIt+y9JAalIuCqQ6C736lCYIXnVUMT8a/vL8z2C1QrWUW+6ONxblLnoo2OiWJP97ISGWjYiYQpuWdXlzbP6i3LdUdHXGojEw11CZqfd1lFp90odahaee0zlbpQucWWTlxOg8UZjon3VdRxYkoKmJ8mCQpJtsLFTB6ilGCcdZrZKXz9q53yY490zNOmZSRWWziMSrYWtlAQ0GcVurCTk4cYWGvMMi0Mx1JKFQGhNQmOlrDJd3aMAXJHgLTrjmeYni7nsR0AbtH+mTzfH0vQ4GsNy/65l/5UK9Zd1Z8fC3bH8EAcyLv8phgLVytQKZlnYSbrxLb+hYWwLcs1plzkl/B+87iQcp0mU8Mi0UcZ8kchKc4uxT7CaoYoslfhB7gE0jw06Q0oZ4uIiw5tAdHqJ2XQLAMZefokIQDS5nzQq69Hm8GwscRAO5boGEsqDd90SofYf2EeHRXDzV9v8kYDVmQT4Aklkhj4E4k0uXRWz3qd2bMufhOQ48uhADICsDEMu 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)(376002)(366004)(136003)(396003)(346002)(230922051799003)(451199024)(64100799003)(186009)(1800799012)(66556008)(6916009)(66946007)(66476007)(54906003)(316002)(4326008)(8936002)(8676002)(6486002)(478600001)(86362001)(2906002)(36756003)(41300700001)(7416002)(5660300002)(6512007)(26005)(1076003)(83380400001)(38100700002)(2616005)(6666004)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nTnizaxXIU4U3XyOSgGyhdoEE26dDz7Knhc8DjHneOpmUZxqkFaIzc3iaslgJJsChdCfTxRxPHjTqldMIRPlq4dn/JStfq8kPzCxNXiFm2ro8Mqb+UmLU2SpRnsLeYHqT0FsugoC9oiW5kECntUYrIpvS0N9ZjPGTGNZcq13dLzZYQrmClprZIFUUK3N5KSe3rF29qadnG4OY/R/VHyyJQTsJGj4weenzKnqd0FnAkvauVxyquSOQU0la+bPzdlv246D07E4H+farW5JzU87KJz3TyL2oJaGNgn82+N2+ddh4ysfby8hF+pPtFOSetBDq7nvnAHAvwJLqCd5DRmZu4xe0LaF8QbMf6Xnmvy/6MAQ3yMtkV8Z3Zy1SWzoWsHgYSXiGXF/YRsBxq0uNrg0mZlivNDn+V+L1SG2bFZLMOBT/9Lx3q79dXvyaZh9jXxFYGM5gqaWMl1Sdgk9N3lDj6ZRpYzrtmNyw+OhfoOW3wI3EH+Rq7df9xf0JTivfavgiAmPgDwaQYmywjx9VQmtRfIondENOjc9Mg9jLDp+yPlymKGo1f2VBwK+4N/e6RZ6cbsrtzdc8Ju8Q6WgQnlExuT3auE/8SRzr9tR/tvkf8XqnKBhmF81VQ+c6jgxiSAw9Q+JvAywSbWzuhh5Xdljly0pnr/Yt7vaqiYDDP5wfLIXvSCWswHzYDSYHnPe/IZgL3jf7ypK1fgkmOJQIkWdt6+mSorov5AEQqc2IHbBWgaSpwXajil5ip7djtfddSN5zo/u/ZxUBN+LbtvFMrC674ZC1pEvexy+E6sNAeO+iBc5xQ6pbZ7bR82ZYPVQn2oIigx9mYkVGEku6Be5N7Aw2RAVDyW41qplMN3ZTElbAQFHXtsuzdZ6RpOKDmsSNXrGIl+HupQyen6upiysbVsZkiqjriwdC/AYQXA4YkzvMvDNP3pmldWKcKoEvrMYUcYn+sv+NyCfSr/ZQtqcyM7H1lgvcz36U9lvRWXsfU0R3116XZCp9PqPsrl5Gc+tjjJlOSlSlBRyK2jjeAddHLWmEpkh/1zNbw5FLrtWx5mTfz/1dEhhdqTDEcp0/v54kK6bpZMB5BSwjLCIZ2tc8DKtiFbqkZUVBQOSMGjgETa4RWiF4foikNBcB2GiKDC/Ja7KEKHt1D5P06T9opTcS/ll614mYyoaA8rt3T3jgOsuRZMZzUIwP8cZNsXXicATJChNfqSmHUQGm3nrIeZJVA99EPv3VIH0kk2eRyXOIv17GejZFiPc1XMgt1YMgpeW/m7GKccPw1FR8qgnOL0YohVbI7S9Udq6r7VXlc/nPGEmo0NMzDiAEBhm6HqEIaTcoRRjWVoUFG+MkQ9GtcIxHYF+gokYU0sCS/FdI4L+bZP8fazKz2UM6Kx9Pdr86hPV4DhVhpp4NxHBINml8A2xZloamHWoQJuW8lwgrLNn7E42wHfAUcEc3l/9nOIebq+QMqv9AGQM9Nntjo8ejAEWxR3CZn7KBpEuVPU0o4Yy5MccmN6qZWL+mOqk61+a6hhr57diU1G8m9FhZBY5obgSB9vU8NQ13Ne+dozednvjmdNout+D+hMVHtdkY1id6vdgfwx6 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 618f66ab-93b0-4aca-98ae-08dc1ec595cb X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 23:21:55.1909 (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: Vy4hif3QiZiGnFH0r2pr7OvyD2pXHF0FiAyV3DyUlr2YxVgYOCeiQY6/8bBZnh/ixA5uOicPcDXnCdBM2rIUCg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8041 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 v2: Fix rst syntax in Documentation/dev-tools/kselftest.rst (Jakub Kicinski) 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) Signed-off-by: Benjamin Poirier --- Documentation/dev-tools/kselftest.rst | 12 ++++++++++++ tools/testing/selftests/Makefile | 7 ++++++- tools/testing/selftests/lib.mk | 19 +++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/Documentation/dev-tools/kselftest.rst b/Documentation/dev-tools/kselftest.rst index ab376b316c36..522214c7b43b 100644 --- a/Documentation/dev-tools/kselftest.rst +++ b/Documentation/dev-tools/kselftest.rst @@ -255,9 +255,21 @@ 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 Fri Jan 26 23:21: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: 766696 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2066.outbound.protection.outlook.com [40.107.223.66]) (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 018915B5CA; Fri, 26 Jan 2024 23:22:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706311322; cv=fail; b=JTVkzBT4AzYlB07tLiZpvfmM5mKJ4xf71Koz29Uf8ehB1dHGuqz1rzOZZ9rV989QMrh0QmvzF6RftNKEBGx5gfSd0OSpZHPp2QbM6oSUA7BsHxB6n6wMLayVIqskGO/pz1Oill/btni8Kd0Cy6mwY0imbLK/G+vymYEfHjzvtdE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706311322; c=relaxed/simple; bh=W/z6L4hRgPMni6Unz9or8j3Iith4kFluR6fovyZD0f0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=Bv7ZtC63Y0a5J7ivEd14l4wzEgRX7R7pGRkkxXpFXscBka5Q36IwOd1v3BiLsZU9fpWsIYqbWQgtytTsLnYl0ycySn/31V9ZslRtsYNLnC5+RwALYaxe6iVclehXtHvkus+z3G6KJLhdz9ojEaK8T/6Kp6NUtXWFDhWEy3coQus= 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=YzvfvswV; arc=fail smtp.client-ip=40.107.223.66 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="YzvfvswV" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RcjNydJjeqNfSH4opGQRSWAiB0bvqysncFkax6NOl9yfKDOEiBrUgyA0CafUiQEz3tqwR9l3FCr3ef9d8HWH2nMO0Z07HTK1dI3U+likS8uOM0H7aWVq04fGSs7acAff10jlEgLA7J+UKwiFsvNnEWxmHkToVXnd29faVpRcLCVhY3ZlkygLBDrbiyUgjcAMCGwQkHaItYzQIS9KeSVqfb0zQ+UG+oKVK9FQemF/7rS1RPdE3+seer7cwDa9vRbUoMC7zzshhnnhd8NamZTJ+8R6uGZ1xG+/c3BYIuLwkvu1S2IL/jT48mvXB8HyUgMt2G6eMcUaWOYhd6gsptOLFQ== 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=I+z6AI2zG7Nq0V4Pn7Fu2/hHPew1TM2nYHJMfZp81t4=; b=Xva9nRWg2AbF3GZBQaRYdYQ5bxcUzkWntTB0uVDltRn2cgxlKLQDJOZOQDdfJPPKYF7E4Ni762W26mR6FE+H0njQ8nzBSLvZjI/v1v7gcraWXe5ZNhljxAOJTAw+QfkIIksxQMGgGDqNAH72wao0dg5ndjMkAl/QeTjttcPg2X39YDlVdyXThpDjCtGchQkL5xasrppVdkC3vGAZdXikSXuDvu6LALt9cYOlRTLalJ094Nu4qzNbhq0dm0uzJTcxQd07mS3TquziAPClf9fOyPilswsHwJTySHDGbPJoGgHXkl7V7/GvP/0S/oIqZEHZ0zCkkwvE53+dpQxVBqZSgQ== 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=I+z6AI2zG7Nq0V4Pn7Fu2/hHPew1TM2nYHJMfZp81t4=; b=YzvfvswVu39s09K13dhu2amOOZhx+ywNk5ONL+bWXY58UewLZysIJ5d2NuGNZ/Ykb4vv+T80VbXAD3FeVhner+B4rr6oRNftWhg3OONZcdiwMoGqwS6B6feKxLITdn+ffGWF2vTNNKVDUrNCVSkdy8goAQ9FUJhlEb7ZfCeD1mFj1rqjqmhsP8Z8nwcvqOlBpEy6ohn8SIZUuqp83xIJzzbnd8zoHsElTUvblicStuD+KE9xVPh+PulK0g7sq2oSAkWSbr/Vy0XrgtIGynnATTam6syB1hh3pNCvx5OJcqI2/SsF3dTsWOVuGYCGH27fKtzZc/brTRRCyeDh1AilYQ== 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 DS0PR12MB8041.namprd12.prod.outlook.com (2603:10b6:8:147::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.24; Fri, 26 Jan 2024 23:21:57 +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.027; Fri, 26 Jan 2024 23:21:57 +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 v2 2/6] selftests: bonding: Add net/forwarding/lib.sh to TEST_INCLUDES Date: Fri, 26 Jan 2024 18:21:19 -0500 Message-ID: <20240126232123.769784-3-bpoirier@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240126232123.769784-1-bpoirier@nvidia.com> References: <20240126232123.769784-1-bpoirier@nvidia.com> X-ClientProxiedBy: YQBPR01CA0107.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:3::43) 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_|DS0PR12MB8041:EE_ X-MS-Office365-Filtering-Correlation-Id: 4102ec91-9de3-421b-a59c-08dc1ec596da X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H2N8fUVnEe5JNJW04j6OU2bxQ8ikp6/VEcaMHjCnJfPPSVlVwbg+fTN9y46gMIsul8fYPSfc2w+A4NABkuKioDACkbP7ZuSRx079AGM23NAqAXRDek2kOFsVi3lmpemIURW1VLx+yCv4T1UJ3H3ymDMvYOvscI25OYV/VpnpRf7+G+JYyXYt8ilU3wDRMEryXo9k3SandRFDWLBD6ub4zPvvL4MHG1aZVlFjafAGXsSByB4tCbqDc5oCX+5TBmFyIdGPXILIW9Yu6K66hIqWkx9nH08Uogba5Nh5Rzi9ppo6ACbPWBurm+whzMibv/Ppr9CBborKLazS61nrvwoF1v+9AEneyXWrIBubIqa5Enr5tjhFhP6/LziG5VcOtHljTTjI8uhrLmNdTPMSl+HMl6S+lljFbh0KvGBzv5Ml9UnO7ZyPnQT+BhZt/j5QBoXEEj91zT7yLPed2xDIyzO0Vr7A0k0BNV5h7t43jgGPZYdLLKFGskXjQtQCizsbS2SxNTpAzNAqI1VdEBLm/ReXkP8+xKEDRNdE3RnFzh98ysBX+pVdU38CsvliX9GK+wQZ 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)(376002)(366004)(136003)(396003)(346002)(230922051799003)(451199024)(64100799003)(186009)(1800799012)(66556008)(6916009)(66946007)(66476007)(54906003)(316002)(4326008)(8936002)(8676002)(6486002)(478600001)(86362001)(2906002)(36756003)(41300700001)(7416002)(5660300002)(6512007)(26005)(1076003)(83380400001)(38100700002)(2616005)(6666004)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: e8dxFeUzWt7f3pI1CoH4SnEAynpuIv6qTyVJEgwY2/2zQVCenRshuOf1T78hNR+vcGQkr7lJL3NEQF8fHetLHrRieqkVUuwKdeh6KpPoRFewpaksya+OsCbpXs8Yhcu3rREzruG/xpSxI93/i93Oc3yxmMS2D/mJUKPuvvuTJ/D+9AhWUE9wHIrEEbjdklygcCtP+RxiP59VUZD2LEz7n+4ClBHSNHfoQF3eb3S39QyhU+Kr0RvVUAD69M3kUuoBDMVqZWrhpZJGItw3nlxP6irLJIzRYKrlev6rHJS3rhNyIxjGXTY8gJ5ZoFgUmvH4iDnO+romscc56V9JeB/G6ZnS/E3nsKRodUE9IY+2yrvxVnniN0MC1p02ZGzMM6gNGmfPONZEdTxn04x4tsuzoakBG7IX1ZdMgeaNTc7omcazwNDHvr0tE77Y8BeJ0stN/wc2Ho3wxpVIH5Iwx72pnjzxs0L8SVkZ6oBE2LJXSzvhVM1txvwg6coVs35TeCfzOwA/zSt8G5BGN4UjRyGXKqi5zAUb0Er/sJjsX2yuZFehE9iiQMvHCV2gTGECUA5U81qnrNaeUfo9B+9AXCVKMbKVlHIfcQ45yfJxP+MTYmCQQry2vQuXspoaf0P/jonAWQgfqnI3uceud5TMLC9g5MepnAxbSyUWoXdOHoion8j4VGPFln4MaB4bO+BClDPk88AQdHLvAB/n5cNeUAZsWIybdn5RTyfPUeIaq73jFxeRrl4wPHk0rSRYxsTW5WCzCvvK4s+bjDXW1f3Ne20v/nIt4dqa7RNT/oXQCF1MHt0gBPbbiH023Y0eUjKqiuQM+AJLVQJZtFEGG7esLisR2byHK0PejUouEjZherGBVMJwOFI4DG/DlZJZt3/kg54ybrfozTItXFpJs3dnbE4SiSDuBWQ3JFk8kopvsewMyI0sIZ30n8WenbbzO44HHDZOc4WCwBuClYSAUKKOTzYh1LKrSd0nC8fgbc4fScDDFo5x7Rtfa0Z8bdkZoBJy8kh+pdLn6puKXtKFyvSA51PaITjSsBA0kj7gmr63DuD50gOSxZRpIS0ymIuqXOvbnmXRbYGBw7qYb7/jg/qeCINnWbUeqflx9XISSZ877Ar8yNubyFmiKGEnF9GYZsfyHU+Thk66yKXbWYrb4ZCGHzCpRdThNzED0Ji7DY6GRCFSCM1s83CjXkHiHP5lUQGIt2gtTw4Dn3TjiTTzsok66Aij8nPl/k24TT79n59UAI5/73/Lc8hOWaLNGGp9yVQKmrOgiXN83ToL7Kg0tRjpsQO92NmnbBG/2PD22AgaKW9bLgxYbNJk2p7AXiGKHnop1Ad16Jve3lbfy1AF0T+2y+JDNVwAlUk8+0ifQFS5yK72SEr8uPMZ7PIHOpBXMSE7CquORN7mElLv40qk6RC+vRfn8GGEAftTjvEnU8UGwt/6CVT5KuUoFto1DJAPOYs7yO1TT6uxoac4mV9JlrorDVYcSAjIvyZxKAWLLFFUSizKKDUbtdjdVKmiUW+vF8LCPfFUJYEDYhVZMPiqLz2MB+x2MJtLI+/9WizflPXX+er+fI4yzS1jWGhBW9YegNRsEbGV X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4102ec91-9de3-421b-a59c-08dc1ec596da X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 23:21:56.9433 (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: CLshRXoMCbNf+Fx/gadfJWXZZnGoKpDk4QlpIxpOE2F4IakRTomnjv+EIEViZQDIxp+6Vhbd9U582hSOP6SWvg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8041 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 Reviewed-by: Hangbin Liu Signed-off-by: Benjamin Poirier Reviewed-by: Jay Vosburgh --- 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 Fri Jan 26 23:21: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: 767835 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2066.outbound.protection.outlook.com [40.107.223.66]) (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 E310E5BAD3; Fri, 26 Jan 2024 23:22:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706311324; cv=fail; b=A6/pt7EejX0OIrsKelY0GiaM42GVlOrjLl8suYsdFPLL9MB8BBPIo0nv3MQ25+uW2h5adY9ZAEUTb1FdcYjScu9pvyphOC9Lr9DJJPWRAzqmZZk8Yl1vWXbgk0bHwkSlJixS/O2PVqJOZA1tJItKgWLOkOyPFhkvdHLZtHj0rEs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706311324; c=relaxed/simple; bh=cA3k8LWm7VLtEPIYorvnev/YnU8E0Wk2+xw2LrGnWWI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=S1uYcpAJVgkeKW3vaqNFMJuslccrFCYzCox/0vu8XnkPj9wB1KkFfZu5Yn6w06ckb7+oG7B35hVmbp2nG+MLeTrLuLHpLouncuXtxvKZOAKzYdg0T/zPAyuaZN8kjXspShFkGL7L13ReFCJflUzw8Iou0lgu8fi6R7UIKHez9Q0= 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=b+5TF/kH; arc=fail smtp.client-ip=40.107.223.66 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="b+5TF/kH" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TP4dp+LnYt3XFLn2267IMk0fG95MiatqgJ2+acAAAVhXKiE3c8HnkjDPI2ZXL9cCvq3HvpiEFM10uimEaK29XmIo4VXYeBhwljlIoyAbK9IjUVdHhx2duslZrdo5HaoxCOf36dVvxStz+4jzy4j/6eHuU4Lo4pOZXZqmLNKJbmuVrwzZAHeEKLxcVv2ZCLBO9mogYiRjqd5GGm4Hztsic1yHELdDsWOP2ozB3YXkkQ42T9N4QfveQ91PQvmM2xrQKATFFMKgOvpD6ZpuLI9Nqa3979M/ovsydEu9fMu9jnIoNOoKTtcqd6ytUKCt/ZPnIod+xnX8o9conJx9xueXbw== 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=iWcyj8502/2obuD71VFDqmW6SICIRpBNjekg3HOmAyc=; b=O5p2z4SL7TdyFb/aZic689iJhhiUNYmqvRF1CPsFo2M2xJtxAbhYi7iGen9JVUnICH32eeBEpYZ2Qx50KubfHXXLwNADd5ox6zMeLDI4+ShUmFoyTB/SC9I11Og2372FY1SvamNu+3TceLf+OVxKtzrvnrMVVhZa9uKzNvTBJaI1hew8pTslDbeFru4UNoWUr22ZHPWXgHHH6BOwYOhCJa4qS06HyZ/7Y9HI2ByMyN3UCeNNiKlz2+guDsooJfKWvS0FJFc6vAxy+sPwR8cqceMduHe7IS8mKmOavKkdc0bt59lmiPgWo116mrEAZdlsq5Epas1fkKCAnZROxX2UFQ== 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=iWcyj8502/2obuD71VFDqmW6SICIRpBNjekg3HOmAyc=; b=b+5TF/kHGH+tcNb9W8VBfVUtvCUTvOZdCuUswJux9+k8bH/vqusY1VlAAff0O+Mry5bdSM8MXRVsSUqjGmcp3cccYN3oCk5qfv2wG7cCC2+mSEGybY+kYY4q+NMnXrTrN22p/NHbKOcXX8m9NOAFyGCEI+sr3qCFKy2Pvv9upwojnRCLw7UsVXP1MjnGhW1IYih6P4L9canMTYw8rB+yW40MWw0EUcPNVl4ct/1ZpNb02luYVwd+iIYau5rzdf2VbQG82pAkTXmiq3jekXeFxh1mXmRZLqVobTETpeM+V3DXR8FVq4AMsFS3OV7n1BiUqyq7cpqH0WJqlV4wd1FcfQ== 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 DS0PR12MB8041.namprd12.prod.outlook.com (2603:10b6:8:147::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.24; Fri, 26 Jan 2024 23:21:58 +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.027; Fri, 26 Jan 2024 23:21:58 +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 v2 3/6] selftests: team: Add shared library scripts to TEST_INCLUDES Date: Fri, 26 Jan 2024 18:21:20 -0500 Message-ID: <20240126232123.769784-4-bpoirier@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240126232123.769784-1-bpoirier@nvidia.com> References: <20240126232123.769784-1-bpoirier@nvidia.com> X-ClientProxiedBy: YQBPR0101CA0165.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:f::8) 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_|DS0PR12MB8041:EE_ X-MS-Office365-Filtering-Correlation-Id: 72c2f0bd-86a6-4d14-aebe-08dc1ec597f6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gTsuYngUkbLirzcnIrSiExx3k1Cp6UILC6DcJ7j05Ky0nyi8g5+bJWjG2uyoagv0z38ydBRjEH27I1+Q0jW4LSk10JnKpAQfeg+NTEl10eROfufbqCY4++NuZijngkSAyTgQD/BRl8SF1odOmtcnXYzs4dhKb/YVdONAFyTndCNM+fp8RCot245YekqqnQz4UyENEeTr5TGxyqVIBXfK21JJ/KOTr5oTTm4cdlynMH1WMlDchDb/1oOKax95LDF73u6WpYqNYo/qaQqhN0BMm2sIB+kBEj0SPsGYz2sWK0PLThJb/bnVSyY9gMdWOP5L9Hx4scRZfd3BPYV7xpJgvZq8ZnRt19zmbQAwDgffZ8gYtA2/dnozuFyW2X4nQ39u23qh2m+6lwUU5JST5JTSzV5UK4THF3z9+KoH4+jVnqgEQ7RGZ/9/JYs1Hvc5biusVCFcsXkBxFaxhYqo8oWNugFHNcFkb02jHxpJL4kHVmfH9GUYY+xGwmW2W0VWBR08+xKUPF3EL5bDdufPOh83JgvfucAqsBNfzUPMWyYjIsd/TSGhZY2K/HM+cXOjPU5I 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)(376002)(366004)(136003)(396003)(346002)(230922051799003)(451199024)(64100799003)(186009)(1800799012)(66556008)(6916009)(66946007)(66476007)(54906003)(316002)(4326008)(8936002)(8676002)(6486002)(478600001)(86362001)(2906002)(36756003)(41300700001)(7416002)(5660300002)(6512007)(26005)(1076003)(83380400001)(38100700002)(2616005)(6666004)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Nzv0SkcoAuRsjdY22tCN0at/o36VwOxYxx9Seu8ygtf5kwgNjx/ChX/ZxFmTZKAxz4Yi5QF0G2NFe0LkH2KiavnNJzty9TjJ2G1piFblmqMpvgWwQcMsEoY3Y2oSWw2dttPtGgSPRDMurClRkyzyoA92tXsCVM79IAvflmTdQqKL2JPAykkTwQCK5+DMmYrhOkkuAIqBAXm/qQmHn+EcNBdruBvx7s9owkWHLdfrHhZLm/iUIWe6COhFODgqI4kECTiBLEmqU58zk/fM6sOjZ4OGQMJJbLB0vSZx9cBIqLd4AXD0AW1ygyst8exF4koGg4rdD/eRDPjBoydasTFytg8w7+wd9peDGk4hGv/j/7uYJZ/gkPM9Y9VZUXIB4Pie/ubbvzLXmvfnZ3RhDV2sp2p7RqarETiz6HpNQbKMFBOBoh99qxhSOxxh93o1dKwgr8i1kvrPObfxm9MhREeVm+iv0Fs5Z/KneJrLio3onZTh5a1U5H7i9ZSoX7z0+/4QojA9VGiD3zqCxKszbxrSreZWF6e0XtMiaJszW1kqLMqqQA9I2QV40IsO+wgfDBvs8/fVpswprROk9RMxQrl2i/IgXJeOg/MS1FsHHr3WpJoxyzA9xwa7rkmts1gQxxx7zGSIKbzGhJLJSRs0kJV7WJp+b/oQ+W53LcZr40zb35o5LLFejuX1V2og7zLUaAtZq5DSQKukZkJRyd9QPmir3uTKI19WhQNE23YBAsdHWJt/6ceu8ezDkPvUhGKm1Qj1CcsWbaxbeP9X4erzgmz50JZb6VuQnqQcX0LLeMG91Ra8xSfXEq9Z7ZVwM63SqOGkPCp3BHOk+OKd3qZshPKmYNFTdiNcUCTANLdqwIlXAYec0EJjKHvEBsuN5EUeifKzsmrHb6Pxh+HMAcMpwBKkB3sPo/QW2OhA7+y1I4DUFwCJa0OZ7knQUzttJm4+Tz0WB/nuCc4oi3JZBEGyum6Vy2PiQmd8jp4WJwH+vuH26EyHfmDQFltBO7BUYgkeoPZ0uJH7leyOaCWTC0MZ1pn8INwPNnY+Vqi3nAB9NNGwp3+M9EUVZJFIUbVfBdGmRQnpwddhMy7j0Ki7SD9rmmCIeaP2KqekJR6+xSXa4BL05vmnzJWZjqYmVGrKBLopa6rJwkmws02jxUsFa3bcPlM99Fe/NBDnES2RpJA18qf0bWxEJ0DyiSdeMtg3zMSjGdrC8AuxKcgpjxpTnI3Sp4+jqVQfW3C9cCT3gxxT14595v0rQVY/3JKpCrpH/FB1kv2ZS04xsCWkXmS5szovHfGv8UTWoKpJ5tvB3neLKqfe0nNuiVGqJ0AOR713OA//GzN6aGQ1fiAJUjk7em6l0opF26neqmcgoy5B2wsOEonPfk6dzkWm/OO78lnSNOi1syqsGflAhHdMP12OGE8lqMiv/r1JSMKIwScjoM3u7KCQop7DbWZCjig/ANQD7hlWyIc2sdXSCV3QxGACaou5aEY+8cKHpd5YeppBzh2ReLUnBS/xdt+XKKh2j5v6elgpSr3lfUOhCDCsSdbWUVj/PpgG1d5x5/te40arR7pRv/UMKu+6LYdDhbC33ct3pdhfsSkH X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 72c2f0bd-86a6-4d14-aebe-08dc1ec597f6 X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 23:21:58.7879 (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: daTAm2YuFwZsXiN4/HyzXFOS5roayCXWQiiTDQOg9oM7pf1PJ8K6Ua3MaSQrJuYUv+1kk22YI1iYwCuFTOydgA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8041 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 Reviewed-by: Hangbin Liu 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 Fri Jan 26 23:21: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: 766695 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2066.outbound.protection.outlook.com [40.107.223.66]) (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 B35FD5C8E9; Fri, 26 Jan 2024 23:22:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706311326; cv=fail; b=ANQ7H8PGWiBcnHdM0x6hQewZfo3Lk5MrzdlvDjRVxauCGVHE5Wcn8HPK5cG+c+al9ZU+Qresexg/8aRM1fCD61cYQ4E1CpDAn0xGDsYcy7GADebzYXSmEMHXsRdsfAoMUyP3Xj7bVerepzCXoDA56XiETKi4jinCY/hmKQJFt3Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706311326; c=relaxed/simple; bh=3p6DW1oGUkB+rbF7QetRxogci53UjHtPBdqppz77xeM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=luhQMs050lQ1Rk4i24BfWKasfjtk1hYnc1wa99l0FH7o44N7xca89tzoHm/CYMxU37J+iIDX3zKLxeUxRt61KOBkPvtOYpkQmrPM5o4P2J8I1/Eo4ZG6q5F22AMqTZutCJFBc7UEQy5YA+CUVNjJIzt1o/GoawtnCg3/yVnH00I= 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=aMIG8p2A; arc=fail smtp.client-ip=40.107.223.66 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="aMIG8p2A" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l0xoX3Lr8HXqgjifShyrGbgqYbkRT/vGCvszOUrVtgtviTXQAmWyZ4Cqi/LOrNODSelHi7mfCo5ABklmx1LPJE0uyX8o2ENc1k2gFeyeesKPBGeSiq2d40IP6pHHUqc3QEOejHhIFictAwz2gmi9Rzvz35pfjgJkj8D1e5F67S/F5iG4MgXP/55P/Gl42Elxn84laaXMJMokGjpa0m4xtvJj8t26dDPMYGnU4cub4skHzCucCQJSeZiBYwXwvwVcAPQvn5nb6EVnX9z+NGKlBDmBcyUBvjc1bVrMSpE9242LUj8XUvPMSy8JDZ4aG2MFcZfc0ALxq3ZXP8VP2LHmrw== 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=lbWz/pBwfjLBLKb7hvVMcCd2x9ssSsmIQXiICIOGz9c=; b=GBicERYECaPhkyU3c5vrEE1pkGZCa/Sn05stOO9YZQSweSkSP3CO6lvccq98uMNSe5CV5GNLPnJWm4iEoOxdka/JldT6icp7ULCKqEQcT2yvCY45BdzHMYBlaNO369q8e4dyDMR3jkLcmjKHXNYie1X6D0mKp8u3zfBvTtjjIsKHfbu6Pj64mPQf3rGVC5Rav9O7I3U+1+QIAcz95oGUyeF0yzlhQnt3L4h3A7S5+1X0zNAhN3XMLZZfBV5uahST55LdN3zKLfSWnnBb+s2+Kjbrnk55aj1KmGs7BAcH4thhZtLTRefF6viNHQekpRFfSGbVDBDm4FM0HoGjkapDBg== 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=lbWz/pBwfjLBLKb7hvVMcCd2x9ssSsmIQXiICIOGz9c=; b=aMIG8p2AFoNXKEFdOQkJqURJClBeMauihmU/pOYuLI0ZEi5NHn0v9dzch6tqE8Zlm5NV/O+YfS2lgP05dbbbQQuQeG0n0Ue/fq+1cnWXW+9CQIo38L5QVhFluth3MRZD4n+dGpJwtAdeGWOVOlpkVeFx5gSXn8C6SCyFKNUd3Vh+PiC/1Rvo8fpdT5GuQwZv+AE6Zr8TEm1YwJ1L6MIFoJ8a263HVSxb5NPrhjWoXm2TDftsU5NjGOgAdpg1efcwRTgKEqyXtV0WbL1+f5hF6g3grdjbDuFazFS64hI3UYfbXjpLpFV5ypNCgydcfyhwMN8/bbo2+TOXCFq7EsIC/g== 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 DS0PR12MB8041.namprd12.prod.outlook.com (2603:10b6:8:147::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.24; Fri, 26 Jan 2024 23:22:00 +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.027; Fri, 26 Jan 2024 23:22:00 +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 v2 4/6] selftests: dsa: Replace test symlinks by wrapper script Date: Fri, 26 Jan 2024 18:21:21 -0500 Message-ID: <20240126232123.769784-5-bpoirier@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240126232123.769784-1-bpoirier@nvidia.com> References: <20240126232123.769784-1-bpoirier@nvidia.com> X-ClientProxiedBy: YQBP288CA0011.CANP288.PROD.OUTLOOK.COM (2603:10b6:c01:6a::22) 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_|DS0PR12MB8041:EE_ X-MS-Office365-Filtering-Correlation-Id: 6441e470-a5bc-41fc-446d-08dc1ec5991c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q5v0206bbjI0Tazoo2BIi1Hj+Hzto6iPYeHRG4lFlNFiCvozTCnc4w9mQbFrDxfAMKxe45wvu938JAxU/D2tVfhd+7CEAQPMNy4BzkFyu25ovTae+HC5hSegBWJKV1Gct8BtOqsQGLPqNGKuJq+NLY+bY5RqcCbGBK4u9ROipLAsMhb7pssIpbHv5atAd1JzkBZVHXj8bGMUvl8ufiTupu7CMZTIqgr2J4Yes0ZdXQrB6K0wWYNvW2vmJOxKjSj7KPyVu8i0/glmKh7YU7DFmQ1+fA58hacThjpV9GUnFLW1sbNjbrJ0vDAYjex9wDiDiCSew0JcWNWBji5fWCo3uOAr1PjwmcME37UxZCi6WV7Qu5qRm/yZYjM5tnp4jU9THcl1Rt/U01QZZIIhTPc1mFFyB1qeIWL8r1LPYkXhJLBtFqbduWX2UZsiND3nizCpnTS02aGVkdYm+Gsa+JLLq6EwUSbLh6sdMileRNgOa+Esize7hftb/2A1BMl2IrDoXFRsHn7szAkNaLM/tAVxM2I5RT/98xNaQ8YJTVl7zl+2VymHnJhetO4ksYGNQGL/ 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)(376002)(366004)(136003)(396003)(346002)(230922051799003)(451199024)(64100799003)(186009)(1800799012)(66556008)(6916009)(66946007)(66476007)(54906003)(316002)(4326008)(8936002)(8676002)(6486002)(478600001)(86362001)(2906002)(36756003)(41300700001)(7416002)(5660300002)(6512007)(26005)(1076003)(83380400001)(38100700002)(2616005)(6666004)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gTRKYclMMDuiio0wxhgOZGnh6tUo4J70mAp3F6UpEy0dGXaJGdYECjFQxL2aXKRuC/gKCA8l8ARKjjRVY7657dTAguScCY6wWhQDVBh6eHG0FRZJG+qhHlALo0UKkvc/h/S9v6m/wXGIH5JZgeiEukA8clPMlq6CzyhsGdeWlIIzbHwbxTk3luBbihg2eVOXXJXTf3Q4Ubh4bxCuPYnwh7h8/1Y99Yzw0haf5xI4XW861OgTgUnDynGhTuVVZ/6L9uB74PRRyIIkAlVbHFhtAV0SCz4MQC5U9U78DguHwXtsC4Wu34hzAlF2xKMlW8FZ61dJzISiRpRISZfd/Ea9/m2Aksvxtek537o+JKxSDgNL91oA/jRiZj1uiui9PNI4oapWUHfz52Ej8BSUUlcRCsZfico7cMvPfsdM1v5KO4jKz8z34/QmEaE5kaMdCBy5JDsdx5oh/iSksX04bfknIwSJpnZDOQuZVvoyPayJOABzl0uaKCyZnWwC2OMOcnDwxS9xal78t2C67w/5ClcyobblSkTnS7NHfaxSVeEzw6BWWKfCJ8XtrP+uHr5oADr4VeTJxPAgKRLU+Uuasf6s41mn1HkQn7Cp08QtVqmiFnljeh+uRZJACDQnrc/Q8sVDK8qs3ssWrEtnxrBERS/PmdkJ6c/aTrElJQDHv6GgKyFQ5ydU+0fhh0e3bIRTCIvkPgMSqLMY64KYxCsWka19QmkIcub8eZLUjJ+run/Mmf42kBFGy5NYjsP7xQtc0FJwwj/mVeN/il7SAZ7seaSk/6SCmWfNz/q0alHofy9i3QuqC3GJJjef9c60CNG8bt9Nkub/s8WOv2l3TLtyzdrKmYNMuF6QXVwoomMMgQvEykqqy+bdrMx0pI5BxKTuI8A00a16Iulx0ihcVTjj+KR0cyTsS4OhgCY+lUIzrSlqoZyBP0snpkbV49iOJJDfsE2zriyVhdNcH0Q4N4QY926KcjtTOLkDCLQ6B6IhJvhOo/Qu6Xt7+wje8xS4yhHwyAaWVhjZo3EzRk7tVM5+GHvp3z+eqEVHYAx6HLJnpIqn2mNvE3D/15MlMDny0/pBjZgWlPVkmS/oEHfzwjgIhHgdUWHQfhd4e3JSLAmjLYuwPEP6eZF7Iv2NgN/0pQenbeTWowTfFTk1ZzuQ3qgm/Fi/mKFRlb7+rYv6rFE8xIj4JVvBhpXhcgDSZH1w1WimGhcavdcv77R0n7sWVt5cIu/DKVcfl6phmrkAYeDei3GXvR6wPE9K8d9xBOls212FnugKhGgnem3vuLgRgPdSqsXDnLdBlUieSZ8uUCFMLC91dOkI+AHmRZZzNFEIfuyDNH9fnRpR2L/DySch4KEgvL3m2SUpnLAdfd0/V1+dsw54jNkRXzQH7SqKD2h/h8FK2TC6vHrK9+PrbrQLKALG0hV/hEnEmr8L5WhdW40Gmn/ckHiLBF+W1RWKEulU52u0Xwm7bG0ZaM2X4+CtlJfDtxGTWHGYbfXf7DRlVEJffCrf64Q4X7YJbMPfDbiJ5CR8DjSRzEFaQ7LTiZPQFF8gsfnxVkU+ys7LudQ9Rk7cOg1FfUo4xzJ6UTwYP7jSAtP1rwQd X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6441e470-a5bc-41fc-446d-08dc1ec5991c X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 23:22:00.7275 (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: Jh65UsVMy9/jjeHL3iVp2I11yLtRuvX9ivaqAEGHXY6539AbaD6xRg8ye2MMeHIkFNgxav6h9UbnZlNPPRCSQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8041 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 Reviewed-by: Hangbin Liu 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 Fri Jan 26 23:21: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: 767834 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2066.outbound.protection.outlook.com [40.107.223.66]) (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 B2A025D745; Fri, 26 Jan 2024 23:22:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706311328; cv=fail; b=LvyNe+tdBF9dqDh9JOVFbfm23RI28ANwBPpaphaBic9JRyXE7l/LHTDdlX1cJhYr+vtHKy1HR2NIZRZ8r7t/3e37HmflNsorCbPsLv57kZJIlxfarS1C+O+kAUPZY5q6F7RGflYcqpYxXf830mylJj88I+Pt0a6+WqDLVimGw5o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706311328; c=relaxed/simple; bh=6w9vQANJovGfSY1g5pspGk19De/AhchsCn3gyALZcCw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=aJTmwC3gBtFOsdHxsBS94Kpq8at7OzCLwnPMfn6cBTb2AwSL8JLV1zgHP7Hp69GjnzapVbaDIpxByODEw6khOuEmxjqQnjFo6vstKXFK325xvUlkbDPjLwmZY93XQFMF1DJ4iBg4iBI25ZYVh9z6Vt9Ls00+gm1c7slh2P/GNGY= 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=VJQWuRpw; arc=fail smtp.client-ip=40.107.223.66 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="VJQWuRpw" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N0R/eFFcmGF/9YrafDA+/P6W+gPazKA5iIQlPgPGbx9YH8QqRJfIgh1rKFAjUgbZT2Gw90WUb/tji+9IuHxzdA1bDAQO3Ms7zelWkFSJY78fZngMqK2Zvkmop+wfZNw8rTdebHBSHqfSyvEzWfuHSqzEJfNz2RAReVzZDkG4EqLHOzVGnYN0cTj+DAxj0lqB/7fgDkcVqB2Bs887uo9yN2vEjjSuZ76G9CSxz4eSr3g5fO0CRfVzblkaqrk8uR7B+SDXM/qdW2sX+El3TbmWU9FGK3sr8AVC8a9WV8JdCPqgGTpefaIqvrlyTcTFu7ylHfsbn5e7bPAyi74jApMuGA== 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=ZO6+iRKPyLNDF2BG2HxvPrY5vhesrEyp8YGGiu2tc/Y=; b=kk2kw+tbEUxStcBMpOciS8zbvWLHyV14VXHjb4pVngm3MVJzNjsuQeqU/Lts7w5COQg8ofWP/f0xWgvIe+sGLimTzLPKnUs2pZtqDNKFS8NLY1meYBWyiuIv8IBG5nS+LsmV1/YLrizN9IT6Pko5ej78uvt7Mp83ke/ac723aiSoJqTj5j4i5t7JiGYgCAdN6g1zjqQLokWGuEe/N+CnLsNgK44Rui7fjAmN3kf/+TwmPjPzb4/HX0KEp28FIBmzPLcFmes5vKjCml7OKXosMW2loYtb8+eifX/DwHzYcU1ywQOsgDflbXf4UpZzkQKqLeLJRwYpT6Sr7U9wNu8+pw== 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=ZO6+iRKPyLNDF2BG2HxvPrY5vhesrEyp8YGGiu2tc/Y=; b=VJQWuRpwVu+6J6mGwAqa9wW8SZcOP0mZaME0POn7+0TPVvc9fKKqItuntpkJkAJS5eEjtviPjiiwA9XUi8uoR926eqP7I3yaaAd0nZp+ctffZVr/TrBJqN5XcMwC41NOFo+iD92j+OzdwGWdhuaHMFYRwipKOXF+PO93IAqQIRNI586SPTqguAnLeJsIA6es40ecRhNtMMu5xQX8Anl91JKjdIcA4fZIRsKLeN1/OfH4ALswBkc1r20RzPbYnDWrdo+BBJQk2u0U3tOfoOBS7tcVpOypivAZfJTj/4ZgBKCQUCoQSCDvmrmzr0R/LbIjny2nKy1HGrQeT9/L0n05tw== 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 DS0PR12MB8041.namprd12.prod.outlook.com (2603:10b6:8:147::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.24; Fri, 26 Jan 2024 23:22:02 +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.027; Fri, 26 Jan 2024 23:22:02 +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 v2 5/6] selftests: forwarding: Redefine relative_path variable Date: Fri, 26 Jan 2024 18:21:22 -0500 Message-ID: <20240126232123.769784-6-bpoirier@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240126232123.769784-1-bpoirier@nvidia.com> References: <20240126232123.769784-1-bpoirier@nvidia.com> X-ClientProxiedBy: YQBP288CA0020.CANP288.PROD.OUTLOOK.COM (2603:10b6:c01:6a::24) 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_|DS0PR12MB8041:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b9b539f-0aef-45cd-8e58-08dc1ec59a55 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eHMut48tBqpWOBcFUPbWpLQKfhP6eUK4ux8YlGRP27zAm9bGClTpP5U2Q6n1Lrm4uKuBV/xkbuLJYAtOmK8dWFjBthKAJWshkmVlea+3FHIga7IJkqtqYfNQchnD21VAy/myYopqNbrDaPUZlvrWq2ShjjzPhMvMM2GIfVyhyWLUOOgbc8A+NrnvXHoR2EoD07ytYaCJlVqlvaqGslpcXFg20qoccLDuihyDXcyqov0TvCc3uefHttNgYAii9h/jmK/Bk31/gra/GR2JBrsZqLofkOd4dxYpptH5FlpCFWDrLGecIGBI0AtMe4i9vL93A1yooYzMDxId9fdOeWwajkyrZpSdrf1yYVGQH330S8LQ7UDJGbCH8disl/SVZQIbex/LQ83qxB2vSkZLejUULmRRphr56DHVV4vjVK+9glcwK2PvZ1CtXK3x08MSm3WxJbwrJgxwN8HFSabqqhR7EYqniVq3FwM4tNJ7Jk5VKcvMDVBskmzJecIRe4qeP6O/sROztIzExt8emo994uAus0Yn3nqR58Y3hQZIucNLXsNPWz92qNt/6cr2ogDkMwDa 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)(376002)(366004)(136003)(396003)(346002)(230922051799003)(451199024)(64100799003)(186009)(1800799012)(66556008)(6916009)(66946007)(66476007)(54906003)(316002)(4326008)(8936002)(8676002)(6486002)(478600001)(86362001)(2906002)(36756003)(41300700001)(7416002)(5660300002)(6512007)(26005)(1076003)(83380400001)(38100700002)(2616005)(6666004)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Y+0P2nrk52VrDpGaiNLob1jBYxyddZWarsqOZJw5sx7p75JQph71fpMi6sYcabDmneSG2nFMHnwlG7srVqZThulGKeQXZPJ264F2DGmn6V5CrQ3ZHqF/2V2KkJARd7lqGIFqixv65izXxNTb2p5vrrEGEDSzawHSiI4lY3R7iIeIskyoJ/ANkDN4ipU1RZJi/dDYe43/VKa1NT7lNjL59alzC2W8jzYkO5dwQ0XuSnF+XU8YwOPQAj2znVxwLB1CETlfURdzIviylWcZPpXJ3XQG9PBFk/6c3EthUiKEYOwKF/p+4e7RFt6iGaZ4RYJpzD2/W5l7wP2hP39ou833EgSWjX/Gv+1qz6eZjzMNSwgj/30dvvHlHmwK5UJ0usGvs9PGfaS0DXcQcV9dcvTZOou/NojLARpjVHZMzEw92AmCdm0Q4dt8yagZaipEFZy5IQLVt7Ld/yI1IwkTlAuNzYAsfTgTmOYaekTe2DnlFjZNol1fylsSfPwp5aalEj2Ymyq70qiSMBjAye5atNSbZtxF1XfXYBcZCE/rga1iTwMZ0qqgJFUArE5JagpDB5r4/BQLm5uusoRUOEjn73f6FXsQnsET31LSV8Qpy5RSPc6/o+7qqAMY1acECgxZPDYH5fMVpMzKa+ROLP4vpvXZzBPEWGeRooi5bYbJRupjOBqbQlRZPW/h8gZvEyac4brnOxPAG1jXsNw4LHasn27yCvpuHS9dcC4mxEeGOFm2bTMINkvQER6HOeFXTNXA1MaXyvCeLFABjefH4wwmrpiyfnrtfYyDt3pjq5rgknyKXj31tZBjnmaOGo/odhq+gqzduUvJgyrZ+SQboO2YPw7jjReZWlUfGkXUCmH5EIEzS6j5H4R3eqMHGZO7Ir9P41KkG9yhGnAL+SldtjMGo2dZqKuQqiFSOFuoHXI9P1rBqPx7fFlbc/P0HvM/bb6jLgLrfR3AMKrKl1W+XBI8PyNoPR4bf4MuWIheSplf/OyTWzE5NB3S3cIOm9qxGqggcTyg1/45GBO41bMGcd2er7eeBmt7rUadfQdD5zRy2VKHOvt8wPw5E5FCIqgCSejVj6OkKjUONCE/ed5L4FmERid5eQKnAqEJGXzIHK8kHrfuI4HVsAOUuB3q/2Vk+6KG2OlDWzgkTZQ0IEaZrqHMU2sqY3eBU+30AUb61urcCcCbeyF/G+rd6NPIk1TuzaqPcYB6QT3ztW6HURFkHoc/r3CuLbnE4RZmo/MBWyoRU6q4B5PEpF7rSFAo0B96mdzyveJClochH5qTBFiRsWj8m8eFOALsXoH0k9Sl3dd9D/6Qqn54CYCvIxPdrRJqKo90Ih34/MmNILMw0GL+Fo7O6UzxjvxGN0sswcgBwLQd2cs6Ld8tWoZtOBC68MmsbC8acReE1tDXywHBUMms/CZyUmOs/9nNPeLUc8NlFGOVnQPXmLPSKEwdUHYvJC5mFgxnVrUpd6j5N/EhoEuWXS3X7vnswmn9W+hKeacz02ZZF1N4UQWvD8uD6RSwfeHajwxiPt9JQYZBuxgtHiiJYLYYo7JH3ZJ0nD+e6YuCSTcJyHroDwbpq1yEbXtIgc+hmC12d1Bq X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b9b539f-0aef-45cd-8e58-08dc1ec59a55 X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 23:22:02.7987 (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: XbTJvS4Hg+wmb2Ggo6CHcjbxTcztmjh/0ksZq77e1cWpXYw10ubrh4NDj7U/MKLOUX84cd/54UVkdYboDdJUNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8041 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 Reviewed-by: Hangbin Liu 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 Fri Jan 26 23:21:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Poirier X-Patchwork-Id: 766694 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2082.outbound.protection.outlook.com [40.107.223.82]) (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 8AEEC60241; Fri, 26 Jan 2024 23:22:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.82 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706311331; cv=fail; b=eCySS44BPqDopQaOVclUcAytucj0pPbPRBrjGzDEpvHLHE38VUli7PiBnA0UqpkR4I3HbHaqh2MvV0/uX+DYAJcAtgb3awcEf5/zoM39/+an46kCktkf4YDZ4c89IfpaCeUgsImjt2RmPK36FtHfI6Ka7jQ7gm69RNXKZ61H9Gw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706311331; c=relaxed/simple; bh=g5aBH5hFKQQvOMjQuCu3h2MmLjLr/+qf/d0uLMFduig=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=JKXIE7Z45NOBZ1rN37RawUH2Lc4IP/kVL+/FCNk1VW+ohwvH3qg1/PV8hINpikhAqGKrqdCYcAb+k8JObM3bJcqvMiJEpk1XE4xPdJGa/XrxtJhcmA9OL81TIf3qACNuxpXyW0awt0XbceQyCn8J1jf1VzAk9b+ravt4HGR9LrE= 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=suieaG9a; arc=fail smtp.client-ip=40.107.223.82 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="suieaG9a" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fCfCYhvcqOop2BxkNFp5D6WDgT8V9jxe/XyEnhrNwdo3TzyPwROlIUYbeL6iTM40gxd9VyYLLfh+bRQCdyloJ4RvJLalXhvDcIlPmf0lOrMoaS8EJPr3k6Yp5hZxFkhgEMtlKhLYmWJv7m6V+DEXhJFMXuVoDQ3nMfm+ErVDIowXIlZIW411dgAr9me7DFjwgzHMDc1nkH0cXhhg8O4jbFBIPnQypOqE1xJPb0aBn/t0Ry42/Gn56/qRhL1HEYVeLZhgmQgmGokY3s/c9FGrY1pLJ+2ICWylDQ12VZ5GAh8zFEW+pLyEwbGueV9JldwwHiH4KZWAUOxkRISadhEX4Q== 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=6DISkww5q5Q5Qs0faa82TuIbhInr+b5qgszbXjqsab4=; b=hSG3VMnJA+YsqqtgSq6nhmNj/UmDikDWqSi4RcZRBQYiGFoNTNuJCL+w+wrzYdwNVcVuRbtzRwA8cEvhzMb7eSYBdl9dORxMyPWvLQhsA9QM0JUthHf+nxY6K0ubgFiGEKHqCt9hqICLx4PuWQBAplnV0oc+D625kaJJuFhzizqvaQfQ8oz3GzPS/azVYE4So+h9mdnkyoqgzntaakF107OEE3TbwBdICFbqgGZDR//EhyRVWa6VRQn8g493bqj1IMS5uLNKJqT+UbFtYfXa5QKodCnp1ebSgWaHNjG5D6H6UsNxf3YdGEWj9HUEbEXKKBYe842Yo1rHg/qUEFUelg== 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=6DISkww5q5Q5Qs0faa82TuIbhInr+b5qgszbXjqsab4=; b=suieaG9a8tcDgdsCUFnW8NUWOn+JLGtQJvqpYs7EsgBcHpTp415VeMvgtkZ65BP5sg4t4zD2WjheUI6IRrguXuRIliGvju05bn37nzkXpSmuHmy9tOSxEDas43Vv6OHe1nZ7JyD1Pt9yLN7W8HXlExNHEnOMr+zRoDjGXF13QAD3Rx+FFU0gCZuauHx+Pn/pCP4H0o7i+3W0vqE8NRq6+ZGrieDnBeW5NoQ5BoOuzBMHjOGoIUk+bGUlrvQ2Kp3LRyeTNPpLLEkdWChww1T/rYO0J0g5Fzr7i6e85fVgYcE4+aEAn0FCvv04nSPSRHek6JcQ+DTe+zyTWkpphTFlXg== 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 DS0PR12MB8041.namprd12.prod.outlook.com (2603:10b6:8:147::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.24; Fri, 26 Jan 2024 23:22:06 +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.027; Fri, 26 Jan 2024 23:22:06 +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 v2 6/6] selftests: forwarding: Remove duplicated lib.sh content Date: Fri, 26 Jan 2024 18:21:23 -0500 Message-ID: <20240126232123.769784-7-bpoirier@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240126232123.769784-1-bpoirier@nvidia.com> References: <20240126232123.769784-1-bpoirier@nvidia.com> X-ClientProxiedBy: YQBPR0101CA0111.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:5::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_|DS0PR12MB8041:EE_ X-MS-Office365-Filtering-Correlation-Id: ee389869-c715-47f9-2b1e-08dc1ec59caa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HhmkSJCkQbL+hBe/ggutGkDbvDnn9Z2K7rq6TtvMLCz4Cxl8Rpbaeu9gjVjBofw6X421t+erZJ8DPrhbPXDt7UYiLh0mF/iUXgopoInV+KAFxBqeZfNTPGjposEWubkbtBbnGurVxcZCVfDlhHRrvPtDsOzTFGuF1zbAQLj2MuXvF6kv6lx3eq/2XZZQfwkve6iWx8uL3pNDkMO3MN3VReGG1vUmy6X3yd2HWNpPdSeaO2NKZXlO9wDxB1uPx0vki5pInS6Xsu2p/OIr0zIMovfwLAb6YFJyxco1lL6wMrKdDp4Z57UVumS2fb/SoQDIeBEP7vfjshVBN4/ThUIKsaPNqfAFVeToR0ScYZGNGajbdIvuoDz68UmpxcV9t2HZq/Y8uU4VoXBqcfO+1B5QJgCyA2kw4szVPYyq3mMFEhT+Yb6OiQGMxQSnTUVJSQOzqdFt5U2qwL0Y4SToqdPpZnGBRAx31zOGzQszSccNLZ4WivnbEw7Hz08M3knLQ5m1LndqJa7MqeQZN5wAL+UI/WMZ39sNw4ELtMyQRPlhwSOK0xucBKTJCVHq5E5/gbIi 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)(376002)(366004)(136003)(396003)(346002)(230922051799003)(451199024)(64100799003)(186009)(1800799012)(66556008)(6916009)(66946007)(66476007)(54906003)(316002)(4326008)(8936002)(8676002)(6486002)(478600001)(86362001)(2906002)(36756003)(41300700001)(7416002)(5660300002)(6512007)(26005)(1076003)(83380400001)(38100700002)(2616005)(6666004)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GFqjkJuqtXeXIOQ7TJvq8z83bBXQFu5D0cfynU1UHfKuwTRAu/tBqVrczF5l/ArTUYNTGKZ2B9ftyU0WwCQMeBbwjrB/h1tbcLlO87wrSDQMK34GOL7jbV0IoepxKDNiiLd6Zs3247/7YfSfj2IVdepNUdA/eZSUHvqbaL66ImJOalaI6FKLQR1Uq2XvcMOCWEPELZYolOKqQoMGHW1ILLQ5qYIAUofJN8N2+DPz68f5NoMH+VypHeMcZSJTP3tvGvpNcbjr0RBWx/t/yIjT73BvSMwXiQ0N9VzAlGwkyb0q0r5bpbTStB14TQwWgmTnJJ99J1CNxmEOrM1Nhibp/zxUfoGV/qGcKazCiZFXv0q03aefc9B3i7xh0dzY1+7NU3CodD4KzJyybJXFNjcdNMuQkCpizdmXkO75bFZbQza3fwAmUisNEpCtZYyl8CQSzBuBO2+PL+s/dCyAEEJVg88mweep6dloYPKngIuOinlyIRqF73Q6D2Mx5Tw9WVVaOqT6KKj+TrFS7MC2Z6qlhB+dEpdbBG37CAcGUvOswnjmKmu4+QJ89oDai9sd0J8jGniUqH8nH3wXG4M20yv/IriI7AHyQ//aFtnsh8udXuH+P6NIdJf+MSDSMFfClGJPbTtslSVSeY/Qnxg536uWMI/XQAqw4TCxIlZmEhGsWe0IQrsdZoU8WIO6DGy6rQMMhuvm43rQggssber1dH0yJMBmQWZjD2G3v6Xr3idHvcP0LOJCZq/4lnWTO+68sR+2CXNuPmWIWCKbUmk/72rfX5z3A7gpLRoWW67HA+2Vr7vvULLpfo+PtQGLbrw8cu0Zjg1CPejdlaCGwc/IBotAnqiuLVYeIGyGzXxElPMmPmP6WhbANPBA6rbx/ncp1KZ7Welluyw0KM3F3TPd1Isnvl1Tv2ktGbQquf9ieAdlVbO3/ewOsXEk+K8JnlyvHeTuO031Mpbm12F8JBOhnzatmp3I0b7TB1/n/mDHxXUijbNYpgxPLDY4wWSHHxmKFrOdije9mj4wnMKGGU3JyzaAc+ktrxlDATo0izq5/PwT7eJwZ5KwxtuC+C8MBu2ZBSKWYvHiHyJev5es8+Tmi3qnhuxpvOPj5SCu3yQ3ojZP1TvTGR6lr2xxLGd+xkwnDg2oRLrJJLPiLggb56umFX5H6oMwol5xyr1nJOIXwQk0+4aJTlBJ89q3dMH+uNxgQaMV3RbfnLtv2B8xexnwV8KcmMsO8MNyYzv1hz8zGBzk8wDCr+5yCpAqq4VQWjminOI8KzwDF7hnilpOpwDVlneG2DTU7AVR398zejVhViQiBZp7YDxNI9IdiUwbMyBUyB9V3/Ws16NzDGl2kWGulv77dHARIhGxE95VL9KYvYkfBZ/c5cQzPSSz8zQBS3zPuiEaJWDMElWZGg5UCLxe2GgpnbbMbAXkRQmOBSLhLNBLxOI0/dJUXif3DRvU0FV8caJohyUM60ggM5lI+VUL/DpDLUKR5+oBKx0qzVvTX4R1tEmaDiOtmiWMgEn2bqJlRoNd5/TYas7TQw5wz1hYu5MuMMR7IXvPO/md8VvWTgorq0Sq3na7yHrws2Qdq7kZIFeu X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee389869-c715-47f9-2b1e-08dc1ec59caa X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 23:22:06.6931 (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: OCeErgk+DyWvPVJ0QcUDLCPO4WlLMjTzvCGwhat0X6uGEhR6XZEv4BIkLSWsF9huz1+QTzHVcdkjpK7Y8SPxnQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8041 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 Reviewed-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