summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhuilong xu <huilongx.xu@intel.com>2015-07-13 15:39:50 +0800
committerMarvin Liu <yong.liu@intel.com>2015-07-13 16:00:43 +0800
commit3676d059520f07af1be9c27f6dd254e2ec3fa632 (patch)
treeaeea1b027e094315f18da61d58391b2435e0fbcc
parent87fdbf8785a05907e1f3f31bf3363a369904c02b (diff)
fix ieee1588 enable case failed for fortville and niantic NIC
Signed-off-by: huilong xu <huilongx.xu@intel.com>
-rw-r--r--tests/TestSuite_ieee1588.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/TestSuite_ieee1588.py b/tests/TestSuite_ieee1588.py
index 6ee95e4..e23f8fb 100644
--- a/tests/TestSuite_ieee1588.py
+++ b/tests/TestSuite_ieee1588.py
@@ -70,14 +70,15 @@ class TestIeee1588(TestCase):
"""
IEEE1588 Enable test case.
"""
- self.dut.send_expect("set fwd ieee1588", "testpmd> ")
+ self.dut.send_expect("set fwd ieee1588", "testpmd> ", 10)
# 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)
# use the first port on that self.nic
dutPorts = self.dut.get_ports()
+ mac = self.dut.get_mac_address(dutPorts[0])
port = self.tester.get_local_port(dutPorts[0])
itf = self.tester.get_interface(port)
@@ -88,7 +89,7 @@ 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()
- self.tester.scapy_append('nutmac="01:1b:19:00:00:00"')
+ self.tester.scapy_append('nutmac="%s"' % mac)
self.tester.scapy_append('sendp([Ether(dst=nutmac,type=0x88f7)/"\\x00\\x02"], iface="%s")' % itf)
self.tester.scapy_append('time.sleep(1)')
@@ -102,9 +103,9 @@ 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 (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 (\d+)")
+ tx_time = dts.regexp(out, "TX timestamp value (\d+)")
self.verify(rx_time is not None, "RX timestamp error ")
self.verify(tx_time is not None, "TX timestamp error ")
@@ -114,11 +115,12 @@ class TestIeee1588(TestCase):
"""
IEEE1588 Disable test case.
"""
- self.dut.send_expect("stop", "testpmd> ")
+ self.dut.send_expect("stop", "testpmd> ", 10)
time.sleep(3)
# use the first port on that self.nic
dutPorts = self.dut.get_ports()
+ mac = self.dut.get_mac_address(dutPorts[0])
port = self.tester.get_local_port(dutPorts[0])
itf = self.tester.get_interface(port)
@@ -127,7 +129,7 @@ class TestIeee1588(TestCase):
self.tester.scapy_append('RESULT = p[1].summary()')
self.tester.scapy_foreground()
- self.tester.scapy_append('nutmac="01:1b:19:00:00:00"')
+ self.tester.scapy_append('nutmac="%s"' % mac)
self.tester.scapy_append('sendp([Ether(dst=nutmac,type=0x88f7)/"\\x00\\x02"], iface="%s")' % itf)
self.tester.scapy_execute()