test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yu Jiang <yux.jiang@intel.com>
To: lijuan.tu@intel.com, dts@dpdk.org
Cc: Yu Jiang <yux.jiang@intel.com>
Subject: [dts][PATCH V1 2/2] tests/interrupt_pmd: wait for interface up
Date: Thu, 24 Feb 2022 14:23:49 +0000	[thread overview]
Message-ID: <20220224142349.1508842-3-yux.jiang@intel.com> (raw)
In-Reply-To: <20220224142349.1508842-1-yux.jiang@intel.com>

optimize script: interrupt_pmd,
use new method: is_interface_up to to ensure iface's link status before send_packets

Signed-off-by: Yu Jiang <yux.jiang@intel.com>
---
 tests/TestSuite_interrupt_pmd.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/TestSuite_interrupt_pmd.py b/tests/TestSuite_interrupt_pmd.py
index db8efe44..dd413aca 100644
--- a/tests/TestSuite_interrupt_pmd.py
+++ b/tests/TestSuite_interrupt_pmd.py
@@ -129,10 +129,11 @@ class TestInterruptPmd(TestCase):
         Send a packet to port
         """
         for i in range(len(self.dut_ports[:portnum])):
+            txport = self.tester.get_local_port(self.dut_ports[i])
+            mac = self.dut.get_mac_address(self.dut_ports[i])
+            txItf = self.tester.get_interface(txport)
+            self.verify(self.tester.is_interface_up(intf=txItf), "Tester's %s should be up".format(txItf))
             for j in range(num):
-                txport = self.tester.get_local_port(self.dut_ports[i])
-                mac = self.dut.get_mac_address(self.dut_ports[i])
-                txItf = self.tester.get_interface(txport)
                 self.tester.scapy_append(
                     'sendp([Ether()/IP(dst="198.0.0.%d")/UDP()/Raw(\'X\'*18)], iface="%s")' % (j, txItf))
         self.tester.scapy_execute()
-- 
2.25.1


  parent reply	other threads:[~2022-02-24  6:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24 14:23 [dts][PATCH V1 0/2] " Yu Jiang
2022-02-24 14:23 ` [dts][PATCH V1 1/2] flow_classify*: " Yu Jiang
2022-02-24 14:23 ` Yu Jiang [this message]
2022-02-24 15:28 [dts][PATCH V1 0/2] optimize script: " Yu Jiang
2022-02-24 15:28 ` [dts][PATCH V1 2/2] tests/interrupt_pmd: " Yu Jiang
2022-02-27 14:19   ` Tu, Lijuan

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=20220224142349.1508842-3-yux.jiang@intel.com \
    --to=yux.jiang@intel.com \
    --cc=dts@dpdk.org \
    --cc=lijuan.tu@intel.com \
    /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).