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 8A27DA2E1B for ; Wed, 4 Sep 2019 07:01:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7627C1BF69; Wed, 4 Sep 2019 07:01:07 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 76AA61BF46 for ; Wed, 4 Sep 2019 07:01:03 +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 orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Sep 2019 22:01:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,465,1559545200"; d="scan'208";a="184994336" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 03 Sep 2019 22:01:02 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 3 Sep 2019 22:01:02 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 3 Sep 2019 22:01:01 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.92]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.89]) with mapi id 14.03.0439.000; Wed, 4 Sep 2019 13:00:59 +0800 From: "Tu, Lijuan" To: "Zhang, YanX A" , "dts@dpdk.org" CC: "Zhang, YanX A" Thread-Topic: [dts] [PATCH V1] tests/TestSuite_metering_and_policing:Modify scripts to run less time Thread-Index: AQHVWZGMhDZlIHkd5Ua/OhB5Xycd4KcbCFBg Date: Wed, 4 Sep 2019 05:00:58 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB1BE04@SHSMSX101.ccr.corp.intel.com> References: <1566551217-44175-1-git-send-email-yanx.a.zhang@intel.com> In-Reply-To: <1566551217-44175-1-git-send-email-yanx.a.zhang@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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzlhN2IyYWYtOWY0NC00OWU2LWJmYzYtMGI2MTU5ODM0ODJkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRGFta2xmTW9vZk9NdTNuQTR1K0djSFpPUE9lV05tQlFyaFlaVXdFNWNZT2dWb01QcFNRa09jREhcL0FhNys1dXcifQ== 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/TestSuite_metering_and_policing:Modify scripts to run less time 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 zhang,yan > Sent: Friday, August 23, 2019 5:07 PM > To: dts@dpdk.org > Cc: Zhang, YanX A > Subject: [dts] [PATCH V1] tests/TestSuite_metering_and_policing:Modify > scripts to run less time >=20 > Optimize scapy open and close mode. >=20 > Signed-off-by: zhang,yan > --- > tests/TestSuite_metering_and_policing.py | 24 +++++++++++++++++++++--- > 1 file changed, 21 insertions(+), 3 deletions(-) >=20 > diff --git a/tests/TestSuite_metering_and_policing.py > b/tests/TestSuite_metering_and_policing.py > index c4c83d6..77da805 100644 > --- a/tests/TestSuite_metering_and_policing.py > +++ b/tests/TestSuite_metering_and_policing.py > @@ -45,6 +45,22 @@ from dut import Dut >=20 >=20 > class TestMeteringAndPolicing(TestCase): > + scapyCmds =3D [] > + > + def start_scapy(self): > + self.tester.scapy_foreground() > + self.tester.send_expect('scapy', '>>> ', 10) > + self.scapy_status =3D True > + > + def end_scapy(self): > + self.tester.send_expect("exit()", "#") > + self.scapy_status =3D False > + > + def scapy_execute(self, timeout=3D60): > + for cmd in self.scapyCmds: > + self.tester.send_expect(cmd, ">>> ", timeout) > + > + self.scapyCmds =3D [] >=20 > def copy_config_files_to_dut(self): > """ > @@ -219,10 +235,10 @@ class TestMeteringAndPolicing(TestCase): > if protocol =3D=3D "UDP": > proto_str =3D "nh=3D17" >=20 > - self.tester.scapy_append( > + self.scapyCmds.append( >=20 > 'sendp([Ether(dst=3D"%s")/%s(src=3D"%s",dst=3D"%s",%s)/%s(sport=3D%d,dpor= t=3D%d)/R > aw(load=3D"P"*%d)], iface=3D"%s")' > % (self.dut_p0_mac, tag, src_ip, dst_ip, proto_str, protocol= , fwd_port, > fwd_port, pktsize, source_port)) > - self.tester.scapy_execute() > + self.scapy_execute() >=20 > def send_packet_and_check(self, ip_ver, protocol, fwd_port, pktsize, > expect_port): > """ > @@ -296,6 +312,7 @@ class TestMeteringAndPolicing(TestCase): > self.dut_p0_mac =3D self.dut.get_mac_address(self.dut_ports[0]) > self.port_id =3D len(self.dut_ports) > self.copy_config_files_to_dut() > + self.start_scapy() >=20 > def set_up(self): > """ > @@ -653,4 +670,5 @@ class TestMeteringAndPolicing(TestCase): > """ > Run after each test suite. > """ > - pass > + if self.scapy_status: > + self.end_scapy() > -- > 2.17.2