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 906BDA0613 for ; Wed, 28 Aug 2019 12:41:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 803F71BF98; Wed, 28 Aug 2019 12:41:00 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 510FF1BF98 for ; Wed, 28 Aug 2019 12:40:59 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Aug 2019 03:40:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,440,1559545200"; d="scan'208";a="180530038" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga008.fm.intel.com with ESMTP; 28 Aug 2019 03:40:56 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 28 Aug 2019 03:40:56 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 28 Aug 2019 03:40:56 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.80]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.139]) with mapi id 14.03.0439.000; Wed, 28 Aug 2019 18:40:54 +0800 From: "Tu, Lijuan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V1] tests: add absolute path for pcap file to support trex Thread-Index: AQHVUz9RwwQ2UAt+fkWrXwjqXjcNcacQc5kg Date: Wed, 28 Aug 2019 10:40:54 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB06CD2@SHSMSX101.ccr.corp.intel.com> References: <1565829328-25552-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1565829328-25552-1-git-send-email-lihongx.ma@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGM4NGNmMWEtNzg0NS00YmFmLThkM2YtYjY0NmUwOWI2Njk2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidGZUak9HWjRDZ2ZBVTRwXC9WRjFcL0hDbVdMTlc0b21JTHRtbzBySUhQUWdlU00wSHFlWVNnUWtocFBMZGNXZ3l0In0= x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1] tests: add absolute path for pcap file 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" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong > Sent: Thursday, August 15, 2019 8:35 AM > To: dts@dpdk.org > Cc: Ma, LihongX > Subject: [dts] [PATCH V1] tests: add absolute path for pcap file to suppo= rt > trex >=20 > Signed-off-by: lihong > --- > tests/TestSuite_pvp_share_lib.py | 19 +++++++++------- > ...TestSuite_pvp_vhost_user_built_in_net_driver.py | 26 ++++++++++++++--= -- > ---- > tests/TestSuite_pvp_virtio_user_2M_hugepages.py | 18 ++++++++------- > ...stSuite_virtio_user_for_container_networking.py | 18 ++++++++------- > 4 files changed, 48 insertions(+), 33 deletions(-) >=20 > diff --git a/tests/TestSuite_pvp_share_lib.py > b/tests/TestSuite_pvp_share_lib.py > index d85d79d..f117fd5 100644 > --- a/tests/TestSuite_pvp_share_lib.py > +++ b/tests/TestSuite_pvp_share_lib.py > @@ -49,15 +49,13 @@ class TestPVPShareLib(TestCase): > self.core_config =3D "1S/4C/1T" > self.dut_ports =3D self.dut.get_ports() > self.ports_socket =3D self.dut.get_numa_id(self.dut_ports[0]) > - self.cores_num =3D len([n for n in self.dut.cores if int(n['sock= et']) =3D=3D > - self.ports_socket]) > + self.core_list =3D self.dut.get_core_list( > + self.core_config, socket=3Dself.ports_socket) > self.verify(len(self.dut_ports) >=3D 1, "Insufficient ports for = testing") > - self.verify(self.cores_num >=3D 4, > + self.verify(len(self.core_list) >=3D 4, > "There has not enought cores to test this suite %s" = % > self.suite_name) >=20 > - self.core_list =3D self.dut.get_core_list( > - self.core_config, socket=3Dself.ports_socket) > self.core_list_virtio_user =3D self.core_list[0:2] > self.core_list_vhost_user =3D self.core_list[2:4] > self.core_mask_virtio_user =3D utils.create_mask(self.core_list_= virtio_user) > @@ -65,6 +63,11 @@ class TestPVPShareLib(TestCase): > self.mem_channels =3D self.dut.get_memory_channels() > self.dst_mac =3D self.dut.get_mac_address(self.dut_ports[0]) > self.prepare_share_lib_env() > + > + self.out_path =3D '/tmp' > + out =3D 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 =3D PacketGeneratorHelper() >=20 > @@ -105,9 +108,9 @@ class TestPVPShareLib(TestCase): > rx_port =3D self.tester.get_local_port(self.dut_ports[0]) > tx_port =3D self.tester.get_local_port(self.dut_ports[0]) > self.tester.scapy_append( > - 'wrpcap("vhost.pcap", [Ether(dst=3D"%s")/IP()/TCP()/("X"*%d)= ])' % > - (self.dst_mac, payload_size)) > - tgen_input.append((tx_port, rx_port, "vhost.pcap")) > + 'wrpcap("%s/vhost.pcap", [Ether(dst=3D"%s")/IP()/TCP()/("X"*= %d)])' % > + (self.out_path, self.dst_mac, payload_size)) > + tgen_input.append((tx_port, rx_port, "%s/vhost.pcap" % > + self.out_path)) >=20 > self.tester.scapy_execute() > self.tester.pktgen.clear_streams() > diff --git a/tests/TestSuite_pvp_vhost_user_built_in_net_driver.py > b/tests/TestSuite_pvp_vhost_user_built_in_net_driver.py > index 1f560ae..52d9df9 100644 > --- a/tests/TestSuite_pvp_vhost_user_built_in_net_driver.py > +++ b/tests/TestSuite_pvp_vhost_user_built_in_net_driver.py > @@ -39,6 +39,7 @@ import re > from test_case import TestCase > from settings import HEADER_SIZE > from pktgen import PacketGeneratorHelper > +from pmd_output import PmdOutput >=20 >=20 > class TestPVPVhostUserBuiltInNetDriver(TestCase): > @@ -51,15 +52,13 @@ class TestPVPVhostUserBuiltInNetDriver(TestCase): > self.core_config =3D "1S/4C/1T" > self.dut_ports =3D self.dut.get_ports() > self.ports_socket =3D self.dut.get_numa_id(self.dut_ports[0]) > - self.cores_num =3D len([n for n in self.dut.cores if int(n['sock= et']) =3D=3D > - self.ports_socket]) > + self.core_list =3D self.dut.get_core_list( > + self.core_config, socket=3Dself.ports_socket) > self.verify(len(self.dut_ports) >=3D 1, "Insufficient ports for = testing") > - self.verify(self.cores_num >=3D 4, > + self.verify(len(self.core_list) >=3D 4, > "There has not enought cores to test this suite %s" = % > self.suite_name) >=20 > - self.core_list =3D self.dut.get_core_list( > - self.core_config, socket=3Dself.ports_socket) > self.core_list_virtio_user =3D self.core_list[0:2] > self.core_list_vhost_user =3D self.core_list[2:4] > self.core_mask_virtio_user =3D utils.create_mask(self.core_list_= virtio_user) > @@ -72,6 +71,11 @@ class TestPVPVhostUserBuiltInNetDriver(TestCase): > " in region 'suite' like packet_sizes=3D[64, 128= , 256]") > if 'packet_sizes' in self.get_suite_cfg(): > self.frame_sizes =3D self.get_suite_cfg()['packet_sizes'] > + > + self.out_path =3D '/tmp' > + out =3D 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 =3D PacketGeneratorHelper() >=20 > @@ -85,6 +89,7 @@ class TestPVPVhostUserBuiltInNetDriver(TestCase): > self.dut.send_expect("killall -s INT testpmd", "# ") > self.vhost_switch =3D self.dut.new_session(suite=3D"vhost-switch= ") > self.virtio_user =3D self.dut.new_session(suite=3D"virtio-user") > + self.pmd_out =3D PmdOutput(self.dut, self.virtio_user) > # Prepare the result table > self.virtio_mac =3D "00:11:22:33:44:10" > self.vlan_id =3D 1000 > @@ -125,15 +130,16 @@ class TestPVPVhostUserBuiltInNetDriver(TestCase): > rx_port =3D self.tester.get_local_port(self.dut_ports[0]) > tx_port =3D self.tester.get_local_port(self.dut_ports[0]) > self.tester.scapy_append( > - 'wrpcap("vhost.pcap", > [Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP()/("X"*%d)])' % > - (self.virtio_mac, self.vlan_id, payload_size)) > - tgen_input.append((tx_port, rx_port, "vhost.pcap")) > + 'wrpcap("%s/vhost.pcap", > [Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP()/("X"*%d)])' % > + (self.out_path, self.virtio_mac, self.vlan_id, payload_s= ize)) > + tgen_input.append((tx_port, rx_port, "%s/vhost.pcap" % > + self.out_path)) >=20 > self.tester.scapy_execute() > self.tester.pktgen.clear_streams() > streams =3D > self.pktgen_helper.prepare_stream_from_tginput(tgen_input, 100, > None, self.tester.pktgen) > - _, pps =3D self.tester.pktgen.measure_throughput(stream_ids= =3Dstreams) > + trans_options=3D{'delay':5, 'duration': 20} > + _, pps =3D > + self.tester.pktgen.measure_throughput(stream_ids=3Dstreams, > + options=3Dtrans_options) > Mpps =3D pps / 1000000.0 > self.verify(Mpps > 0, "%s can not receive packets of frame s= ize %d" % > (self.running_case, frame_size)) > throughput =3D Mpps * 100 / \ @@ -187,6 +193,8 @@ class > TestPVPVhostUserBuiltInNetDriver(TestCase): > self.virtio_user.send_expect(command_line_user, "testpmd> ", 120= ) > self.virtio_user.send_expect("set fwd mac", "testpmd> ", 120) > self.virtio_user.send_expect("start tx_first", "testpmd> ", 120) > + res =3D self.pmd_out.wait_link_status_up('all') > + self.verify(res is True, 'There has port link is down') >=20 > def close_all_apps(self): > """ > diff --git a/tests/TestSuite_pvp_virtio_user_2M_hugepages.py > b/tests/TestSuite_pvp_virtio_user_2M_hugepages.py > index 56f285a..5531e0b 100644 > --- a/tests/TestSuite_pvp_virtio_user_2M_hugepages.py > +++ b/tests/TestSuite_pvp_virtio_user_2M_hugepages.py > @@ -52,15 +52,13 @@ class TestPVPVirtioWith2Mhuge(TestCase): > self.core_config =3D "1S/4C/1T" > self.dut_ports =3D self.dut.get_ports() > self.ports_socket =3D self.dut.get_numa_id(self.dut_ports[0]) > - self.cores_num =3D len([n for n in self.dut.cores if int(n['sock= et']) =3D=3D > - self.ports_socket]) > + self.core_list =3D self.dut.get_core_list( > + self.core_config, socket=3Dself.ports_socket) > self.verify(len(self.dut_ports) >=3D 1, "Insufficient ports for = testing") > - self.verify(self.cores_num >=3D 4, > + self.verify(len(self.core_list) >=3D 4, > "There has not enought cores to test this suite %s" = % > self.suite_name) >=20 > - self.core_list =3D self.dut.get_core_list( > - self.core_config, socket=3Dself.ports_socket) > self.core_list_virtio_user =3D self.core_list[0:2] > self.core_list_vhost_user =3D self.core_list[2:4] > self.core_mask_virtio_user =3D utils.create_mask(self.core_list_= virtio_user) > @@ -73,6 +71,10 @@ class TestPVPVirtioWith2Mhuge(TestCase): > " in region 'suite' like packet_sizes=3D[64, 128= , 256]") > if 'packet_sizes' in self.get_suite_cfg(): > self.frame_sizes =3D self.get_suite_cfg()['packet_sizes'] > + self.out_path =3D '/tmp' > + out =3D 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 =3D PacketGeneratorHelper() >=20 > @@ -102,9 +104,9 @@ class TestPVPVirtioWith2Mhuge(TestCase): > rx_port =3D self.tester.get_local_port(self.dut_ports[0]) > tx_port =3D self.tester.get_local_port(self.dut_ports[0]) > self.tester.scapy_append( > - 'wrpcap("vhost.pcap", [Ether(dst=3D"%s")/IP()/TCP()/("X"= *%d)])' % > - (self.dst_mac, payload_size)) > - tgen_input.append((tx_port, rx_port, "vhost.pcap")) > + 'wrpcap("%s/vhost.pcap", [Ether(dst=3D"%s")/IP()/TCP()/(= "X"*%d)])' % > + (self.out_path, self.dst_mac, payload_size)) > + tgen_input.append((tx_port, rx_port, "%s/vhost.pcap" % > + self.out_path)) >=20 > self.tester.scapy_execute() > self.tester.pktgen.clear_streams() > diff --git a/tests/TestSuite_virtio_user_for_container_networking.py > b/tests/TestSuite_virtio_user_for_container_networking.py > index c914a88..241d5b0 100644 > --- a/tests/TestSuite_virtio_user_for_container_networking.py > +++ b/tests/TestSuite_virtio_user_for_container_networking.py > @@ -53,8 +53,6 @@ class TestVirtioUserForContainer(TestCase): > self.dut_ports =3D self.dut.get_ports() > self.mem_channels =3D self.dut.get_memory_channels() > self.ports_socket =3D self.dut.get_numa_id(self.dut_ports[0]) > - self.cores_num =3D len([n for n in self.dut.cores if int(n['sock= et']) =3D=3D > - self.ports_socket]) > self.verify(len(self.dut_ports) >=3D 1, 'Insufficient ports for = testing') > self.headers_size =3D HEADER_SIZE['eth'] + HEADER_SIZE['ip'] + > HEADER_SIZE['udp'] >=20 > @@ -67,6 +65,10 @@ class TestVirtioUserForContainer(TestCase): > " in region 'suite' like packet_sizes=3D[64, 128= , 256]") > if 'packet_sizes' in self.get_suite_cfg(): > self.frame_sizes =3D self.get_suite_cfg()['packet_sizes'] > + self.out_path =3D '/tmp' > + out =3D 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 =3D PacketGeneratorHelper() >=20 > @@ -89,11 +91,11 @@ class TestVirtioUserForContainer(TestCase): >=20 > def get_core_mask(self): > core_config =3D '1S/%dC/1T' % (self.nb_cores*2 + 2) > - self.verify(self.cores_num >=3D (self.nb_cores*2 + 2), > - 'There has not enought cores to test this case %s' % > - self.running_case) > core_list =3D self.dut.get_core_list( > core_config, socket=3Dself.ports_socket) > + self.verify(len(core_list) >=3D (self.nb_cores*2 + 2), > + 'There has not enought cores to test this case %s' % > + self.running_case) > core_list_vhost_user =3D core_list[0:self.nb_cores+1] > core_list_virtio_user =3D core_list[self.nb_cores+1:self.nb_core= s*2+2] > self.core_mask_vhost_user =3D utils.create_mask(core_list_vhost_= user) > @@ -109,9 +111,9 @@ class TestVirtioUserForContainer(TestCase): > rx_port =3D self.tester.get_local_port(self.dut_ports[0]) > tx_port =3D self.tester.get_local_port(self.dut_ports[0]) > self.tester.scapy_append( > - 'wrpcap("vhost.pcap", [Ether(dst=3D"%s")/IP()/UDP()/("X"= *%d)])' % > - (self.virtio_mac, payload_size)) > - tgen_input.append((tx_port, rx_port, "vhost.pcap")) > + 'wrpcap("%s/vhost.pcap", [Ether(dst=3D"%s")/IP()/UDP()/(= "X"*%d)])' % > + (self.out_path, self.virtio_mac, payload_size)) > + tgen_input.append((tx_port, rx_port, "%s/vhost.pcap" % > + self.out_path)) >=20 > self.tester.scapy_execute() > self.tester.pktgen.clear_streams() > -- > 2.7.4