From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 98F9142DC7; Mon, 3 Jul 2023 21:26:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 16FC842C54; Mon, 3 Jul 2023 21:26:21 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by mails.dpdk.org (Postfix) with ESMTP id 7E38A40ED5 for ; Mon, 3 Jul 2023 21:26:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IZTtuR1L0ez1tpCzXEtx6bbH1Lf9fh9DOtB1JXi27wH/oo7Ns8/DwTf8uug6Q+rcpKLjTRo8o8Ts+/4RCN3HieHPLp+UoLceoj61mws5I7rJWVHMgCFfqT65QLZPOewG1LGHhhSBqzemswLGHoEJ7ia3Vg6cXfjnF5qlUGeONMs4db2EfeLeogEBbc7S11FT8/TD7qBdg7zxm6Xx8XsWcwmH1MNjjFlOK+KP5eggi0lssbva3ISuO29bM0I24B5qDuN+rH/44zbK0/cf4XvjTbB5BukaJ59nARnHzSsz1z+eRvJp11Wl7IxgIBueUP0LAC53O7cpyh94NMGOOVblSg== 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=wqPXvQh42E9X3Cf6hn+eD98hd0NVlZCHH61Yo2t6IB0=; b=n+cTdDVoh+JikcP7RheaFKuSe9+0wYuK0iCGfjwyrz9jmkX8Yuw4DDO2hZ9I3LQ7pq1kzi7p8qXre/G2lDq6E7Y2NFyPA1Ax62H3jDGHgCrqf+sc4NnYgRSbdjJ5I7cfPu6cd6JvL9H2u+lzUrW0HpwsNvF2aT3IHsSfiUqwwClqf6Z2J3ac2twUImhnMZ5/72xg7/I5SnfRHWFtzBB5Qa8zHKlaOdZbAyiMZbqg5k0MY0bfICW5M4Fvz9MDNiDpqYsXVUfDzCBq9BJlbray7mJ5mdWoCyv0iH5WOCjQisMgYTQEm1eNfR3yVU+65qsmCOYQrA63dHNwfPzoNKSDkQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wqPXvQh42E9X3Cf6hn+eD98hd0NVlZCHH61Yo2t6IB0=; b=BH2vheoolJvuXxJSFJNPo1ptt1jRcZC1ZhxtEcSuiFUxmrqNk10XBH6ZLG+i21+qsa5ozFEQ8F04sS7qqBeqOaEyEjw50AKx1KsEJoLL0cyzCV123GevtULaBDOJPc3VS5fbl2e/s0BIoIOC2yMHIxuc5LaxxgMfCpc61QzuIjU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from BY3PR13MB4804.namprd13.prod.outlook.com (2603:10b6:a03:355::13) by MW5PR13MB5464.namprd13.prod.outlook.com (2603:10b6:303:191::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul 2023 19:26:18 +0000 Received: from BY3PR13MB4804.namprd13.prod.outlook.com ([fe80::5ae7:eda4:3881:4f4f]) by BY3PR13MB4804.namprd13.prod.outlook.com ([fe80::5ae7:eda4:3881:4f4f%4]) with mapi id 15.20.6544.024; Mon, 3 Jul 2023 19:26:18 +0000 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= To: dts@dpdk.org Cc: oss-drivers@corigine.com, Qin Ke , =?UTF-8?q?Niklas=20S=C3=B6derlund?= Subject: [PATCH 2/2] tests/speed_capabilities: optimize code sequence of test case Date: Mon, 3 Jul 2023 21:25:42 +0200 Message-ID: <20230703192542.36809-3-niklas.soderlund@corigine.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230703192542.36809-1-niklas.soderlund@corigine.com> References: <20230703192542.36809-1-niklas.soderlund@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: BE1P281CA0095.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:79::10) To BY3PR13MB4804.namprd13.prod.outlook.com (2603:10b6:a03:355::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY3PR13MB4804:EE_|MW5PR13MB5464:EE_ X-MS-Office365-Filtering-Correlation-Id: fcd41035-e82c-4351-cf92-08db7bfb5fe8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x6xLQpUBRSTsl0iM1kEvkKxMHBUZE1Y/f1dZSnm5uqxKSAlTmvgOhS3h7fK8JXer0EuJa0+Tu6clf/278P1ErxpWEztBD1+Z65k4uLAiWbL4cQanLkdCxKv5WNabTFLCPnQJfPglzqbqfQTkzVSVrHbrnPtnz/H+QJIp3EMy7510vqEACeBD/uBsMoICj0n5LpKy9wutMwap83JbSu8FENdgNeRvxxqLiFsGexqIQ+AB3QuRhQgkovuGjb+YK6ikZrH8mLsH/cx7j4WZyLlEQK0YmO59cSgIOPB7OMRyHCy7uEQoYhwEaraCzF2GJmeAmRwBETKXPzoJtdShYE/VQlWV+V/A50AtvVCeYhtWPldxOkVxIk3+h4c8sj4VdCjgKitQeKQBT2potwqy8onp9WCUbgJUfafgQatnPF6SOdanQbnr+oRZGed/POyW5qmsTQ/POWwT/AU0Vllf5wm3glf3GzRqMLQFZ3JEJQsQfJPDPgesPGvuOL3ggg1qxMpWgt5uN0moo7SqmQx0gUt8tZnQ5aTEWXL1vOMM8mvNuhKId0PIC8TNMksr7E0nPoeOOaLP1S1UxCZFpMHHXTGnbYP8UMs0x6AurvU6k/OIw9nqBxPuB9/uVUq0nLxhrIZO X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY3PR13MB4804.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(396003)(376002)(39840400004)(136003)(346002)(366004)(451199021)(54906003)(2906002)(478600001)(26005)(41300700001)(6666004)(6486002)(86362001)(36756003)(52116002)(8936002)(8676002)(5660300002)(316002)(6512007)(66946007)(66556008)(66476007)(38350700002)(4326008)(38100700002)(6916009)(1076003)(6506007)(2616005)(186003)(66574015)(83380400001)(107886003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dDRiV2gxSUVrcEJFK2czS0FBczJoSFMyYys1WDh6M01UNTEveDVnbnRVbkd6?= =?utf-8?B?RllCU1BMc2hMOXlkN2gybEJZK3FtUkt1V1BOWXVaOVhyOUNLRFpuWGlWNU9T?= =?utf-8?B?L3hRb2dRSVdkYkFPTGt3eW5RSVFlRnJLMHJ2ZmNtcEp1MkpjL3ZxbzdNQ2Zp?= =?utf-8?B?Sm5ROU9Ec2FlSE1hU25zWlJiTlczT2g5R2ZPU3dNdzRSNnk4SFVaZlR1dEYv?= =?utf-8?B?SGQydUVUZmxWQ0UybDNkN2VBQjZ6bVlGYVBQSFdYWFlSNFM4MGJDU3FReUE3?= =?utf-8?B?cnJjaUY1VC9XTGs4MjRDRXpLS29venFveFNPL3A4eDVVc2pUSXBUclErQ2RF?= =?utf-8?B?Z1ZadlFRSW9VekdCL29vaVhIRnBjUj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= =?utf-8?B?ZUE9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: fcd41035-e82c-4351-cf92-08db7bfb5fe8 X-MS-Exchange-CrossTenant-AuthSource: BY3PR13MB4804.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 19:26:18.0667 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uZqeWgbhwANoNKpYoe1ZfRG9zo4refRjnRRhSvRONU6RAVAR6tzaQQobcTNeTYBzSMLyxD1BQYymWOXh7ZOl9AThtOCB3FL2/C3Y2M31QDs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR13MB5464 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org From: Qin Ke The verification code of interface_name and interface_speed can be moved forward, it can reduce unnecessary code execution if the verification failed. Adjust the code sequence of related code. Signed-off-by: Qin Ke Reviewed-by: Niklas Söderlund --- tests/TestSuite_speed_capabilities.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/TestSuite_speed_capabilities.py b/tests/TestSuite_speed_capabilities.py index 3bda904e8a81..2b950a541e7c 100644 --- a/tests/TestSuite_speed_capabilities.py +++ b/tests/TestSuite_speed_capabilities.py @@ -39,15 +39,20 @@ class TestSpeedCapabilities(TestCase): for port in self.ports: interface_name = self.tester.get_interface(self.tester.get_local_port(port)) - # Gives the speed in Mb/s - interface_speed = self.pmdout.get_port_link_speed(port) - self.verify( interface_name in expected_speeds, f"The interface {interface_name} does not have an expected " f"speed associated with it.", ) + # Gives the speed in Mb/s + interface_speed = self.pmdout.get_port_link_speed(port) + + self.verify( + len(interface_speed) > 0, + f"A valid speed could not be read for the interface {interface_name}.", + ) + detected_interfaces.append(interface_name) expected_speed = expected_speeds[interface_name] @@ -58,11 +63,6 @@ class TestSpeedCapabilities(TestCase): # Removes the unit from the speed expected_speed = "".join(i for i in expected_speed if i.isdigit()) - self.verify( - len(interface_speed) > 0, - f"A valid speed could not be read for the interface {interface_name}.", - ) - # Converts Gb/s to Mb/s for consistent comparison if expected_speed_unit == "G": expected_speed += "000" -- 2.41.0