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 12361A0531; Mon, 10 Feb 2020 10:04:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D414F1BE94; Mon, 10 Feb 2020 10:04:44 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id DECF654AE for ; Mon, 10 Feb 2020 10:04:43 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Feb 2020 01:04:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,424,1574150400"; d="scan'208";a="433260300" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 10 Feb 2020 01:04:42 -0800 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 10 Feb 2020 01:04:42 -0800 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 10 Feb 2020 01:04:41 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.222]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.138]) with mapi id 14.03.0439.000; Mon, 10 Feb 2020 17:04:39 +0800 From: "Tu, Lijuan" To: "Xiao, QimaiX" , "dts@dpdk.org" CC: "Xiao, QimaiX" Thread-Topic: [dts] [PATCH V1]tests/inline_ipsec: update scripts for python3 and reduce runtime Thread-Index: AQHV0QbgMPvCo6Dy/kisA7IGuw+Yp6gUQCZw Date: Mon, 10 Feb 2020 09:04:40 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BBC57CC@SHSMSX101.ccr.corp.intel.com> References: <1579685348-453727-1-git-send-email-qimaix.xiao@intel.com> In-Reply-To: <1579685348-453727-1-git-send-email-qimaix.xiao@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-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/inline_ipsec: update scripts for python3 and reduce runtime 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 Xiao Qimai > Sent: Wednesday, January 22, 2020 5:29 PM > To: dts@dpdk.org > Cc: Xiao, QimaiX > Subject: [dts] [PATCH V1]tests/inline_ipsec: update scripts for python3 a= nd > reduce runtime >=20 > update scripts for python3 and reduce runtime >=20 > Signed-off-by: Xiao Qimai > --- > tests/TestSuite_inline_ipsec.py | 32 +++++++++++++++++--------------- > 1 file changed, 17 insertions(+), 15 deletions(-) >=20 > diff --git a/tests/TestSuite_inline_ipsec.py b/tests/TestSuite_inline_ips= ec.py > index 3cbdcae..3c358db 100644 > --- a/tests/TestSuite_inline_ipsec.py > +++ b/tests/TestSuite_inline_ipsec.py > @@ -174,14 +174,13 @@ class TestInlineIpsec(TestCase): > payload =3D test[0:int(paysize)] > sa_gcm =3D SecurityAssociation(ESP, spi=3Dsend_spi, > crypt_algo=3D'AES-GCM', > - > crypt_key=3D'\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4 > f\x3d\xde\xad\xbe\xef', > + > + > crypt_key=3Db'\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x > + 4f\x3d\xde\xad\xbe\xef', > auth_algo=3D'NULL', auth_key=3DNone= , > tunnel_header=3DIP(src=3Dsa_src, ds= t=3Dsa_dst)) > sa_gcm.crypt_algo.icv_size =3D 16 >=20 > p =3D IP(src=3D'192.168.105.10', dst=3Dinner_dst) > p /=3D payload > - p =3D IP(str(p)) >=20 > if do_encrypt =3D=3D True: > print("send encrypt package") @@ -217,26 +216,26 @@ class > TestInlineIpsec(TestCase): > self.dut.send_expect(cmd, "IPSEC", 60) >=20 > session_receive =3D > self.tester.create_session(name=3D'receive_encryption_package') > - sa_gcm =3D r"sa_gcm=3DSecurityAssociation(ESP,spi=3D%s,crypt_alg= o=3D'AES- > GCM',crypt_key=3D'\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\ > xcf\x4f\x3d\xde\xad\xbe\xef',auth_algo=3D'NULL',auth_key=3DNone,tunnel_he= a > der=3DIP(src=3D'172.16.1.5',dst=3D'172.16.2.5'))" % receive_spi > + sa_gcm =3D > + r"sa_gcm=3DSecurityAssociation(ESP,spi=3D%s,crypt_algo=3D'AES-GCM',cryp= t_key > + > =3Db'\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3d\xd > + > e\xad\xbe\xef',auth_algo=3D'NULL',auth_key=3DNone,tunnel_header=3DIP(src= =3D'17 > + 2.16.1.5',dst=3D'172.16.2.5'))" % receive_spi >=20 > session_receive.send_expect("scapy", ">>>", 10) > time.sleep(1) > session_receive.send_expect( > - "pkts=3Dsniff(iface=3D'%s',count=3D1,timeout=3D45)" % rxItf,= "", 10) > + "pkts=3Dsniff(iface=3D'%s', count=3D1, timeout=3D10)" % rxIt= f, "", > + 10) >=20 > if do_encrypt: > send_package =3D self.send_encryption_package( > txItf, paysize, do_encrypt, send_spi, count, inner_dst, = sa_src, > sa_dst) > - time.sleep(45) > + time.sleep(10) > session_receive.send_expect("pkts", "", 30) > out =3D session_receive.send_expect("pkts[0]['IP'] ", ">>>",= 10) > else: > session_receive2 =3D > self.tester.create_session(name=3D'receive_encryption_package2') > - session_receive2.send_expect("tcpdump -Xvvvi %s -c 1" % rxIt= f, "", 30) > + session_receive2.send_expect("tcpdump -Xvvvi %s -c 1" % > + rxItf, "", 10) > send_package =3D self.send_encryption_package(txItf, paysize= , > do_encrypt, send_spi, count, inner_dst, sa_src, > sa_dst) > - time.sleep(45) > - rev =3D session_receive2.get_session_before() > + time.sleep(10) > + rev =3D session_receive2.get_session_before(timeout=3D2) > print(rev) > p =3D re.compile(': ESP\(spi=3D0x\w+,seq=3D0x\w+\),') > res =3D p.search(rev) > @@ -347,7 +346,7 @@ class TestInlineIpsec(TestCase): > self.dut.send_expect(cmd, "IPSEC", 60) > session_receive =3D self.tester.create_session( > name=3D'receive_encryption_package') > - sa_gcm =3D r"sa_gcm=3DSecurityAssociation(ESP, spi=3D1005,crypt_= algo=3D'AES- > GCM',crypt_key=3D'\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\ > xcf\x4f\x3d\xde\xad\xbe\xef',auth_algo=3D'NULL', > auth_key=3DNone,tunnel_header=3DIP(src=3D'172.16.1.5', dst=3D'172.16.2.5'= ))" > + sa_gcm =3D r"sa_gcm=3DSecurityAssociation(ESP, spi=3D1005,crypt_= algo=3D'AES- > GCM',crypt_key=3Db'\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09 > \xcf\x4f\x3d\xde\xad\xbe\xef',auth_algo=3D'NULL', > auth_key=3DNone,tunnel_header=3DIP(src=3D'172.16.1.5', dst=3D'172.16.2.5'= ))" >=20 > session_receive.send_expect("scapy", ">>>", 60) > session_receive.send_expect(sa_gcm, ">>>", 60) @@ -364,14 +363,1= 3 > @@ class TestInlineIpsec(TestCase): > payload =3D "test for Ipsec Encryption Decryption simultaneously= " > sa_gcm =3D SecurityAssociation(ESP, spi=3D5, > crypt_algo=3D'AES-GCM', > - > crypt_key=3D'\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4 > f\x3d\xde\xad\xbe\xef', > + > + > crypt_key=3Db'\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x > + 4f\x3d\xde\xad\xbe\xef', > auth_algo=3D'NULL', auth_key=3DNone= , > tunnel_header=3DIP(src=3D'172.16.1.= 5', dst=3D'172.16.2.5')) > sa_gcm.crypt_algo.icv_size =3D 16 >=20 > p =3D IP(src=3D'192.168.105.10', dst=3D'192.168.105.10') > p /=3D payload > - p =3D IP(str(p)) >=20 > e1 =3D sa_gcm.encrypt(p) > e2 =3D p > @@ -383,12 +381,12 @@ class TestInlineIpsec(TestCase): > eth_e2.src =3D self.rx_src > eth_e2.dst =3D self.tx_dst > session_receive3 =3D > self.tester.create_session('check_forward_encryption_package') > - session_receive3.send_expect("tcpdump -Xvvvi %s -c 1" % self.rxI= tf, "", > 30) > + session_rece3ive3.send_expect("tcpdump -Xvvvi %s -c 1" % > + self.rxItf, "", 30) > time.sleep(2) > sendp(eth_e1, iface=3Dself.rxItf, count=3D2) > sendp(eth_e2, iface=3Dself.txItf, count=3D1) > - time.sleep(30) > - rev =3D session_receive3.get_session_before() > + time.sleep(3) > + rev =3D session_receive3.get_session_before(3) > print(rev) > p =3D re.compile(': ESP\(spi=3D0x\w+,seq=3D0x\w+\),') > res =3D p.search(rev) > @@ -401,12 +399,16 @@ class TestInlineIpsec(TestCase): > out =3D session_receive2.send_expect("pkts[1]", ">>>", 60) > self.verify(payload in out, > "The package is not received. Please check the packa= ge") > + self.tester.destroy_session(session_receive) > + self.tester.destroy_session(session_receive2) > + self.tester.destroy_session(session_receive3) >=20 > def tear_down(self): > """ > Run after each test case. > """ > - self.tester.send_expect("^C", "#", 5) > + self.tester.send_expect("killall scapy", "#", 5) > + self.tester.send_expect("killall tcpdump", "#", 5) > self.dut.kill_all() > time.sleep(2) >=20 > -- > 1.8.3.1