From patchwork Tue Apr 24 11:31:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 10359285 X-Patchwork-Delegate: idosch@idosch.org 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 8F3AF602D6 for ; Tue, 24 Apr 2018 11:32:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7643728CD1 for ; Tue, 24 Apr 2018 11:32:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AB0D28D53; Tue, 24 Apr 2018 11:32:30 +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 48ADF28CD1 for ; Tue, 24 Apr 2018 11:32:29 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40Vh565T2HzF1Rl for ; Tue, 24 Apr 2018 21:32:26 +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="OOv6xcg/"; 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=40.107.4.62; helo=eur03-db5-obe.outbound.protection.outlook.com; envelope-from=idosch@mellanox.com; receiver=) 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="OOv6xcg/"; dkim-atps=neutral Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40062.outbound.protection.outlook.com [40.107.4.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40Vh515rsCzF1RV for ; Tue, 24 Apr 2018 21:32:19 +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; bh=2zhnB5AsD/hjQH6yK/Pp0qoycUQV73T88Rd03/SpkHI=; b=OOv6xcg/hnLV5fSnjNzCvfTBMROFQc0tFD6JyMTJuv1L/HjLmco+KB2m95G5TLKDOlAQBflZsq2JZnt5JBBpK18t5gUBOuCBbI8H8mIxovEdafe2jWDIZH3OJWQ7tavA/RXNEe94ILMDm5CI8Vt++DoPlbbFM7ne74MtFR3E8Is= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=idosch@mellanox.com; Received: from splinter.mtl.com (193.47.165.251) by VI1PR0501MB2334.eurprd05.prod.outlook.com (2603:10a6:800:2c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Tue, 24 Apr 2018 11:32:12 +0000 From: Ido Schimmel To: linux-internal@mellanox.com, linux-mlxsw@lists.ozlabs.org Subject: [PATCH net-next internal v2] selftests: forwarding: Allow running specific tests Date: Tue, 24 Apr 2018 14:31:52 +0300 Message-Id: <20180424113152.31046-1-idosch@mellanox.com> X-Mailer: git-send-email 2.14.3 MIME-Version: 1.0 X-Originating-IP: [193.47.165.251] X-ClientProxiedBy: PR2P264CA0036.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101:1::24) To VI1PR0501MB2334.eurprd05.prod.outlook.com (2603:10a6:800:2c::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:VI1PR0501MB2334; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2334; 3:vmtN/7WGAr+0e78F6c9v4jq0R+t22Yh6G/1vioH5I/ogD88tpQx7SO/AgVnHUVcrqueF9L0yC4pSfoCZEFiBS7bwqaVua3+Df1BdB4x7rm6nw6kaLufjanBaMsPn2m9z2TDyCMNHgcXk3L/fWVwdxgfzK5tOtcA7GCwvLJJbeYBPwznAEWXbzhA2HziSB6OkBWnJCanoLMMtt/qJaDj0TJxoLCbHu4UejpwFGLV/k2enAXgNPJX5PRA4RWS5Uy+s; 25:o9LflbL5VYHRi8LlSRowCvkgvZlvxJrYHlVMlAHhlT9smCmrm5cCWA5X2+8rssFTu3ugphrKyzREnpFbHmscAotuE821WpCx1nwZ1YDK2cSiojcFgBrPVAJg1tInHmlgGNjjAHMqsqIi8m8Istyum/OUToSFv5i/+93rsWNwCygY0LyaQhBv6Pylv2vA/gHdhj/8HdYzNF3zibuwt7w6rMudop9gvjvLrLT8RBfc449laUFFYVER/onyn3rd/3DMREkvUSWx/+Gaqz80IyVXxIW6no3CVwd1HRzv1008iGCzLWgaN2/SYwJILYcVhcRkszKBpWPONn7kyzWcDbBGMg==; 31:bF7rLmUOmiFDWKaWPMHDRY1dcy0bqlwYPxVIeDyTWYPNJcDNHH7XJe5rIsdNNvPfPr149HI2PotiYqNtRcI0nsUn4ZcU1gykMNiOKpGPDiwKnvbv9D7YFciWHDL8xt6sle2vxsMRJF+1Dg+meoTTIEvtb1Uw5x+pZ+M3XVcUTJYiN0cnjHJdzmw88XplS8jVOekkQA1NRmQfjtOggYP3zQXSIcADPBRZ9BNWfh4o0es= X-MS-TrafficTypeDiagnostic: VI1PR0501MB2334: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2334; 20:oFZ8rAIRJgxMAvqm5J6oh7AA1F/Y505Y1/+5/izMJ70nHRR2l5rkDRU0/m6TDa6SpNMRZJTs1nRGMSvFdh36ERJ/SgAxMVOLBgZgBUUzfwEQ8Dvim/PLg+6wg8IIK+PswKAjci8jVLa+SawzTxSAcLEGPTSP4lDOb3P/WbgNX12w7gyupuHCfiL+jrW8B3D3SNznHr72DSFNDCPORxbQASKv1hS2Pza7d8T/24WMLpLpjIOL/vzFFlb0Nz2+qW7/geq3NCJ4rgSmhbJOiFAmHKrlln2Pu6VwUqD3XMGGidCW1uvfCBNKe+N5FXgUOAwNiE/Vq37PDuTWTNEznCRw42vOUhI145lGx8Upn71/L6RwsKtSVTTsTpzy9jkUX1ZdH6r2Qi9dLVC3X/fLpguOeMESVYxlU9/EbLVZQL39+LCI9zYKrOZESRHplLaDmzRAPo0G3DfosXx8zAKqUxPejSRfMFZAljHbULyK1yVHFpFgfLj4mVbfXOBp4WjseQoa; 4:cdZi84a+2xUJ5jSJu/xvG12wHs6ASU0jqOiMKPmkdNRzULP7j5UcrrIsG4z8mXPbcXkiEIDhAm/IdqazzE9rLvfnYyknljCwLI3jZgqnxtOxfzr8mQPSgLh9/QqY6Gip9YqPDHz14sM5smD938ynAbQYsSwm1gxcqWVbJjjP+lyp0b6vP94bAwKoQpvOz6Woic0vYPA+Fcc0Pa/VTLrAx7cVMgPVmDBo/WPlcL/0uEbq/t3MvEBWDtNDq0VcU37XSq5YXjamXm9SfzLaWheYxA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231232)(944501410)(52105095)(93006095)(93001095)(10201501046)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:VI1PR0501MB2334; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2334; X-Forefront-PRVS: 0652EA5565 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39380400002)(346002)(396003)(39860400002)(366004)(199004)(189003)(305945005)(50466002)(386003)(81156014)(81166006)(3846002)(6116002)(7736002)(16586007)(316002)(5660300001)(53416004)(8936002)(6506007)(107886003)(106356001)(105586002)(6512007)(478600001)(50226002)(26005)(53936002)(6666003)(68736007)(52116002)(51416003)(97736004)(25786009)(4326008)(2906002)(48376002)(8676002)(1076002)(47776003)(16526019)(66066001)(486006)(6486002)(476003)(956004)(2616005)(86362001)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2334; H:splinter.mtl.com; 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; VI1PR0501MB2334; 23:GlkT384hxTQu15MRRySo7o1Un8pdxkRNY2Fv16S?= =?us-ascii?Q?iWNiyqgmPrDmbor9NWGlch3fQUG1rHWn7d2SCBuLE/RVCiYgDtwDj9ItXeN0?= =?us-ascii?Q?RemAsNvgHzdCMY6LD2wilqd9QKKlRSbcl4EAKOSCaHug81Rj60dq2JVjAKcU?= =?us-ascii?Q?q/OS3mlfqKUuI64vW+jKTQXDhAOungXQ6Jagw0QNflNEks2LtkABfNKZQ6kE?= =?us-ascii?Q?9i7JOe1dV3e8TvW2SzKCOdPU1Aqs09KDJ/XM8qBR43kSp0A92g4b2i/4v1nf?= =?us-ascii?Q?qqzxjJIXYeoyG2F/mav2BS07QM/It45yFYIDYg5WqY/CvRpBgRlvtQY8KoCX?= =?us-ascii?Q?J5k1vUiF12Gg/3b3CP1yWUK924MoIfE6CvBudvTQyhn7lKzOpYZUqa8VOIzf?= =?us-ascii?Q?kn+dR1baUPBlOx6MzKcCqWYf39SLJGPGrp173wN2PW9+z5kqBPdEPL3qC6N1?= =?us-ascii?Q?vQao/C3+/4njK3jAN0qJ7C/Bt6DkyOYyuhsZtkjLjVEXG2/znJoJD+F19/jR?= =?us-ascii?Q?uSDUgD19clCn+A8voREmdGond7J+5jEWdXkBAJ2o2wHcPO95wpIF45a6mZTf?= =?us-ascii?Q?LELKnVd9odLFMC+W1f6lWNb0BoHEHK48cSZc8lWIRwlXxkHk2U9GnZ+bjbcW?= =?us-ascii?Q?cyaKKgHo7+j/EpdvOcXJ67M0geppFfA1Z/0LBOcE8xkFU6kSwoVTAfgnAl6G?= =?us-ascii?Q?ejCdruBpCVLb4U7nktwkC4dxr10UvMiwTBQpP/0OAz9DZr7vH8zMoG/IOxen?= =?us-ascii?Q?vxSSre9hGqgpPNYZKHtt6KJunUgh4BxiKwvSNiaD3icNOu37WPvyhzH2Gowb?= =?us-ascii?Q?LhBeCXXJOJhdfnkCVDrQ4Fbpyl6JghWPiLUqYULtwAoYiOiWH8xS8MwI/DqJ?= =?us-ascii?Q?yoaHM5V2tvTYr/uX7BSg4orvZrJEehNWtmmpptFC6027DFqZObYhwcew5HPN?= =?us-ascii?Q?bOBro+ikXuEw3/rxV7++HZHz6u6qldRa1suNV0ksh9aemnZSJimd1qlSDmO6?= =?us-ascii?Q?0YSpG9ntR1kDxxG8M8/8xnyFR1bAXT33G1je38oSvTvu3BPnN+mDNWF6n1Hn?= =?us-ascii?Q?gN156XlIjekr9g+CpFdMno+E/Rhv3pc2x1LI45i4LDCk0XnA4cumrhPedenv?= =?us-ascii?Q?45baBsvDp4ecOPxHmxTuj4ckwkP5IsuTs?= X-Microsoft-Antispam-Message-Info: 4nVXYGqv2+kCrEe3GFRZ6hEafbJsSJ5wcdbT9PLpfINOgOs6rkp6yjba1zoEacswlIkFfrn12VoNJ5KxguCij+wKS3tAVGjjVkIgUl+J6pyAyS8u37j2bECdbjFqw4ZAhYcAVGFMmDI0YBNqEqxqvHDxmwzcQ5irp4LCHFv+TLWCHR0m3nnzAXpQMtPl9nIY X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2334; 6:sWe8J0EvmNkx+C4x0F+RNDWC+XkDTo5zYAn6dsq3aEH3/Y41Knj+4YvJzQJB6y0AjVt0wC5U9M9K2MJGukwQXAYRQJj1Nfkp078D/MFlGWClETE5MQzwW9ElJcE0Ghi20ExB+3A5ry4ithO5rKJA5aRF20CHWQYy6Z52X8hYNnvj5+8bIDPlgB9P6s/hYlz3THk4Cq3T3fliJ3NYySnFZe+spelcwonkcddCH+dayKI3YdptMFjuQott7LX7LdjvXL63Jf55xczFFAs9A7epkydyVmTQVLDhjd4j5w2wJj9Ng5l/jFlAhvPL6lyu8e9/e7jxSHkSpbwY9w8ddXRAYsG5EC5oA8XC7IhkPbHu1nCATjEBt7FWpMuK1vjDxp5LU0X4ki9wxhhfWKEsXM1c4tGCUTwDFmb8Wp8dCrVWWJCM9KZ51jVJVZaz5i3CSWJL8B3alWQARrZVsQ3gPU5Xtw==; 5:mijtpsG3q89ASl9mzg5FGTIy4OdvWfLN+r91D+PziC5Ysz2eJeuJH+WFHT2tdrxZ9N9z4ELTTaLVcjDYdD0oG0ycvS3Rtf+jTrj4w9lE2nOBd7lLa50JuJCG2I/qBCNIJU00MDlUukJyO1uLk+ae+rTfELhCHYeosO13EzeYSdI=; 24:tkT5Vp9K/dfxYm/TGmB9nbs6kRPJ/V92XvHz6XiZGX/GvtBqYiT5YId5qa6nihg9BKumPTUG3RhONaQsxpSuyU51F3XQJeYOSxJHn0c3dog= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2334; 7:gwo2md315ykN+qYC9Z5ZZzjMYc6Jg4AcNANuJzwVK1thvanRzZpBeHSu971oPkbtpv5papw4c07kaSsARmrpJ6/TdETTbvaEZVrLtOsy9ZqceHi9gYtSjI5VQbyqLjfDUNSJ5AHSjyFssqB8PVcyIKI9Kk2EvJuyeUC326Q4twOfqlDl82lE5z13JSBbN6pSTUqY//xthGt9dgjxfInidNHy+ZG1R8DFkNV3PLIukqfNPPFYs9NY+VL6Xo/TNvHS X-MS-Office365-Filtering-Correlation-Id: 4fae7b34-4045-4b64-b37d-08d5a9d70623 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2018 11:32:12.1983 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4fae7b34-4045-4b64-b37d-08d5a9d70623 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2334 X-BeenThere: linux-mlxsw@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: mlxsw driver development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-mlxsw-bounces+patchwork-linux-mlxsw=patchwork.kernel.org@lists.ozlabs.org Sender: "Linux-mlxsw" X-Virus-Scanned: ClamAV using ClamSMTP Similar to commit a511858c7536 ("selftests: fib_tests: Allow user to run a specific test"), allow user to run only a subset of the tests using the TESTS environment variable. This is useful when not all the tests can pass on a given system. Example: # export TESTS="ping_ipv4 ping_ipv6" # ./bridge_vlan_aware.sh TEST: ping [PASS] TEST: ping6 [PASS] Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata --- v2: * Let user decide if gact_trap_test() needs to be run and add a check there to make sure test is only run with "skip_sw". --- .../selftests/net/forwarding/bridge_vlan_aware.sh | 26 ++++++++++++++++++---- .../net/forwarding/bridge_vlan_unaware.sh | 26 ++++++++++++++++++---- tools/testing/selftests/net/forwarding/lib.sh | 9 ++++++++ tools/testing/selftests/net/forwarding/router.sh | 14 ++++++++++-- .../selftests/net/forwarding/router_multipath.sh | 15 ++++++++++--- .../testing/selftests/net/forwarding/tc_actions.sh | 25 +++++++++++++++------ .../testing/selftests/net/forwarding/tc_chains.sh | 7 +++--- .../testing/selftests/net/forwarding/tc_flower.sh | 14 ++++-------- .../selftests/net/forwarding/tc_shblocks.sh | 5 +++-- 9 files changed, 105 insertions(+), 36 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_vlan_aware.sh b/tools/testing/selftests/net/forwarding/bridge_vlan_aware.sh index 75d922438bc9..d8313d0438b7 100755 --- a/tools/testing/selftests/net/forwarding/bridge_vlan_aware.sh +++ b/tools/testing/selftests/net/forwarding/bridge_vlan_aware.sh @@ -1,6 +1,7 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 +ALL_TESTS="ping_ipv4 ping_ipv6 learning flooding" NUM_NETIFS=4 CHECK_TC="yes" source lib.sh @@ -75,14 +76,31 @@ cleanup() vrf_cleanup } +ping_ipv4() +{ + ping_test $h1 192.0.2.2 +} + +ping_ipv6() +{ + ping6_test $h1 2001:db8:1::2 +} + +learning() +{ + learning_test "br0" $swp1 $h1 $h2 +} + +flooding() +{ + flood_test $swp2 $h1 $h2 +} + trap cleanup EXIT setup_prepare setup_wait -ping_test $h1 192.0.2.2 -ping6_test $h1 2001:db8:1::2 -learning_test "br0" $swp1 $h1 $h2 -flood_test $swp2 $h1 $h2 +tests_run exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/bridge_vlan_unaware.sh b/tools/testing/selftests/net/forwarding/bridge_vlan_unaware.sh index 1cddf06f691d..c15c6c85c984 100755 --- a/tools/testing/selftests/net/forwarding/bridge_vlan_unaware.sh +++ b/tools/testing/selftests/net/forwarding/bridge_vlan_unaware.sh @@ -1,6 +1,7 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 +ALL_TESTS="ping_ipv4 ping_ipv6 learning flooding" NUM_NETIFS=4 source lib.sh @@ -73,14 +74,31 @@ cleanup() vrf_cleanup } +ping_ipv4() +{ + ping_test $h1 192.0.2.2 +} + +ping_ipv6() +{ + ping6_test $h1 2001:db8:1::2 +} + +learning() +{ + learning_test "br0" $swp1 $h1 $h2 +} + +flooding() +{ + flood_test $swp2 $h1 $h2 +} + trap cleanup EXIT setup_prepare setup_wait -ping_test $h1 192.0.2.2 -ping6_test $h1 2001:db8:1::2 -learning_test "br0" $swp1 $h1 $h2 -flood_test $swp2 $h1 $h2 +tests_run exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index 1ac6c62271f3..8cbbc796a27c 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -381,6 +381,15 @@ tc_offload_check() return 0 } +tests_run() +{ + local current_test + + for current_test in ${TESTS:-$ALL_TESTS}; do + $current_test + done +} + ############################################################################## # Tests diff --git a/tools/testing/selftests/net/forwarding/router.sh b/tools/testing/selftests/net/forwarding/router.sh index cc6a14abfa87..a75cb51cc5bd 100755 --- a/tools/testing/selftests/net/forwarding/router.sh +++ b/tools/testing/selftests/net/forwarding/router.sh @@ -1,6 +1,7 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 +ALL_TESTS="ping_ipv4 ping_ipv6" NUM_NETIFS=4 source lib.sh @@ -114,12 +115,21 @@ cleanup() vrf_cleanup } +ping_ipv4() +{ + ping_test $h1 198.51.100.2 +} + +ping_ipv6() +{ + ping6_test $h1 2001:db8:2::2 +} + trap cleanup EXIT setup_prepare setup_wait -ping_test $h1 198.51.100.2 -ping6_test $h1 2001:db8:2::2 +tests_run exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/router_multipath.sh b/tools/testing/selftests/net/forwarding/router_multipath.sh index 2bd3d41354d0..6c4376289695 100755 --- a/tools/testing/selftests/net/forwarding/router_multipath.sh +++ b/tools/testing/selftests/net/forwarding/router_multipath.sh @@ -1,6 +1,7 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 +ALL_TESTS="ping_ipv4 ping_ipv6 multipath_test" NUM_NETIFS=8 source lib.sh @@ -364,13 +365,21 @@ cleanup() vrf_cleanup } +ping_ipv4() +{ + ping_test $h1 198.51.100.2 +} + +ping_ipv6() +{ + ping6_test $h1 2001:db8:2::2 +} + trap cleanup EXIT setup_prepare setup_wait -ping_test $h1 198.51.100.2 -ping6_test $h1 2001:db8:2::2 -multipath_test +tests_run exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/tc_actions.sh b/tools/testing/selftests/net/forwarding/tc_actions.sh index 3a6385ebd5d0..813d02d1939d 100755 --- a/tools/testing/selftests/net/forwarding/tc_actions.sh +++ b/tools/testing/selftests/net/forwarding/tc_actions.sh @@ -1,6 +1,8 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 +ALL_TESTS="gact_drop_and_ok_test mirred_egress_redirect_test \ + mirred_egress_mirror_test gact_trap_test" NUM_NETIFS=4 source tc_common.sh source lib.sh @@ -111,6 +113,10 @@ gact_trap_test() { RET=0 + if [[ "$tcflags" != "skip_sw" ]]; then + return 0; + fi + tc filter add dev $swp1 ingress protocol ip pref 1 handle 101 flower \ skip_hw dst_ip 192.0.2.2 action drop tc filter add dev $swp1 ingress protocol ip pref 3 handle 103 flower \ @@ -179,24 +185,29 @@ cleanup() ip link set $swp1 address $swp1origmac } +mirred_egress_redirect_test() +{ + mirred_egress_test "redirect" +} + +mirred_egress_mirror_test() +{ + mirred_egress_test "mirror" +} + trap cleanup EXIT setup_prepare setup_wait -gact_drop_and_ok_test -mirred_egress_test "redirect" -mirred_egress_test "mirror" +tests_run tc_offload_check if [[ $? -ne 0 ]]; then log_info "Could not test offloaded functionality" else tcflags="skip_sw" - gact_drop_and_ok_test - mirred_egress_test "redirect" - mirred_egress_test "mirror" - gact_trap_test + tests_run fi exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/tc_chains.sh b/tools/testing/selftests/net/forwarding/tc_chains.sh index 2fd15226974b..d2c783e94df3 100755 --- a/tools/testing/selftests/net/forwarding/tc_chains.sh +++ b/tools/testing/selftests/net/forwarding/tc_chains.sh @@ -1,6 +1,7 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 +ALL_TESTS="unreachable_chain_test gact_goto_chain_test" NUM_NETIFS=2 source tc_common.sh source lib.sh @@ -107,16 +108,14 @@ trap cleanup EXIT setup_prepare setup_wait -unreachable_chain_test -gact_goto_chain_test +tests_run tc_offload_check if [[ $? -ne 0 ]]; then log_info "Could not test offloaded functionality" else tcflags="skip_sw" - unreachable_chain_test - gact_goto_chain_test + tests_run fi exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/tc_flower.sh b/tools/testing/selftests/net/forwarding/tc_flower.sh index 0c54059f1875..20d1077e5a3d 100755 --- a/tools/testing/selftests/net/forwarding/tc_flower.sh +++ b/tools/testing/selftests/net/forwarding/tc_flower.sh @@ -1,6 +1,8 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 +ALL_TESTS="match_dst_mac_test match_src_mac_test match_dst_ip_test \ + match_src_ip_test match_ip_flags_test" NUM_NETIFS=2 source tc_common.sh source lib.sh @@ -245,22 +247,14 @@ trap cleanup EXIT setup_prepare setup_wait -match_dst_mac_test -match_src_mac_test -match_dst_ip_test -match_src_ip_test -match_ip_flags_test +tests_run tc_offload_check if [[ $? -ne 0 ]]; then log_info "Could not test offloaded functionality" else tcflags="skip_sw" - match_dst_mac_test - match_src_mac_test - match_dst_ip_test - match_src_ip_test - match_ip_flags_test + tests_run fi exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/tc_shblocks.sh b/tools/testing/selftests/net/forwarding/tc_shblocks.sh index 077b98048ef4..b5b917203815 100755 --- a/tools/testing/selftests/net/forwarding/tc_shblocks.sh +++ b/tools/testing/selftests/net/forwarding/tc_shblocks.sh @@ -1,6 +1,7 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 +ALL_TESTS="shared_block_test" NUM_NETIFS=4 source tc_common.sh source lib.sh @@ -109,14 +110,14 @@ trap cleanup EXIT setup_prepare setup_wait -shared_block_test +tests_run tc_offload_check if [[ $? -ne 0 ]]; then log_info "Could not test offloaded functionality" else tcflags="skip_sw" - shared_block_test + tests_run fi exit $EXIT_STATUS