From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 770F39958 for ; Thu, 17 Aug 2017 11:04:01 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Aug 2017 02:04:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,387,1498546800"; d="scan'208";a="1163552837" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga001.jf.intel.com with ESMTP; 17 Aug 2017 02:04:00 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 17 Aug 2017 02:03:59 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 17 Aug 2017 02:03:59 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.236]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.128]) with mapi id 14.03.0319.002; Thu, 17 Aug 2017 17:03:57 +0800 From: "Liu, Yong" To: "Xu, HuilongX" , "dts@dpdk.org" CC: "Xu, HuilongX" Thread-Topic: [dts] [PATCH V1] fix ptpclient case failed because of tester and dut time zone different Thread-Index: AQHTFyZ68QXIyXRw60yI33EwkriZVKKIQPqw Date: Thu, 17 Aug 2017 09:03:56 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62E5543D@SHSMSX103.ccr.corp.intel.com> References: <1502953262-80372-1-git-send-email-huilongx.xu@intel.com> In-Reply-To: <1502953262-80372-1-git-send-email-huilongx.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 ptpclient case failed because of tester and dut time zone different 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, 17 Aug 2017 09:04:02 -0000 Huilong, You can use UTC time like below command, there's no need to set special tim= e zone. date -u '+%Y-%m-%d %H:%M %Z' Thanks, Marvin > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,huilong > Sent: Thursday, August 17, 2017 3:01 PM > To: dts@dpdk.org > Cc: Xu, HuilongX > Subject: [dts] [PATCH V1] fix ptpclient case failed because of tester and > dut time zone different >=20 > ptpclint test case will sync time with tester and dut. But when tester an= d > dut time zone not different. > test time and dut time not different, so use TZ=3D'Asia/Shanghai' time zo= ne > for get tester and dut time >=20 > Signed-off-by: xu,huilong > --- > tests/TestSuite_ptpclient.py | 13 ++++--------- > 1 file changed, 4 insertions(+), 9 deletions(-) >=20 > diff --git a/tests/TestSuite_ptpclient.py b/tests/TestSuite_ptpclient.py > index f038bef..c469114 100644 > --- a/tests/TestSuite_ptpclient.py > +++ b/tests/TestSuite_ptpclient.py > @@ -146,15 +146,10 @@ class TestPtpClient(TestCase): >=20 > self.creat_table(Delta_us) >=20 > - tester_out =3D self.tester.send_expect("date '+%Y-%m-%d %H:%M'",= "# > ") > - dut_out =3D self.dut.send_expect("date '+%Y-%m-%d %H:%M'", "# ") > - > - if tester_out =3D=3D dut_out: > - self.verify(tester_out =3D=3D dut_out, "the DUT time synchro= nous > error") > - else: > - tester_out =3D self.tester.send_expect("date '+%Y-%m-%d %H:%= M'", > "# ") > - dut_out =3D self.dut.send_expect("date '+%Y-%m-%d %H:%M'", "= # ") > - self.verify(tester_out =3D=3D dut_out, "the DUT time synchro= nous > error") > + tester_out =3D > self.tester.send_expect("TZ=3D'Asia/Shanghai'TZ=3D'Asia/Shanghai' date '+= %Y- > %m-%d %H:%M'", "# ") > + dut_out =3D self.dut.send_expect("TZ=3D'Asia/Shanghai' date '+%Y= -%m- > %d %H:%M'", "# ") > + > + self.verify(tester_out =3D=3D dut_out, "the DUT time synchronous > error") >=20 > def tear_down(self): > """ > -- > 1.9.3