From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6750DA0471 for ; Wed, 14 Aug 2019 08:00:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4AF611BDAE; Wed, 14 Aug 2019 08:00:59 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id AEDB61BDAC for ; Wed, 14 Aug 2019 08:00:57 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Aug 2019 23:00:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,384,1559545200"; d="scan'208";a="178021001" Received: from dpdk-lihong-ub1604.sh.intel.com ([10.67.119.68]) by fmsmga007.fm.intel.com with ESMTP; 13 Aug 2019 23:00:55 -0700 From: lihong To: dts@dpdk.org Cc: lihong Date: Wed, 14 Aug 2019 06:37:47 +0800 Message-Id: <1565735867-18624-1-git-send-email-lihongx.ma@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [PATCH V1] tests/pvp_diff_qemu_version: update code to support trex X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 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" Signed-off-by: lihong --- tests/TestSuite_pvp_diff_qemu_version.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/tests/TestSuite_pvp_diff_qemu_version.py b/tests/TestSuite_pvp_diff_qemu_version.py index d238a90..d1952b5 100644 --- a/tests/TestSuite_pvp_diff_qemu_version.py +++ b/tests/TestSuite_pvp_diff_qemu_version.py @@ -45,6 +45,7 @@ from scapy.utils import wrpcap from test_case import TestCase from settings import HEADER_SIZE from virt_common import VM +from pktgen import PacketGeneratorHelper class TestVhostPVPDiffQemuVersion(TestCase): @@ -74,6 +75,13 @@ class TestVhostPVPDiffQemuVersion(TestCase): res = self.verify_qemu_version_config() self.verify(res is True, "The path of qemu version in config file not right") + self.out_path = '/tmp' + out = self.tester.send_expect('ls -d %s' % self.out_path, '# ') + if 'No such file or directory' in out: + self.tester.send_expect('mkdir -p %s' % self.out_path, '# ') + # create an instance to set stream field setting + self.pktgen_helper = PacketGeneratorHelper() + def set_up(self): """ Run before each test case. @@ -221,14 +229,19 @@ class TestVhostPVPDiffQemuVersion(TestCase): payload = frame_size - HEADER_SIZE['eth'] - HEADER_SIZE['ip'] flow = '[Ether(dst="%s")/Dot1Q(vlan=%s)/IP(src="%s",dst="%s")/("X"*%d)]' % ( self.virtio1_mac, vlan_id1, self.src1, self.dst1, payload) - self.tester.scapy_append('wrpcap("pvp_diff_qemu_version.pcap", %s)' % flow) + self.tester.scapy_append('wrpcap("%s/pvp_diff_qemu_version.pcap", %s)' % ( + self.out_path, flow)) self.tester.scapy_execute() tgenInput = [] port = self.tester.get_local_port(self.pf) - tgenInput.append((port, port, "pvp_diff_qemu_version.pcap")) - _, pps = self.tester.traffic_generator_throughput( - tgenInput, delay=30) + tgenInput.append((port, port, "%s/pvp_diff_qemu_version.pcap" % self.out_path)) + + self.tester.pktgen.clear_streams() + streams = self.pktgen_helper.prepare_stream_from_tginput(tgenInput, 100, None, self.tester.pktgen) + # set traffic option + 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 != 0, "can not received data of frame size %d" % frame_size) -- 2.7.4