[dts] [PATCH] ptpclient: don't use software time stamping for cavm devices

pvukkisala at marvell.com pvukkisala at marvell.com
Sat Oct 19 17:53:28 CEST 2019


From: Phanendra Vukkisala <pvukkisala at marvell.com>

Aslo fix random failure occurs due to timing
Signed-off-by: Phanendra Vukkisala <pvukkisala at marvell.com>
---
 tests/TestSuite_ptpclient.py |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/tests/TestSuite_ptpclient.py b/tests/TestSuite_ptpclient.py
index 23590e4..461abf1 100644
--- a/tests/TestSuite_ptpclient.py
+++ b/tests/TestSuite_ptpclient.py
@@ -98,7 +98,10 @@ class TestPtpClient(TestCase):
         ptp client test case.
         """
         # use the first port on that self.nic
-        self.tester.send_expect("ptp4l -i %s -2 -m -S &" % self.itf0, "ptp4l")
+        if self.nic in ["cavium_a063", "cavium_a064"]:
+            self.tester.send_expect("ptp4l -i %s -2 -m &" % self.itf0, "ptp4l")
+        else:
+            self.tester.send_expect("ptp4l -i %s -2 -m -S &" % self.itf0, "ptp4l")
 
         # run ptpclient on the background
         self.dut.send_expect("./examples/ptpclient/build/ptpclient -c f -n 3 -- -T 0 -p 0x1 " + "&", "Delta between master and slave", 60)
@@ -125,7 +128,10 @@ class TestPtpClient(TestCase):
         d_time = self.dut.send_expect("date '+%Y-%m-%d %H:%M'","# ")
         self.verify(d_time == '2000-01-01 00:00', "set the time error")
 
-        self.tester.send_expect("ptp4l -i %s -2 -m -S &" % self.itf0, "ptp4l")
+        if self.nic in ["cavium_a063", "cavium_a064"]:
+            self.tester.send_expect("ptp4l -i %s -2 -m &" % self.itf0, "ptp4l")
+        else:
+            self.tester.send_expect("ptp4l -i %s -2 -m -S &" % self.itf0, "ptp4l")
 
         # run ptpclient on the background
         self.dut.send_expect("./examples/ptpclient/build/ptpclient -c f -n 3 -- -T 1 -p 0x1" + "&", "Delta between master and slave", 60)
@@ -152,6 +158,10 @@ class TestPtpClient(TestCase):
         # the output will include kill process info, at that time need get system time again.
         if len(dut_out) != len(tester_out):
             dut_out = self.dut.send_expect("date -u '+%Y-%m-%d %H:%M'", "# ")
+        ## In rare cases minute may change while getting time. So get time again
+        if dut_out != tester_out:
+            tester_out = self.tester.send_expect("date -u '+%Y-%m-%d %H:%M'", "# ")
+            dut_out = self.dut.send_expect("date -u '+%Y-%m-%d %H:%M'", "# ")
 
         self.verify(tester_out == dut_out, "the DUT time synchronous error")
 
-- 
1.7.9.5



More information about the dts mailing list