From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 35E7AA054F; Mon, 15 Mar 2021 09:36:25 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A47B2425E0; Mon, 15 Mar 2021 09:36:25 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 0E17D4003C for ; Mon, 15 Mar 2021 09:36:22 +0100 (CET) IronPort-SDR: GKJZ3Jc4nQdZyo7742SRLWHbPNn2Rc+ZK7RIQgY0WJIB6zrZGcNZZ5Kg07YvPMBl0j+fLjh5ZH Pt4FxJj8WWHg== X-IronPort-AV: E=McAfee;i="6000,8403,9923"; a="188414926" X-IronPort-AV: E=Sophos;i="5.81,249,1610438400"; d="scan'208";a="188414926" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2021 01:36:21 -0700 IronPort-SDR: HXLcDG6y4ji1IKPpLheEqiLwQ80jAZ1/UsdRfIVBzFyLUZOBH65SGy0/1phidMHtTmd9DRZNz8 5cVW0DdPg8vw== X-IronPort-AV: E=Sophos;i="5.81,249,1610438400"; d="scan'208";a="405107853" Received: from unknown (HELO localhost.localdomain) ([10.240.183.222]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2021 01:36:19 -0700 From: Ling Wei To: dts@dpdk.org Cc: Ling Wei Date: Mon, 15 Mar 2021 16:35:24 +0800 Message-Id: <20210315083524.3313-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH V1] tests/pvp_diff_qemu_version:move verify step after print result table X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Move verify step after print result table. Signed-off-by: Ling Wei --- 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