From patchwork Sat Jun 30 00:45:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10497771 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EFB1B602CC for ; Sat, 30 Jun 2018 00:45:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2B1D28D8E for ; Sat, 30 Jun 2018 00:45:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6BE228E03; Sat, 30 Jun 2018 00:45:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BC8528D8E for ; Sat, 30 Jun 2018 00:45:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935556AbeF3Apu (ORCPT ); Fri, 29 Jun 2018 20:45:50 -0400 Received: from mail-db5eur01on0083.outbound.protection.outlook.com ([104.47.2.83]:2800 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934532AbeF3Apt (ORCPT ); Fri, 29 Jun 2018 20:45:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JnpXRYRQuJO1/guA3CZnzDgR8hfBWGrxkwRNOkQdx7U=; b=axBvSoZfRi8A2m6UPS+54411V5gIJeR1JY40DJT7LJCGwVV2ikvgqcbpg16Et0ezPha4mmlU6og5Ns9bjjnCyPJgpdZxbcQWbXcueI39qymDOekJFxKJQcQNmrj9Eh6DJHUSJhY3V4zrmO3AsBEmMIKTMjAWCt0dJ6I0Xc0gk1Y= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (89.176.83.59) by VI1PR05MB4191.eurprd05.prod.outlook.com (2603:10a6:803:4e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.25; Sat, 30 Jun 2018 00:45:46 +0000 From: Petr Machata To: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: jiri@mellanox.com, idosch@mellanox.com, shuah@kernel.org, davem@davemloft.net Subject: [PATCH net-next 01/13] selftests: forwarding: Allow lib.sh sourcing from other directories In-Reply-To: References: Message-Id: <4ca9cb980b67e44afc16d638c06329ab817ce6e3.1530319109.git.petrm@mellanox.com> Date: Sat, 30 Jun 2018 02:45:19 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [89.176.83.59] X-ClientProxiedBy: DB6PR07CA0023.eurprd07.prod.outlook.com (2603:10a6:6:2d::33) To VI1PR05MB4191.eurprd05.prod.outlook.com (2603:10a6:803:4e::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5dfc4b81-9023-4f00-05eb-08d5de22d1e8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(48565401081)(5600052)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4191; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 3:MCKoUku6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GXatdG7QYI2FWptDIjcWsuL5gHrMA3tXS0pZxqs4MfMiXLPSkRe0uikfQyBsLg+qJ2RTev5NZAk6D/2GyhxIgP9w+MmH4xTLKCHUgpEGcrNRgoUb7EP2Cpj41D0D5CpPnnE1TmnO9rdXAVlTbw3GW5ysBEcS68Ng5dTzb1ti+umc1Za9h/93vPirWzWxu+4RFX/ojSRDMwnlIh/uSt9QCU034RmPa2zs2gCzS/M6UPcriOx3WOao/UXDcUk87L79P1OGLYTVcacBCWlHfAO3eINobiR8uJyWDmEavG5mZxouxwQ5Is8hNovwDjTgbq5YFaPl54bn3llSXAaR0OV+XeHVgZ; 4:kEuDMlPcOVzch0rn2SDIDR7KmXQMfjTu1ZpI8YQfNiicHtaKF/IKuI9fZgnxB6wqjTZ0+HkRvidDOK28uRJ0AbvzqUUvi6g1nS34fVt2m7/xkTWi8kGkia5zKcnWVkS/8moVXdU6FNpRl6cVsYU+I9AV7CoHKDa5euyrZqdxYwFM3kh0HQbpSKScn9p7KPZNyxSWaY7JEj43L6t6D5bl3Eqe3cF9vhhw0UE7Mdnz2VAh301nLiSR5TeV0BFfHMNiNXric/ZAByTvXAzVM/l0KQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:VI1PR05MB4191; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4191; X-Forefront-PRVS: 0719EC6A9A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(136003)(396003)(39860400002)(366004)(346002)(376002)(199004)(189003)(50466002)(386003)(6666003)(316002)(25786009)(81166006)(8936002)(305945005)(58126008)(8676002)(81156014)(7736002)(16586007)(106356001)(26005)(16526019)(186003)(105586002)(97736004)(3846002)(52116002)(76176011)(47776003)(66066001)(53936002)(68736007)(2616005)(956004)(486006)(476003)(86362001)(478600001)(6496006)(2906002)(6116002)(6486002)(51416003)(118296001)(48376002)(36756003)(446003)(5660300001)(4326008)(11346002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4191; H:t540p; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR05MB4191; 23:JYGAXb9q2jASpmL0OYWAiUJu6c5QQzyuYLAeLMUJr?= =?us-ascii?Q?lOR0X98m+96u6ZoOW+4xbBdjGwG8J6eCam2LCj83HZp2T1AmqWbyVtSgU2lX?= =?us-ascii?Q?RqCO+gXBNdBASDoOMy7eUybMdo7yYoUIFXP7GG+sZBEPRNCQRTmObfS+6ucV?= =?us-ascii?Q?sbAnVSanuNiz1W6W/wzs/b5q3a/zaeMoc++C/QtoNP2jvdRbe9mpcD9m7e2u?= =?us-ascii?Q?rX9/rGgMoWXPJKCWL0Ky6Ui0Rj8gz+9xo0D4jWbtN+gIL8IoukOH48RkumWw?= =?us-ascii?Q?ok/YTcGFVgGKZqoke8UEVtbx6QlAjBbfgDS/Zo7zTvek26Hs23VKL5Aq2RWv?= =?us-ascii?Q?Q6s3H/WYeWV2Am7vdXGXDabYXdTGD/pDC+54pKof4lNIOrlrkpN+cqaMPjsb?= =?us-ascii?Q?cFGGFgeBomE9xEPX/M/t1zkdBJh9ER4RScLD/Twrxmo4zKwbCgnaoZHZJT96?= =?us-ascii?Q?orlO3mT871dN7U8FqZQkv+DibOdD/Ax2/XDFlxRE5LTCVo1BkuTR+gL3uMrr?= =?us-ascii?Q?WJXsvC6w8Ug+7+ETUjBu9T0NBYJVme8KXXgnZzSBwawpMK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y4Xgg4Ash6IhhrjuyMT9YqGKQWI= X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 6:FUGtzSr6yzP5hx01pQU71VvGMcfMbNmfl1e2z0BIsAweDvXAd74WDbKKWrAlik5wS9luIGpFp5PIH6W9PsHtESJzT6IulnsZTll9/mDJrT0gxdKPt36pf44jnjfzVyJsibD6f+kvUH9Yfxjx/qXQmQlpuEoXdOdLIqmJS9RoZAB7aeu1IiNq2s2ubJ4bV67DRTHzhBxVjh9Uf/CrNlIIXIKi5rjA2u73gbbvOtqFFRUx4KGI006mgYskap9GDPmMwl/wGR1t3EQUbWr+8jhlJQfcr3bjWkJFsT+F82bI8ncLd5smSQx3zBCVDvnbfbPYAtxpKnrQMqsp8Y8ORvnchroi3m6xZ7VZLcAtZYgWiWr9S8A0PpGbsfwr0QOAOygNm1LiHjlg//4Hhjce0kR7sjICGJij1J8TC5tFHCdMKGqDa2fCUM6i+3Aj0MGWpo1FXcpaurjkfhVQZ0f5hFOZMg==; 5:/TIbHpBe8Te+pVyPRopK8vVowe4t36hJjHtudxsrYtoTRdP3oflj416RyhZGLxUJ90MMqsCUjiX/LFfdTYY/78lb94xoSkU4HNOVC1ve4dtRmIMZDJD4DdsCf2julaWB+Bqn25CIrrwVR3ZQTDlgClRbQzdUEuR5WPl5MeDv5NU=; 24:42YcU0zGJBmYqRj5aUeAYhTiQ0HfpLiUGIWtExM0icLE4m/HE8WXwWeicUNEmIfo1OlGKh9t7bP7t4M3JvdTPre76Bnew1NdfqTCg6p76To= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 7:eBjl9NHG2xGqXO2bM4S47FJohQBWmUslh47K3gbbmxx3sjM8/qE4Hr/Q5CN8RITF3R8xm1x6xjj8ml+QDdgX1KGYKeq4/Frzlf2XQd35RcGSGRMdK7eVdRcwFkdjxE457dZwTYf+siz3KWxjh5r1+dgC3APmpDdatPXxBCX5x5d7HKli+86rV9ODx2JSE2mDrLqNOsdMMa5Uh0nPB65Ak8z9vxQxhk5B67m22JJfh3WiCSvSmEoC8qvk+YdrlI7Z X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2018 00:45:46.7191 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5dfc4b81-9023-4f00-05eb-08d5de22d1e8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4191 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Yuval Mintz The devlink related scripts are mlxsw-specific. As a result, they'll reside in a different directory - but would still need the common logic implemented in lib.sh. So as a preliminary step, allow lib.sh to be sourced from other directories as well. Signed-off-by: Yuval Mintz Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/lib.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index d1f14f83979e..59272824ef37 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -14,8 +14,13 @@ PAUSE_ON_CLEANUP=${PAUSE_ON_CLEANUP:=no} NETIF_TYPE=${NETIF_TYPE:=veth} NETIF_CREATE=${NETIF_CREATE:=yes} -if [[ -f forwarding.config ]]; then - source forwarding.config +relative_path="${BASH_SOURCE%/*}" +if [[ "$relative_path" == "${BASH_SOURCE}" ]]; then + relative_path="." +fi + +if [[ -f $relative_path/forwarding.config ]]; then + source "$relative_path/forwarding.config" fi ##############################################################################