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/short_live: wait for interface up
Date: Thu, 24 Feb 2022 15:42:21 +0000	[thread overview]
Message-ID: <20220224154221.1516892-3-yux.jiang@intel.com> (raw)
In-Reply-To: <20220224154221.1516892-1-yux.jiang@intel.com>

optimize script short_live:
1, use new method: is_interface_up to ensure iface's link status.
2, when launch example frequently, need wait for more than 0.5s to
restart example after kill example abnormally.

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

diff --git a/tests/TestSuite_short_live.py b/tests/TestSuite_short_live.py
index 1b8fbb94..556728b9 100644
--- a/tests/TestSuite_short_live.py
+++ b/tests/TestSuite_short_live.py
@@ -106,7 +106,8 @@ class TestShortLiveApp(TestCase):
         # rx and tx packet are list
         if (txPort == rxPort):
             count = 2
-
+        # ensure tester's link up
+        self.verify(self.tester.is_interface_up(intf=rxitf), "Wrong link status, should be up")
         filter_list = [{'layer': 'ether', 'config': {'type': 'not IPv6'}}, {'layer': 'userdefined', 'config': {'pcap-filter': 'not udp'}}]
         inst = self.tester.tcpdump_sniff_packets(rxitf, count=count,filters=filter_list)
 
@@ -135,6 +136,8 @@ class TestShortLiveApp(TestCase):
                 time.sleep(1)
                 delay = delay + 1
             else:
+                # need wait for 1s to restart example after kill example abnormally.
+                time.sleep(1)
                 break
         self.verify(delay < delay_max, "Failed to kill the process within %s seconds" % delay_max)
 
@@ -144,7 +147,6 @@ class TestShortLiveApp(TestCase):
         """
         #dpdk start
         self.dut.send_expect("./%s %s -- -i --portmask=0x3" % (self.app_testpmd, self.eal_para()), "testpmd>", 120)
-        time.sleep(5)
         self.dut.send_expect("set fwd mac", "testpmd>")
         self.dut.send_expect("set promisc all off", "testpmd>")
         self.dut.send_expect("start", "testpmd>")
-- 
2.25.1


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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24 15:42 [dts][PATCH V1 0/2] optimize script: " Yu Jiang
2022-02-24 15:42 ` [dts][PATCH V1 1/2] tests/kni: " Yu Jiang
2022-02-24 15:42 ` Yu Jiang [this message]
2022-02-27 14:20   ` [dts][PATCH V1 2/2] tests/short_live: " Tu, Lijuan
  -- strict thread matches above, loose matches on Subject: below --
2022-02-10 16:32 [dts][PATCH V1 0/2] optimize script: wait for interface/link up Yu Jiang
2022-02-10 16:32 ` [dts][PATCH V1 2/2] tests/short_live: wait for interface up Yu Jiang

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=20220224154221.1516892-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).