[dts] [DTS][PATCH] update ieee1588 suite according to dpdk code

Jingguo Fu jingguox.fu at intel.com
Wed Jul 8 05:01:06 CEST 2015


Signed-off-by: Jingguo Fu <jingguox.fu at intel.com>
---
 tests/TestSuite_ieee1588.py | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/tests/TestSuite_ieee1588.py b/tests/TestSuite_ieee1588.py
index 6ee95e4..177fe9f 100644
--- a/tests/TestSuite_ieee1588.py
+++ b/tests/TestSuite_ieee1588.py
@@ -70,11 +70,11 @@ class TestIeee1588(TestCase):
         """
         IEEE1588 Enable test case.
         """
-        self.dut.send_expect("set fwd ieee1588", "testpmd> ")
+        self.dut.send_expect("set fwd ieee1588", "testpmd> ", 20)
         # Waiting for 'testpmd> ' Fails due to log messages, "Received non PTP packet", in the output
-        self.dut.send_expect("start", ">", 5)  
+        self.dut.send_expect("start", ">", 10)  
         # Allow the output from the "start" command to finish before looking for a regexp in expect
-        time.sleep(1)
+        time.sleep(5)
 
         # use the first port on that self.nic
         dutPorts = self.dut.get_ports()
@@ -88,23 +88,24 @@ class TestIeee1588(TestCase):
         # this is the output of sniff
         # [<Ether  dst=01:1b:19:00:00:00 src=00:00:00:00:00:00 type=0x88f7 |<Raw  load='\x00\x02' |>>]
         self.tester.scapy_foreground()
+        time.sleep(5)
         self.tester.scapy_append('nutmac="01:1b:19:00:00:00"')
         self.tester.scapy_append('sendp([Ether(dst=nutmac,type=0x88f7)/"\\x00\\x02"], iface="%s")' % itf)
-        self.tester.scapy_append('time.sleep(1)')
-
+        self.tester.scapy_append('time.sleep(5)')
         self.tester.scapy_execute()
+        time.sleep(5)
         out = self.tester.scapy_get_result()
+        time.sleep(5)
         self.verify("0x88f7" in out, "Ether type is not PTP")
         # self.verify("\\x00\\x02" in out, "Payload wrong in PTP")
 
-        time.sleep(1)
-        out = self.dut.send_expect("stop", "testpmd> ")
-
+        time.sleep(5)
+        out = self.dut.send_expect("stop", "testpmd> ", 30)
         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 (0x[0-9a-fA-F]+)")
-        tx_time = dts.regexp(out, "TX timestamp value (0x[0-9a-fA-F]+)")
+        rx_time = dts.regexp(out, "RX timestamp value ([0-9a-fA-F]+)")
+        tx_time = dts.regexp(out, "TX timestamp value ([0-9a-fA-F]+)")
 
         self.verify(rx_time is not None, "RX timestamp error ")
         self.verify(tx_time is not None, "TX timestamp error ")
-- 
1.9.3



More information about the dts mailing list