test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yu <yux.jiang@intel.com>
To: dts@dpdk.org
Cc: Yu Jiang <yux.jiang@intel.com>
Subject: [dts][PATCH V1] tests/pmd_bonded_8023ad: wait link status up
Date: Wed, 25 May 2022 15:26:17 +0800	[thread overview]
Message-ID: <1653463577-12719-1-git-send-email-yux.jiang@intel.com> (raw)

From: Yu Jiang <yux.jiang@intel.com>

Optimize script by using method wait_link_status_up to make script more stable

Signed-off-by: Yu Jiang <yux.jiang@intel.com>
---
 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


             reply	other threads:[~2022-05-25  7:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25  7:26 Yu [this message]
2022-05-25 11:11 ` lijuan.tu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1653463577-12719-1-git-send-email-yux.jiang@intel.com \
    --to=yux.jiang@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).