From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 28F574287F; Fri, 31 Mar 2023 08:11:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ECDB8427E9; Fri, 31 Mar 2023 08:11:33 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id DED544113C for ; Fri, 31 Mar 2023 08:11:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680243093; x=1711779093; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=BL5zUG0eEVBok8h4+3/crPQg2qu7fLWDpKq7uhg+iF0=; b=jR80fl35xGNseWaw3RKWVz/4N1fByaavO7qmWRYhkVsmjPicJ/Z5n7+A CNVXSE956u6IAyAAenhFCczNChsTPZYR+mwyJaWmJoaen9C2nDass6esL 6wc2UV516gQLTdt1HythGJGP1ApH8vopY9EBZaHOLcpV1Lwvae+YKWqbT Bp0cN26BAfiNTHEYh0tpSWYXjwx4pnW5uP/epOaGMEE5El9Km+DgPWU2+ BXneecROLSaXMzNHSdv21rF5soSQp9JkbBwO5SdQ5Ln3qcSxSIJZ/iVe1 uO2m9aLiPbJPnM4nODQEUGIBnmkYJeNOQyxvSxx2uYltCsERUYRxiZ+EM g==; X-IronPort-AV: E=McAfee;i="6600,9927,10665"; a="321757295" X-IronPort-AV: E=Sophos;i="5.98,307,1673942400"; d="scan'208";a="321757295" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2023 23:11:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10665"; a="774239051" X-IronPort-AV: E=Sophos;i="5.98,307,1673942400"; d="scan'208";a="774239051" Received: from unknown (HELO localhost.localdomain) ([10.239.252.20]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2023 23:11:30 -0700 From: Song Jiale To: dts@dpdk.org Cc: Song Jiale Subject: [dts] [PATCH V1] tests/ptpclient: optimize script Date: Fri, 31 Mar 2023 14:08:06 +0000 Message-Id: <20230331140806.204359-1-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 increase regular expressions to capture time to eliminate interference from other echoes. Signed-off-by: Song Jiale --- tests/TestSuite_ptpclient.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/TestSuite_ptpclient.py b/tests/TestSuite_ptpclient.py index 55ef98ff..1175e98a 100644 --- a/tests/TestSuite_ptpclient.py +++ b/tests/TestSuite_ptpclient.py @@ -104,7 +104,8 @@ class TestPtpClient(TestCase): # set the dut system time self.dut.send_expect("date -s '2000-01-01 00:00:00'", "# ") - d_time = self.dut.send_expect("date '+%Y-%m-%d %H:%M'", "# ") + out = self.dut.send_expect("date '+%Y-%m-%d %H:%M'", "# ") + d_time = re.findall(r"(\d{4}-\d{2}-\d{2}\s\d{2}:\d{2})", out)[0] self.verify(d_time == "2000-01-01 00:00", "set the time error") if self.nic in ["cavium_a063", "cavium_a064"]: -- 2.25.1