From patchwork Fri Jul 27 22:48:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10547787 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 527341751 for ; Fri, 27 Jul 2018 22:49:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C9752C680 for ; Fri, 27 Jul 2018 22:49:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FABD2C682; Fri, 27 Jul 2018 22:49:13 +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 AD4082C680 for ; Fri, 27 Jul 2018 22:49:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388660AbeG1ANM (ORCPT ); Fri, 27 Jul 2018 20:13:12 -0400 Received: from mail-eopbgr70073.outbound.protection.outlook.com ([40.107.7.73]:42176 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388467AbeG1ANM (ORCPT ); Fri, 27 Jul 2018 20:13:12 -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=A4TPwWMwON/H2CfL961GhTuDOLLXlQrHOwJN4Zkhvac=; b=QYwYOZBjUa4aNPwEiK/zsrP77GpH0BhBuklRpdd+2WxPrkj+X0OHyBdblN5gZO3aHg1H63LiR+M6pWX7O902Pcw9Wz7nDtpHbcFer91tUTLj5xukWxnJx7j526VVZmcKsq9rzmqPDO0n3lu1l8aqwajPeTbxggDGTijq5NIyUN4= 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.973.21; Fri, 27 Jul 2018 22:49:04 +0000 From: Petr Machata To: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: jiri@mellanox.com, idosch@mellanox.com, shuah@kernel.org Subject: [PATCH net-next] selftests: mlxsw: qos_dscp_bridge: Fix Message-Id: <0265c1caa420b594b88f2b43ca0cd8df100aa627.1532731316.git.petrm@mellanox.com> Date: Sat, 28 Jul 2018 00:48:13 +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: HE1PR05CA0155.eurprd05.prod.outlook.com (2603:10a6:7:28::42) To VI1PR05MB4191.eurprd05.prod.outlook.com (2603:10a6:803:4e::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aa4bceca-2a4b-46d1-09bf-08d5f4132805 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR05MB4191; X-Microsoft-Exchange-Diagnostics: 1;VI1PR05MB4191;3:epTj/UUHj/6yHdhh/z9vi8VbV5Ug7AW+zRcdV0uIa6U8Hsrwt07/x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vxhgqjbkz17x3sv5UsTvzMR7R/gBviwO44rOKZ9mxe6M6XH47DXo+w4zsE/6A1CmCCthBFNFFX8cNwvtzXS04uctfPNlXJfOXAiFGxLKHNUkeOLHkSlfdKat4RwFzRZJDG2F/bqfkHSO1E+JHbKASkjcmWaIvRJ8Lrp6cDDU/oDuKz0O/S+zl9f8HzmHp5S9E5VAtE+oliA2U+NwijylQFkPN4Jb+0+i4l9xWSWxNooyVHUyD1jBs2JzX62gXWnCx1A4/LgQm0LKyWAkTOgShj202jVDFoAD+Mic2X;4:jbwJN6X98GEyqCtnOJSYQtYLAZlNu8sQodqn9ca7p1K7bfFdGNMiAstWHMxdak6Y8j2oJrGCjTdS4pJRmX6RBXMvCTbAZbEM4J5YZsJe0DMOIv4wToXYssQQi9t5yj+FU4eRWnBBiO3r6RYg2s8O4TcuK6jmekUz+3PqjPy7XpO0mUGPqKPizwTH3CNfkBjgtC1C2Y754lc1S5BUIHvH/AtzL1i5To079hMVOmF93oQuxQgMumQIJpCZgb4iYGbUSz9HfdPplmiKdKyRBAva1A== 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)(8121501046)(5005006)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:VI1PR05MB4191;BCL:0;PCL:0;RULEID:;SRVR:VI1PR05MB4191; X-Forefront-PRVS: 07467C4D33 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(136003)(366004)(396003)(39860400002)(376002)(346002)(199004)(189003)(316002)(106356001)(105586002)(3846002)(7736002)(25786009)(305945005)(4326008)(6486002)(478600001)(6116002)(36756003)(486006)(2616005)(476003)(956004)(68736007)(8936002)(118296001)(66066001)(6666003)(53936002)(81166006)(47776003)(8676002)(5660300001)(2906002)(52116002)(81156014)(51416003)(48376002)(50466002)(97736004)(6496006)(16526019)(186003)(16586007)(58126008)(386003)(26005)(575784001)(86362001);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: 1;VI1PR05MB4191;23:+hLrGhsgiYUl++u6Gw0zrAdf80V0JFUQkapWobxi5HcpyHJWmwgsqeBPh6D7ixLRDo4Euq9EeuO/NnkH91IfnOOuKKo2Zq5TI+wJT0e2qmSbJCmvsEHzSNFfV5B4lmD24o1Dj4tQELq1kZ7Dx0IKBkT82JUSJnSNzjGjq2zXRySOYiOHBgle4IKGYUXqDZgyHMnODYfaicxde3J8UHF8+cN0JZdzV4xt/kOWeuUHUZP47eThtox7bTlw2GUmaZeLNsdsrPd+8DSM63/3fCubOCZGY5+TUz6QuKZRkOp2+AARNDu4o8MnoC+hVaF5Khung2BDk483qgPB+9NU6KgebZYwvZDuDmBkooB9n/lgP7/qur+M+eqDyLPJi24gRYkabcxOpQPHWFxoCZdUb+i5Bf3cXPL+2Z8se98+HOcP71i/9v2LYlYmd1ADE74aRc4MLrKTM0iyenKizHEgCO91zRubimc3Kt1gWCznwVTKAaNO/mK0gRShtkLn7aL/02T6kKQdNJzXkxV4WQpyurySV80Fjm3fYvLHaMIj3OuhFxUZhR89m/8amtTzZw0Dw6ka+yPYJkhV2zmZy1KfLwZ4fideD3sQIE349jDtEP3A1cf5k2IIRGQTs0UG1zvX+zZCM5TR/Vfw7/ZzwzIzwwWzA3vKU196GStXRBfKL1jT3jGuM2jyRUrBV/kCD6oSFJC2j7FvYWkzM6nC5CAhRg02Ev6bk/HkIFn8fedHwg7rJA6Khl26Y1/OXIfuDZjF72RWZi0hii9BKTlkiJR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3av2E5mNr7d/yVKRl7NmD48ICaEVoLle5gF2Sk5ME1RiXg807xz8aqOujBwbc/XJx59He6aUgvnbcdDo/wsdVRFpmA+MkF9HtFXrdDwZ+Z3LHnNKoXu6gvVac3RL6S8ve2NUtv1+sG35ULgEjDogmPyp/wf2sZxSdkSA==;5:cf84fj7H0qshaGoiTWfVfMB/6bz6yTwxYIVAwr5qaO+j2q5gmDwKABkHJW7mhglGnuRAniDiCPMU8ehhyEmR2iPoXMJC8za3FjxLo0bzeJw48GJt8aCgRwxd6e1TzGVOqNP4khcXcmoAVKtOsAqK5ViSaLhlMrWRmqSmsHUTKqk=;7:6yRam2C36Uioy8vBk9RLUh5gLpvjMik0QqVFcPCra+BYIOtdhvHAxDdQ+Ni878kEKe84nzWQAhhyfxRO2Z2JotMtTXwF2f0FS273WgWvBKGkHFSaJZr7EHsK+EU/0GwdK79DU05wRxYpY7yyY5/X6e+v2iv9klKjVSjPAZlybuA9NfxAkeBBEYc86NUHrnDefgJRyD6krBHAOl7vv4y/+JVfGVpfxffWjD3bYl/M8PcufNjBqffJwvA8lfYzbE6h SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2018 22:49:04.8111 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aa4bceca-2a4b-46d1-09bf-08d5f4132805 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 There are two problems in this test case: - When indexing in bash associative array, the subscript is interpreted as string, not as a variable name to be expanded. - The keys stored to t0s and t1s are not DSCP values, but priority + base (i.e. the logical DSCP value, not the full bitfield value). In combination these two bugs conspire to make the test just work, except it doesn't really test anything and always passes. Fix the above two problems in obvious manner. Signed-off-by: Petr Machata --- tools/testing/selftests/drivers/net/mlxsw/qos_dscp_bridge.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/qos_dscp_bridge.sh b/tools/testing/selftests/drivers/net/mlxsw/qos_dscp_bridge.sh index 418319f19108..cc527660a022 100755 --- a/tools/testing/selftests/drivers/net/mlxsw/qos_dscp_bridge.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/qos_dscp_bridge.sh @@ -217,13 +217,13 @@ dscp_ping_test() for key in ${!t0s[@]}; do local expect - if ((key == dscp_10 || key == dscp_20)); then + if ((key == prio+10 || key == prio+20)); then expect=10 else expect=0 fi - local delta=$((t1s[key] - t0s[key])) + local delta=$((t1s[$key] - t0s[$key])) ((expect == delta)) check_err $? "DSCP $key: Expected to capture $expect packets, got $delta." done