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 D3EC441B98; Thu, 9 Feb 2023 07:56:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE2C442B71; Thu, 9 Feb 2023 07:56:40 +0100 (CET) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id DA6EC42B8C for ; Thu, 9 Feb 2023 07:56:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675925799; x=1707461799; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t+slbzfje+daC7MWPc4aossFzd5RMDMUHBnWf5fgXMc=; b=cZngid773cIs0ErNGY3Z5N4lqZOQjW7XUzP2H3mw0U64sgacTaX2iJ2n ComfSHmpWMKVu6s10EV3kK4JSqjlRNXU7YZC/q88QsADWhUtdERDiozxj u8KTh3lgRiwtNsdytAWpLLrp7Gd41aiLgo1cqPlqUe8ZtI4lTuRXKPA/m ws/0GUtQ51Rf+baKGbTMy1We2M+yloOt2ExGcusjFZ/fEZ1eYvkhgc8ER +0Hva62hId4ImIr9zEiVt4RNNXbbIcrYX/pXSgqH5G2jzX2ez3Ye/s8Gw otq+E3tMzO3Y7jU0tzIcK/nmBYNZqVbnXe/VD0OsQD+nWLZq28GI39C8v w==; X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="392420774" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="392420774" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 22:56:37 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10615"; a="810224125" X-IronPort-AV: E=Sophos;i="5.97,281,1669104000"; d="scan'208";a="810224125" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 22:56:36 -0800 From: Song Jiale To: dts@dpdk.org Cc: Song Jiale Subject: [dts] [PATCH V1 4/4] tests/bonding: modify the script to adapt to changes in dpdk Date: Thu, 9 Feb 2023 14:53:51 +0000 Message-Id: <20230209145351.1140496-5-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230209145351.1140496-1-songx.jiale@intel.com> References: <20230209145351.1140496-1-songx.jiale@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 the display information of the binding port in dpdk-testpmd has changed. modify the script to adapt to this change. According to dpdk commit f3b5f3d35c59e1("app/testpmd: use dump API to show bonding info"). Signed-off-by: Song Jiale --- tests/bonding.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/tests/bonding.py b/tests/bonding.py index 30f55c7f..d6d3ea30 100644 --- a/tests/bonding.py +++ b/tests/bonding.py @@ -19,13 +19,13 @@ from framework.pmd_output import PmdOutput from framework.settings import HEADER_SIZE # define bonding mode -MODE_ROUND_ROBIN = 0 -MODE_ACTIVE_BACKUP = 1 -MODE_XOR_BALANCE = 2 -MODE_BROADCAST = 3 -MODE_LACP = 4 -MODE_TLB_BALANCE = 5 -MODE_ALB_BALANCE = 6 +MODE_ROUND_ROBIN = "ROUND_ROBIN(0)" +MODE_ACTIVE_BACKUP = "ACTIVE_BACKUP(1)" +MODE_XOR_BALANCE = "BALANCE(2)" +MODE_BROADCAST = "BROADCAST(3)" +MODE_LACP = "8023AD(4)" +MODE_TLB_BALANCE = "TLB(5)" +MODE_ALB_BALANCE = "ALB(6)" # define packet size FRAME_SIZE_64 = 64 @@ -643,7 +643,7 @@ class PmdBonding(object): def get_bonding_info(self, bond_port, info_types): """Get the specified port information by its output message format""" info_set = { - "mode": ["Bonding mode: ", "\d*"], + "mode": ["Bonding mode: ", "\S*"], "agg_mode": ["IEEE802.3AD Aggregator Mode: ", "\S*"], "balance_policy": ["Balance Xmit Policy: ", "\S+"], "slaves": [ @@ -689,13 +689,15 @@ class PmdBonding(object): return int(primary_port), [int(slave) for slave in active_slaves] - def create_bonded_device(self, mode=0, socket=0, verify_detail=False): + def create_bonded_device(self, mode="", socket=0, verify_detail=False): """ Create a bonding device with the parameters you specified. """ - cmd = "create bonded device %d %d" % (mode, socket) + p = r"\w+\((\d+)\)" + mode_id = int(re.match(p, mode).group(1)) + cmd = "create bonded device %d %d" % (mode_id, socket) out = self.d_console(cmd) - err_fmt = "Create bonded device on mode [%d] socket [%d] failed" + err_fmt = "Create bonded device on mode [%s] socket [%d] failed" self.verify("Created new bonded device" in out, err_fmt % (mode, socket)) fmts = [ "Created new bonded device net_bond_testpmd_[\d] on \(port ", @@ -708,7 +710,7 @@ class PmdBonding(object): if verify_detail: out = self.d_console("show bonding config %d" % bond_port) self.verify( - "Bonding mode: %d" % mode in out, + "Bonding mode: %s" % mode in out, "Bonding mode display error when create bonded device", ) self.verify( -- 2.25.1