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 52564A00E6 for ; Fri, 9 Aug 2019 02:58:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 01EB129CB; Fri, 9 Aug 2019 02:58:21 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 9F7E11D7 for ; Fri, 9 Aug 2019 02:58:20 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Aug 2019 17:58:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,363,1559545200"; d="scan'208";a="177490362" Received: from dpdk-lihong-ub1604.sh.intel.com ([10.67.119.68]) by orsmga003.jf.intel.com with ESMTP; 08 Aug 2019 17:58:18 -0700 From: lihong To: dts@dpdk.org Cc: lihong Date: Fri, 9 Aug 2019 01:35:13 +0800 Message-Id: <1565285713-20031-1-git-send-email-lihongx.ma@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [PATCH V1] tests/pvp_vhost_user_reconnect: 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_vhost_user_reconnect.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/TestSuite_pvp_vhost_user_reconnect.py b/tests/TestSuite_pvp_vhost_user_reconnect.py index 5568376..69c4bed 100644 --- a/tests/TestSuite_pvp_vhost_user_reconnect.py +++ b/tests/TestSuite_pvp_vhost_user_reconnect.py @@ -40,8 +40,8 @@ import re import utils import time from test_case import TestCase -from settings import HEADER_SIZE from virt_common import VM +from packet import Packet, save_packets from pktgen import PacketGeneratorHelper @@ -76,8 +76,11 @@ class TestPVPVhostUserReconnect(TestCase): self.src1 = "192.168.4.1" self.dst1 = "192.168.3.1" self.checked_vm = False - self.header_size = HEADER_SIZE['eth'] + HEADER_SIZE['ip'] + HEADER_SIZE['udp'] + self.out_path = '/tmp/%s' % self.suite_name + 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() @@ -266,15 +269,14 @@ class TestPVPVhostUserReconnect(TestCase): def send_and_verify(self, cycle=0, tinfo=""): for frame_size in self.frame_sizes: - payload = frame_size - self.header_size - flow = '[Ether(dst="%s")/IP(src="%s",dst="%s")/UDP()/("X"*%d)]' % ( - self.dst_mac, self.src1, self.dst1, payload) - self.tester.scapy_append('wrpcap("reconnect.pcap", %s)' % flow) - self.tester.scapy_execute() + pkt = Packet(pkt_type = 'UDP', pkt_len = frame_size) + pkt.config_layers([('ether', {'dst': '%s' % self.dst_mac}), + ('ipv4', {'dst': '%s' % self.dst1, 'src': '%s' % self.src1})]) + save_packets([pkt], "%s/reconnect.pcap" % self.out_path) tgenInput = [] port = self.tester.get_local_port(self.pf) - tgenInput.append((port, port, "reconnect.pcap")) + tgenInput.append((port, port, "%s/reconnect.pcap" % self.out_path)) self.tester.pktgen.clear_streams() streams = self.pktgen_helper.prepare_stream_from_tginput(tgenInput, 100, -- 2.7.4