From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id EC7187D52 for ; Thu, 24 Aug 2017 07:22:51 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Aug 2017 22:22:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,419,1498546800"; d="scan'208";a="1187587932" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga001.fm.intel.com with ESMTP; 23 Aug 2017 22:22:50 -0700 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 23 Aug 2017 22:22:50 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 23 Aug 2017 22:22:50 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.128]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.117]) with mapi id 14.03.0319.002; Thu, 24 Aug 2017 13:22:48 +0800 From: "Liu, Yong" To: "Xu, GangX" , "dts@dpdk.org" CC: "Xu, GangX" Thread-Topic: [dts] [PATCH V1] fix ieee1588 Ether type is not PTP Thread-Index: AQHTG+JTbumonSHa9U6IaZc2BNw8D6KS+O/w Date: Thu, 24 Aug 2017 05:22:47 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62E666D9@SHSMSX101.ccr.corp.intel.com> References: <1503473765-86135-1-git-send-email-gangx.xu@intel.com> In-Reply-To: <1503473765-86135-1-git-send-email-gangx.xu@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: 10.0.102.7 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] fix ieee1588 Ether type is not PTP 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: , X-List-Received-Date: Thu, 24 Aug 2017 05:22:53 -0000 Gang, please use pep8 check with your changes first. I've seen some pep iss= ues in your patch. Also some comments inline. Thanks, Marvin > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,gang > Sent: Wednesday, August 23, 2017 3:36 PM > To: dts@dpdk.org > Cc: Xu, GangX > Subject: [dts] [PATCH V1] fix ieee1588 Ether type is not PTP >=20 > use tcpdump replace sniff caught package >=20 > Signed-off-by: xu,gang > --- > tests/TestSuite_ieee1588.py | 26 ++++++++++++++------------ > 1 file changed, 14 insertions(+), 12 deletions(-) >=20 > diff --git a/tests/TestSuite_ieee1588.py b/tests/TestSuite_ieee1588.py > index 58d9a10..e06b29d 100644 > --- a/tests/TestSuite_ieee1588.py > +++ b/tests/TestSuite_ieee1588.py > @@ -80,21 +80,23 @@ class TestIeee1588(TestCase): > port =3D self.tester.get_local_port(dutPorts[0]) > itf =3D self.tester.get_interface(port) >=20 > - self.tester.scapy_background() > - self.tester.scapy_append('p =3D sniff(iface=3D"%s", count=3D2)' = % itf) > - self.tester.scapy_append('RESULT =3D p[1].summary()') > + #create new session for send packet > + session_secondary =3D self.tester.create_session(name =3D > 'send_packet') >=20 > - # this is the output of sniff > - # [ type=3D0x88f7 |>] > - self.tester.scapy_foreground() > - self.tester.scapy_append('nutmac=3D"%s"' % mac) > - > self.tester.scapy_append('sendp([Ether(dst=3Dnutmac,type=3D0x88f7)/"\\x00= \\x02 > "], iface=3D"%s")' % itf) > - self.tester.scapy_append('time.sleep(1)') > + self.tester.send_expect("tcpdump -i %s -e ether src %s" % > (itf,mac), "tcpdump", 20) >=20 > - self.tester.scapy_execute() > - out =3D self.tester.scapy_get_result() > + session_secondary.send_expect("scapy", "Welcome", 20) Even "Welcome" can work here, suggest to use scapy default prompt ">>>". > + session_secondary.send_expect('nutmac=3D"%s"' % mac, ">>> ", 20) > + > session_secondary.send_expect('sendp([Ether(dst=3Dnutmac,type=3D0x88f7)/"= \\x00 > \\x02"], iface=3D"%s")' % itf, ">>> ", 20) Packet module should support 1588 packets, could you try whether below comm= and workable? pkt =3D Packet(pkt_type=3D'TIMESYNC') pkt.send_pkt(tx_port=3Ditf) > + > + out =3D self.tester.get_session_output(timeout=3D20) > + > + session_secondary.send_expect('exit()', "# ", 20) > + > + self.tester.send_expect("^C", "# ", 20) > + self.tester.destroy_session(session_secondary) > + > self.verify("0x88f7" in out, "Ether type is not PTP") > - # self.verify("\\x00\\x02" in out, "Payload wrong in PTP") >=20 > time.sleep(1) > out =3D self.dut.get_session_output() > -- > 1.9.3