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 DE6F0A054F; Wed, 25 May 2022 09:26:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B7E83400EF; Wed, 25 May 2022 09:26:27 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 19DF3400D6 for ; Wed, 25 May 2022 09:26:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653463586; x=1684999586; h=from:to:cc:subject:date:message-id; bh=8xB15sb+dgUCfLgDueXRgdhwC0anTUMqXK/oKvfF3qk=; b=K32e7c8LOplU4/hXUdkaEWeD316U1LCW3hcGf70LB0AiYwM7LyBPKVu/ zL6o08MBVTt24oT91Tb1qN5OwYI4TKyVIMql7HlTw9luodM7u6yWl2N52 LidngJrw4BZjAdFJjvSL2VqxQ/l0ICN6KaWjZSaA/dC9F6hXG5gg9tOcL FphQyw/4bZ6C6HJwyVzEqZ1umUMeLcSWCZR9IyEmywIzXUXBpWhc7r3XO klEnO8CHOtnSRiWqOuPACXXC2p0A+fejfqXYUuPhR5WeaMswGsWO8pv3v QdTL/cmcLrT20ysd1NLZtTUoIeBbehtKQsIqC6Q9OFKGKM41yKvH1ohrn w==; X-IronPort-AV: E=McAfee;i="6400,9594,10357"; a="253615968" X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="253615968" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2022 00:26:24 -0700 X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="601722369" Received: from unknown (HELO localhost.localdomain.localdomain) ([10.239.251.127]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2022 00:26:23 -0700 From: Yu To: dts@dpdk.org Cc: Yu Jiang Subject: [dts][PATCH V1] tests/pmd_bonded_8023ad: wait link status up Date: Wed, 25 May 2022 15:26:17 +0800 Message-Id: <1653463577-12719-1-git-send-email-yux.jiang@intel.com> X-Mailer: git-send-email 1.8.3.1 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: Yu Jiang Optimize script by using method wait_link_status_up to make script more stable Signed-off-by: Yu Jiang --- tests/TestSuite_pmd_bonded_8023ad.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/TestSuite_pmd_bonded_8023ad.py b/tests/TestSuite_pmd_bonded_8023ad.py index 88d07bfd..8dd12d2b 100644 --- a/tests/TestSuite_pmd_bonded_8023ad.py +++ b/tests/TestSuite_pmd_bonded_8023ad.py @@ -162,7 +162,10 @@ class TestBonding8023AD(TestCase): self.bond_inst.d_console([start_fmt(self.bond_port), "", 15]) time.sleep(5) self.bond_inst.d_console(["start", "", 10]) - self.logger.info("set bond port ready done !!!") + self.verify( + self.bond_inst.testpmd.wait_link_status_up("all"), + "Failed to set bond port ready!!!", + ) def run_8023ad_pre(self, slaves, bond_mode): bond_port = self.set_8023ad_bonded(slaves, bond_mode) @@ -173,7 +176,10 @@ class TestBonding8023AD(TestCase): time.sleep(2) cmds = ["port start all", "", 10] self.bond_inst.d_console(cmds) - time.sleep(2) + self.verify( + self.bond_inst.testpmd.wait_link_status_up("all"), + "run_8023ad_pre: Failed to start all port", + ) return bond_port def bonding_8023ad_check_macs_without_slaves(self, bond_port): @@ -249,14 +255,10 @@ class TestBonding8023AD(TestCase): # start bonded device cmds = ["port start {0}".format(bond_port), "", 10] self.bond_inst.d_console(cmds) - status = self.bond_inst.get_port_info(bond_port, "link_status") - if status != "up": - msg = "bond port {0} fail to set up".format(bond_port) - self.logger.error(msg) - raise VerifyFailure(msg) - else: - msg = "bond port {0} set up successful !".format(bond_port) - self.logger.info(msg) + self.verify( + self.bond_inst.testpmd.wait_link_status_up("all", timeout=30), + "bond port {0} fail to set up".format(bond_port), + ) def check_bonded_device_promisc_mode(self, slaves, bond_port): # disable bonded device promiscuous mode -- 2.25.1