test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH] fix ieee1588 mismatch error
@ 2015-11-16  6:59 Lijuan Tu
  0 siblings, 0 replies; only message in thread
From: Lijuan Tu @ 2015-11-16  6:59 UTC (permalink / raw)
  To: dts; +Cc: Gu yongjie

From: Gu yongjie <yongjiex.gu@intel.com>

DPDK changed the output of timestamp value,
modify dts code to match it.

Signed-off-by: Gu yongjie <yongjiex.gu@intel.com>
---
 tests/TestSuite_ieee1588.py |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/tests/TestSuite_ieee1588.py b/tests/TestSuite_ieee1588.py
index 723ca40..012d601 100644
--- a/tests/TestSuite_ieee1588.py
+++ b/tests/TestSuite_ieee1588.py
@@ -36,6 +36,7 @@ Test support of IEEE1588 Precise Time Protocol.
 
 import dts
 import time
+import re
 from test_case import TestCase
 from pmd_output import PmdOutput
 
@@ -105,8 +106,15 @@ class TestIeee1588(TestCase):
         text = dts.regexp(out, "(.*) by hardware")
         self.verify("IEEE1588 PTP V2 SYNC" in text, "Not filtered " + text)
         
-        rx_time = dts.regexp(out, "RX timestamp value (\d+)")
-        tx_time = dts.regexp(out, "TX timestamp value (\d+)")
+        pattern_rx = re.compile("RX timestamp value (\d+) s (\d+) ns")
+        pattern_tx = re.compile("TX timestamp value (\d+) s (\d+) ns")
+
+        m_rx = pattern_rx.search(out)
+        m_tx = pattern_tx.search(out)
+        if m_rx is not None:
+            rx_time = m_rx.group(2)
+        if m_tx is not None:
+            tx_time = m_tx.group(2)
 
         self.verify(rx_time is not None, "RX timestamp error ")
         self.verify(tx_time is not None, "TX timestamp error ")
-- 
1.7.4.4

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-16  7:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-16  6:59 [dts] [PATCH] fix ieee1588 mismatch error Lijuan Tu

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).