From: "Liu, Yong" <yong.liu@intel.com>
To: "Xu, HuilongX" <huilongx.xu@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Cc: "Xu, HuilongX" <huilongx.xu@intel.com>
Subject: Re: [dts] [PATCH V1] fix ptpclient case failed because of tester and dut time zone different
Date: Thu, 17 Aug 2017 09:03:56 +0000 [thread overview]
Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62E5543D@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1502953262-80372-1-git-send-email-huilongx.xu@intel.com>
Huilong,
You can use UTC time like below command, there's no need to set special time 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 <huilongx.xu@intel.com>
> Subject: [dts] [PATCH V1] fix ptpclient case failed because of tester and
> dut time zone different
>
> ptpclint test case will sync time with tester and dut. But when tester and
> dut time zone not different.
> test time and dut time not different, so use TZ='Asia/Shanghai' time zone
> for get tester and dut time
>
> Signed-off-by: xu,huilong <huilongx.xu@intel.com>
> ---
> tests/TestSuite_ptpclient.py | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
>
> 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):
>
> self.creat_table(Delta_us)
>
> - tester_out = self.tester.send_expect("date '+%Y-%m-%d %H:%M'", "#
> ")
> - dut_out = self.dut.send_expect("date '+%Y-%m-%d %H:%M'", "# ")
> -
> - if tester_out == dut_out:
> - self.verify(tester_out == dut_out, "the DUT time synchronous
> error")
> - else:
> - tester_out = self.tester.send_expect("date '+%Y-%m-%d %H:%M'",
> "# ")
> - dut_out = self.dut.send_expect("date '+%Y-%m-%d %H:%M'", "# ")
> - self.verify(tester_out == dut_out, "the DUT time synchronous
> error")
> + tester_out =
> self.tester.send_expect("TZ='Asia/Shanghai'TZ='Asia/Shanghai' date '+%Y-
> %m-%d %H:%M'", "# ")
> + dut_out = self.dut.send_expect("TZ='Asia/Shanghai' date '+%Y-%m-
> %d %H:%M'", "# ")
> +
> + self.verify(tester_out == dut_out, "the DUT time synchronous
> error")
>
> def tear_down(self):
> """
> --
> 1.9.3
prev parent reply other threads:[~2017-08-17 9:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-17 7:01 xu,huilong
2017-08-17 9:03 ` Liu, Yong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86228AFD5BCD8E4EBFD2B90117B5E81E62E5543D@SHSMSX103.ccr.corp.intel.com \
--to=yong.liu@intel.com \
--cc=dts@dpdk.org \
--cc=huilongx.xu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).