Message ID | 3332ffe474185e2a3956f57d0cf8400776d0e768.1528300289.git.petrm@mellanox.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Ido Schimmel |
Headers | show
Return-Path: <linux-mlxsw-bounces+patchwork-linux-mlxsw=patchwork.kernel.org@lists.ozlabs.org> 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 D145D60375 for <patchwork-linux-mlxsw@patchwork.kernel.org>; Wed, 6 Jun 2018 16:02:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2BD1299D6 for <patchwork-linux-mlxsw@patchwork.kernel.org>; Wed, 6 Jun 2018 16:02:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1066F29960; Wed, 6 Jun 2018 16:02:33 +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=-2.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C10C1299F8 for <patchwork-linux-mlxsw@patchwork.kernel.org>; Wed, 6 Jun 2018 16:02:01 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 411D2J14KFzF31M for <patchwork-linux-mlxsw@patchwork.kernel.org>; Thu, 7 Jun 2018 02:02:00 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="jhUpRpvJ"; dkim-atps=neutral X-Original-To: linux-mlxsw@lists.ozlabs.org Delivered-To: linux-mlxsw@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mellanox.com (client-ip=104.47.1.58; helo=eur01-ve1-obe.outbound.protection.outlook.com; envelope-from=petrm@mellanox.com; receiver=<UNKNOWN>) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="jhUpRpvJ"; dkim-atps=neutral Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0058.outbound.protection.outlook.com [104.47.1.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 411D2D2N14zF31f for <linux-mlxsw@lists.ozlabs.org>; Thu, 7 Jun 2018 02:01:55 +1000 (AEST) 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=/xLQOY5zMEfGWnSR7UNL9EgKuPhD8d6J8KZcHQ6QmfA=; b=jhUpRpvJV78ksZC2x34PioOWnILlgp0ExKMJxJFk8jW3DU7DCMFcAQvf8zMGilDqeYVEGbGp1alzRrFos2gIWLP5dGA0vuQFZn9ECvKNyNjPD7kzBhuPzyylDcbdbFk5UAFmCH5PHe7K36BKcqufvmhWZMKRylWnYbH+n4Mn8As= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (78.45.160.211) by DB7PR05MB4188.eurprd05.prod.outlook.com (52.134.107.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.15; Wed, 6 Jun 2018 16:01:48 +0000 From: Petr Machata <petrm@mellanox.com> To: <linux-internal@mellanox.com> Subject: [PATCH net-next mlxsw 1/3] selftests: forwarding: lib: Split out setup_wait_dev() In-Reply-To: <cover.1528300289.git.petrm@mellanox.com> References: <cover.1528300289.git.petrm@mellanox.com> Message-Id: <3332ffe474185e2a3956f57d0cf8400776d0e768.1528300289.git.petrm@mellanox.com> Date: Wed, 06 Jun 2018 18:01:37 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [78.45.160.211] X-ClientProxiedBy: CWLP265CA0094.GBRP265.PROD.OUTLOOK.COM (20.176.53.162) To DB7PR05MB4188.eurprd05.prod.outlook.com (52.134.107.157) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4188; X-Microsoft-Exchange-Diagnostics: 1; DB7PR05MB4188; 3:2U1oky51iw3Pihv/N3xU24kra0vjvJgY8Su5mUw9E6EaMdyqL1jdVVKEhiXmN+RBlFHrBcLSqY9x1l/jrzeRMgPSx3G9JkpAFwt/PNGDgXss9GM7AU8f6XcdJmADz8umKAWcM6425uAyRrj5iyCilV5bR+fbOTHKLNztGP4tAaU6eZDCRQLZzO6V+Im9VtVGxp2gfeI3nE2wIu6HK2fZ/FIvZccwnkUGVkjXo7sKsBzFMD2jCfBXV2Qq+qMU2xjF; 25:zqwksT5nAwCJDcY45+Sxj5BhntT0636Khi3dKEsrcgngyrB8qo0iLXbmmec5VXfIN4SDfUd9/kyhLGVqyJHuIX/PI8A2CjW0ruVAcVpbiyoTeyuYLmg0AA9ThEEoiRK2WcBw/PHjnNUBaai/Hk0x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kOMEph78KgTfo5cY3B2foVUxOGmxJ0y1TLXQ86dDrThG2XrwH0Sf9u0CyR0mSrfLubiJR2B1DUCTre/s0290+jPF7s8+HEFvFDVKrlMnBGsJrDaC9Ftv0crZT2WyIS7gexlhHKa4Af2WwbNux0+zloRwKFQ3qCnQdNl6N3yIq3SKAuMS+/XGvhw2GpKeCeXMRbdSlHD+PqySrO3w4NTdK0SEDdXSj5elqmIuhtg== X-Microsoft-Antispam-PRVS: <DB7PR05MB418825E1B4B40EE1E9D98D4ADB650@DB7PR05MB4188.eurprd05.prod.outlook.com> 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)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:DB7PR05MB4188; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4188; X-Forefront-PRVS: 06952FC175 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(346002)(366004)(396003)(39860400002)(376002)(189003)(199004)(8676002)(2616005)(486006)(476003)(11346002)(956004)(446003)(186003)(37006003)(316002)(16586007)(16526019)(58126008)(106356001)(105586002)(386003)(48376002)(66066001)(50466002)(118296001)(47776003)(76176011)(52116002)(6496006)(51416003)(26005)(68736007)(478600001)(2351001)(2906002)(6862004)(97736004)(25786009)(305945005)(7736002)(8936002)(5660300001)(81166006)(81156014)(6116002)(3846002)(6486002)(6636002)(575784001)(86362001)(6666003)(36756003)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB4188; H:t540p; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB7PR05MB4188; 23:1hnUJJDTHFUOQxmfdRiWXBILRfhJjx6zpfZLxWwRT?= =?us-ascii?Q?RJElRQyWZz27uIg3GORIaJn5i/qUuggv+6VA0MxPC2Fh8iYtVbrTBc/zXpFS?= =?us-ascii?Q?71rSyARqPndP9CWWdPxyQWmQSAmJeDbbPo16Y+nwqnBjU8kKNWMXkn+XqXba?= =?us-ascii?Q?oBfo+8bNvrpeegdqRovCNeJqQYGCktzVUwUxZ/4zW6mL4VrQIvlQ2+xBb8gq?= =?us-ascii?Q?u+LhL0YFHSlFQ9TByZxWghZm6oCyBpr9/YGl391x/PiDR6/M6L+YuO020Yvs?= =?us-ascii?Q?9oYpfa+YRUzFNsqh8ewPQRJLtkWjX1jPNSn6FLTTFTftcZemO6n0DEujVrtt?= =?us-ascii?Q?DnaQpEQQTkmRyAibE8vZjW1utoTKNReVS2azu2b88TrvY8iGSarkF6f6ZNYP?= =?us-ascii?Q?q7X7k7OcmVvMJiY2l7SUo1D7Z53eiJO85JPeqWNVnhrHPeZJid1UAW/Z4w2t?= =?us-ascii?Q?SDIEUvKJ25M306iAz+NdBkB2dznFHmKIlRLJl98JH3aKVFkC1DjUUIHuOZAG?= =?us-ascii?Q?HycYevPpchKwU0fcH94wmQplr1KvGpHKm5VBdRUfTFfwdZwEf1Tl0NNFdpGk?= =?us-ascii?Q?Pkp1JvMUhBLmSZWD6cFE8+CiyF6Nc9mBYNMPkeEBBp/TYrjvFSpa0fstzmbf?= =?us-ascii?Q?9Wn3mcw0+l2M1fDBtWnpA4gvHQIMoLPJvmqS4z889ZjQP8ezoNT6Mhbmnwf7?= =?us-ascii?Q?xd4/0f94gBX9XTIIniOFLtYPu/EWPoorXjm8QAHjrbf45DSXIdz4H3az6ZHL?= =?us-ascii?Q?lh0EoDE4zpU0u7KX2f0DG0oj3wYLEZTFP28w17tHpDV5Y+zbf82X+Fm/Lb9H?= =?us-ascii?Q?09sppXPPy0cKJOOFqpWthUJ5AozhV2VfP6JKbs05xssYOmkjpdohYVrNi9zP?= =?us-ascii?Q?tgi8u7egRbM5gzgvMwRrWsmPmeSiECX0SL+iS4G5fdMoc6QcLX69p7GZnJnz?= =?us-ascii?Q?e/1gGjV92rooDbACmRFjOAF49nyVImwjK01rhRRz02g6IJXkwdh92B5spYb1?= =?us-ascii?Q?MB81Q/Qaq6d8rhQ/kDZQGHSkm57U5KDAV8r8uLWxs3LhTBPCupOS64Lur5Cc?= =?us-ascii?Q?hVDYgdtI+gQ+Piy76efRzDrPS5ZUgwKA2HT0x9npsQYLpZfNPPUXK6dR6aA5?= =?us-ascii?Q?0RsvgueHinorB/6/+RSeWBQOgRJIVv9xQyv/J2gHuvpfC8d28a81s10Zptdx?= =?us-ascii?Q?YXlxZJELN42dVm/XWj/HljLSaWlYjKI/fGF2zmUjTDe9mPtD30PwN09L/O1u?= =?us-ascii?Q?ABIyWDFNRMYkZpqZdA=3D?= X-Microsoft-Antispam-Message-Info: uxNuPivLskbcZNlszu9MNPZ1BfDLR4Ek+uKOkPxjfqkeUeG1Mjb5azFQWAZ0RgzZdbe+QwI6cZPzU50gxOxXhxNbbTG/HZX8Ox9AEbAMN8N73zm64k49GCCWBE71KLW+2fJC7v1Ea0oOJTXUyKvb/PYH6NletNPKpgeflQBLOqa3JkxZedRLR24gigNuVBvq X-Microsoft-Exchange-Diagnostics: 1; DB7PR05MB4188; 6:8Xv79OdNFD79FwkfYJq3SgDY58r+rfRdqrV/w7Lb7Bz3jErHzXhsYlf7Ule35npHuM7GjCJt6mOQa29ig9kOX4cqCkc0vX/cysBDQq2GbeO2WblaAUGjiQOhmH3fI6Syp5IsexdmdMRmRTBcjfzBn7wGdHWZim2EoC89aaia3QnfnVzonryR8xZLKTaQvLn9noK1+N/ltegyrOtUwrePhnzfubrl05WRHWqOBoFBJpB56zAuTHModtalqhg845aNL/M+0npkGzFDnesXr88BmNFo24R8zze7fpWvqOnUDu31yA+pm62xEYiWCQ5HKEddN/uToVbxVcL2XwTIjYFCDfmZdxn/7QhgNssOn6oZ+12VGElILzWDW1Ur6K0pCXnATJjMj3xQVuis1g1WMCBeuHyW2ACh5gf7Qlub989yQir5/LC0YcIzq95CvvOUaXLBtQw+uEU9XcfFyX+FAfqvVg==; 5:fQePUVZszn8uPJ1dlq80uz5p74BDMTkSxl8T4e0a3w9kDh2d8sDYnQBZLBdxR46O+PZ1wPGLTrpPp0DcN2ZF8G19cUnIenHyos8s+6uvbisONKQakfz/rg4RhHBc+ilOjSxSqmHngXjS3muEBB2t57GaDo6aeuZMklohCR572gs=; 24:lPxhTSrkcnYFHKcXUyTaFPteqRNBDWIpzXnuikFderrXtnmMxZdA+CUBe3EqR8v6eb6fi8X3wweKMSlxVrJVIgq/tsSb/mAuBp7TKMZUYMI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB7PR05MB4188; 7:bCK0vA8eBASfHKUCAn4MWLKaq4/paSnd6ybXkd+ekbT9ZIri7S4Wqz6H3k0QCmpXuRtVHLyEzxKI8MIDYQRgCfi0QZkHoYqC9WyzeBxbnzkKLg4mPErxx2rKdqbH3VW48bqv27ItVIf+LhW/TYzGDRfMi//RetB9eWTYY1rmEeiJ0gw7V9YOIrPO6i51FjWHJZdpnWxOY1Hevmu/VkFkl8N3SU2NZVhZ2uT80Yjmi9BqihD5jcydWlcSL9SlpurQ X-MS-Office365-Filtering-Correlation-Id: c7d79154-72d5-4744-c771-08d5cbc6cf7c X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2018 16:01:48.5317 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c7d79154-72d5-4744-c771-08d5cbc6cf7c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4188 X-BeenThere: linux-mlxsw@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: mlxsw driver development <linux-mlxsw.lists.ozlabs.org> List-Unsubscribe: <https://lists.ozlabs.org/options/linux-mlxsw>, <mailto:linux-mlxsw-request@lists.ozlabs.org?subject=unsubscribe> List-Archive: <http://lists.ozlabs.org/pipermail/linux-mlxsw/> List-Post: <mailto:linux-mlxsw@lists.ozlabs.org> List-Help: <mailto:linux-mlxsw-request@lists.ozlabs.org?subject=help> List-Subscribe: <https://lists.ozlabs.org/listinfo/linux-mlxsw>, <mailto:linux-mlxsw-request@lists.ozlabs.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: linux-mlxsw-bounces+patchwork-linux-mlxsw=patchwork.kernel.org@lists.ozlabs.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index 46b0f1d..06d6dcb 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -205,20 +205,27 @@ log_info() echo "INFO: $msg" } +setup_wait_dev() +{ + local dev=$1; shift + + while true; do + ip link show dev $dev up \ + | grep 'state UP' &> /dev/null + if [[ $? -ne 0 ]]; then + sleep 1 + else + break + fi + done +} + setup_wait() { local num_netifs=${1:-$NUM_NETIFS} for ((i = 1; i <= num_netifs; ++i)); do - while true; do - ip link show dev ${NETIFS[p$i]} up \ - | grep 'state UP' &> /dev/null - if [[ $? -ne 0 ]]; then - sleep 1 - else - break - fi - done + setup_wait_dev ${NETIFS[p$i]} done # Make sure links are ready.
Split out of setup_wait() a function setup_wait_dev() that waits for a single device. This gives tests the opportunity to wait for a selected device after they tinkered with its upness. Signed-off-by: Petr Machata <petrm@mellanox.com> --- tools/testing/selftests/net/forwarding/lib.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-)