[dts] [PATCH V1] fix test failed when master time less then slave time

xu,huilong huilongx.xu at intel.com
Tue Sep 5 04:04:34 CEST 2017


update regular expression for get time difference when master time less then slave time

Signed-off-by: xu,huilong <huilongx.xu at intel.com>
---
 tests/TestSuite_ptpclient.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/TestSuite_ptpclient.py b/tests/TestSuite_ptpclient.py
index f68c81b..2f5e004 100644
--- a/tests/TestSuite_ptpclient.py
+++ b/tests/TestSuite_ptpclient.py
@@ -107,8 +107,8 @@ class TestPtpClient(TestCase):
         self.kill_ptpclient()
 
         self.verify("T1" and "T2" and "T3" and "T4" in out, "T1,T2,T3,T4 clock error")
-        utils.regexp(out, r'Delta between master and slave clocks\:(\d+)ns')
-        pat = re.compile(r'Delta between master and slave clocks\:(\d+)ns')
+        utils.regexp(out, r'Delta between master and slave clocks\:(-?\d+)ns')
+        pat = re.compile(r'Delta between master and slave clocks\:(-?\d+)ns')
         Delta_list = pat.findall(out)
         Delta = map(int, Delta_list) 
         Delta_ns = self.average(Delta)
@@ -135,8 +135,8 @@ class TestPtpClient(TestCase):
         self.kill_ptpclient()
 
         self.verify("T1" and "T2" and "T3" and "T4" in out, "T1,T2,T3,T4 clock error")
-        utils.regexp(out, r'Delta between master and slave clocks\:(\d+)ns')
-        pat = re.compile(r'Delta between master and slave clocks\:(\d+)ns')
+        utils.regexp(out, r'Delta between master and slave clocks\:(-?\d+)ns')
+        pat = re.compile(r'Delta between master and slave clocks\:(-?\d+)ns')
         Delta_list = pat.findall(out)
         Delta = map(int, Delta_list)
         Delta_ns = self.average(Delta)
-- 
1.9.3



More information about the dts mailing list