test suite reviews and discussions
 help / color / mirror / Atom feed
From: Ling Wei <weix.ling@intel.com>
To: dts@dpdk.org
Cc: Ling Wei <weix.ling@intel.com>
Subject: [dts] [PATCH V1] tests/pvp_diff_qemu_version:move verify step after print result table
Date: Mon, 15 Mar 2021 16:35:24 +0800	[thread overview]
Message-ID: <20210315083524.3313-1-weix.ling@intel.com> (raw)

Move verify step after print result table.

Signed-off-by: Ling Wei <weix.ling@intel.com>
---
 tests/TestSuite_pvp_diff_qemu_version.py | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/tests/TestSuite_pvp_diff_qemu_version.py b/tests/TestSuite_pvp_diff_qemu_version.py
index 49fa1e1b..bdf3f67c 100644
--- a/tests/TestSuite_pvp_diff_qemu_version.py
+++ b/tests/TestSuite_pvp_diff_qemu_version.py
@@ -104,7 +104,7 @@ class TestVhostPVPDiffQemuVersion(TestCase):
         self.src1 = "192.168.4.1"
         self.dst1 = "192.168.3.1"
         self.header_row = ["QemuVersion", "FrameSize(B)", "Throughput(Mpps)",
-                           "LineRate(%)", "Cycle"]
+                           "LineRate(%)", "Cycle", "Expected Throughput(Mpps)"]
 
     def get_qemu_list_from_config(self):
         """
@@ -233,6 +233,7 @@ class TestVhostPVPDiffQemuVersion(TestCase):
 
     def send_verify(self, qemu_version, vlan_id1=0, tag="Performance"):
         self.result_table_create(self.header_row)
+        perf_result = {}
         for frame_size in self.frame_sizes:
             info = "Running test %s, and %d frame size." % (self.running_case, frame_size)
             self.logger.info(info)
@@ -253,15 +254,17 @@ class TestVhostPVPDiffQemuVersion(TestCase):
             traffic_opt = {'delay': 5, 'duration': 20}
             _, pps = self.tester.pktgen.measure_throughput(stream_ids=streams, options=traffic_opt)
             Mpps = pps / 1000000.0
-            pct = Mpps * 100 / float(self.wirespeed(self.nic, frame_size, 1))
-            self.verify(Mpps > self.check_value[frame_size],
-                        "%s of frame size %d speed verify failed, expect %s, result %s" % (
-                        self.running_case, frame_size, self.check_value[frame_size], Mpps))
+            line_rate = Mpps * 100 / float(self.wirespeed(self.nic, frame_size, 1))
             # update print table info
-            data_row = [qemu_version, frame_size, str(Mpps), str(pct), tag]
+            data_row = [qemu_version, frame_size, str(Mpps), str(line_rate), tag, self.check_value[frame_size]]
             self.result_table_add(data_row)
+            perf_result[frame_size] = Mpps
 
         self.result_table_print()
+        for frame_size in perf_result.keys():
+            self.verify(perf_result[frame_size] > self.check_value[frame_size],
+                        "%s of frame size %d speed verify failed, expect %s, result %s" % (
+                            self.running_case, frame_size, self.check_value[frame_size], perf_result[frame_size]))
 
     def close_testpmd_and_qemu(self):
         """
-- 
2.25.1


             reply	other threads:[~2021-03-15  8:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15  8:35 Ling Wei [this message]
2021-03-15  8:38 ` Ling, WeiX
2021-03-18  7:27 ` 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=20210315083524.3313-1-weix.ling@intel.com \
    --to=weix.ling@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).