[V1] tests/ptpclient: optimize script
Checks
Context |
Check |
Description |
ci/Intel-dts-format-test |
success
|
Testing OK
|
ci/Intel-dts-pylama-test |
success
|
Testing OK
|
ci/Intel-dts-suite-test |
success
|
Testing OK
|
Commit Message
increase regular expressions to capture time to eliminate interference
from other echoes.
Signed-off-by: Song Jiale <songx.jiale@intel.com>
---
tests/TestSuite_ptpclient.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On Fri, 31 Mar 2023 14:08:06 +0000, Song Jiale <songx.jiale@intel.com> wrote:
> increase regular expressions to capture time to eliminate interference
> from other echoes.
>
> Signed-off-by: Song Jiale <songx.jiale@intel.com>
Applied, thanks
@@ -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"]: