test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] tests/veb: fix rx and tx packet error
@ 2017-09-27  6:11 Fangfang Wei
  2017-09-30 10:26 ` Liu, Yong
  0 siblings, 1 reply; 2+ messages in thread
From: Fangfang Wei @ 2017-09-27  6:11 UTC (permalink / raw)
  To: dts; +Cc: Fangfangx Wei

From: Fangfangx Wei <fangfangx.wei@intel.com>

It has some io packets at beginning of starting testpmd, this case is to
verify pf or vf can receive correct packet number from tester.
So calculating rx and tx packet with start packet and end packet is correct.

Signed-off-by: Fangfangx Wei <fangfangx.wei@intel.com>
---
 tests/TestSuite_veb_switch.py | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/tests/TestSuite_veb_switch.py b/tests/TestSuite_veb_switch.py
index 01a5366..4c74e8f 100644
--- a/tests/TestSuite_veb_switch.py
+++ b/tests/TestSuite_veb_switch.py
@@ -394,29 +394,34 @@ class TestVEBSwitching(TestCase):
         self.session_secondary.send_expect("start", "testpmd>")
         time.sleep(2)
 
+        vf0_start_rx_stats = self.veb_get_pmd_stats("second", 0, "rx")
+        pf_start_tx_stats = self.veb_get_pmd_stats("first", 0, "tx")
         self.send_packet(self.vf0_mac, self.tester_itf)
         time.sleep(2)
         self.session_secondary.send_expect("stop", "testpmd>", 2)
         self.dut.send_expect("stop", "testpmd>", 2)
-        vf0_rx_stats = self.veb_get_pmd_stats("second", 0, "rx")
-        pf_tx_stats = self.veb_get_pmd_stats("first", 0, "tx")
-        self.verify(pf_tx_stats[0] == 0, "PF received unexpected packet")
-        self.verify(vf0_rx_stats[0] == 1, "no packet was received by VF0")
+        vf0_end_rx_stats = self.veb_get_pmd_stats("second", 0, "rx")
+        pf_end_tx_stats = self.veb_get_pmd_stats("first", 0, "tx")
+        self.verify(pf_end_tx_stats[0] - pf_start_tx_stats[0] == 0, "PF received unexpected packet")
+        self.verify(vf0_end_rx_stats[0] - vf0_start_rx_stats[0] == 1, "no packet was received by VF0")
  
         self.dut.send_expect("start", "testpmd>")
         time.sleep(2)
         self.session_secondary.send_expect("start", "testpmd>")
         time.sleep(2)
+        vf0_start_rx_stats = self.veb_get_pmd_stats("second", 0, "rx")
+        pf_start_tx_stats = self.veb_get_pmd_stats("first", 0, "tx")
+        pf_start_rx_stats = self.veb_get_pmd_stats("first", 0, "rx")
         self.send_packet(self.pf_mac_address, self.tester_itf)
         time.sleep(2)
         self.session_secondary.send_expect("stop", "testpmd>", 2)
         self.dut.send_expect("stop", "testpmd>", 2)
-        vf0_rx_stats = self.veb_get_pmd_stats("second", 0, "rx")
-        pf_tx_stats = self.veb_get_pmd_stats("first", 0, "tx")
-        pf_rx_stats = self.veb_get_pmd_stats("first", 0, "rx")
-        self.verify(pf_tx_stats[0] == 1, "no packet was sent by VF0")
-        self.verify(pf_rx_stats[0] == 1, "no packet was received by VF0")
-        self.verify(vf0_rx_stats[0] == 1, "no packet was received by VF0")
+        vf0_end_rx_stats = self.veb_get_pmd_stats("second", 0, "rx")
+        pf_end_tx_stats = self.veb_get_pmd_stats("first", 0, "tx")
+        pf_end_rx_stats = self.veb_get_pmd_stats("first", 0, "rx")
+        self.verify(pf_end_tx_stats[0] - pf_start_tx_stats[0] == 1, "no packet was sent by VF0")
+        self.verify(pf_end_rx_stats[0] - pf_start_rx_stats[0] == 1, "no packet was received by VF0")
+        self.verify(vf0_end_rx_stats[0] - vf0_start_rx_stats[0] == 0, "VF0 received unexpected packet")
         self.session_secondary.send_expect("quit", "# ")
         time.sleep(2)
         self.dut.send_expect("quit", "# ")
-- 
2.7.5

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dts] [PATCH V1] tests/veb: fix rx and tx packet error
  2017-09-27  6:11 [dts] [PATCH V1] tests/veb: fix rx and tx packet error Fangfang Wei
@ 2017-09-30 10:26 ` Liu, Yong
  0 siblings, 0 replies; 2+ messages in thread
From: Liu, Yong @ 2017-09-30 10:26 UTC (permalink / raw)
  To: Fangfang Wei, dts

Thanks Fangfang, applied.

On 09/27/2017 02:11 PM, Fangfang Wei wrote:
> From: Fangfangx Wei<fangfangx.wei@intel.com>
>
> It has some io packets at beginning of starting testpmd, this case is to
> verify pf or vf can receive correct packet number from tester.
> So calculating rx and tx packet with start packet and end packet is correct.
>
> Signed-off-by: Fangfangx Wei<fangfangx.wei@intel.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-30  1:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-27  6:11 [dts] [PATCH V1] tests/veb: fix rx and tx packet error Fangfang Wei
2017-09-30 10:26 ` Liu, Yong

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