[dts] [PATCH] tests/short_live: fixes the result parsing issue

Herbert Guan herbert.guan at arm.com
Fri Aug 4 09:18:14 CEST 2017


Fixes below issues:
1) corrected the scapy reslut parsing string
2) ensure link up for testpmd and l3fwd
3) pkill for l2fwd and l3fwd need to wait a while for process quit

Signed-off-by: Herbert Guan <herbert.guan at arm.com>
---
 tests/TestSuite_short_live.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/tests/TestSuite_short_live.py b/tests/TestSuite_short_live.py
index 72745a9..27c6f6a 100644
--- a/tests/TestSuite_short_live.py
+++ b/tests/TestSuite_short_live.py
@@ -103,7 +103,7 @@ class TestShortLiveApp(TestCase):
             count = 2
 
         self.tester.scapy_append('p=sniff(iface="%s",count=%d,timeout=5)' % (rxitf, count))
-        self.tester.scapy_append('RESULT=str(p)')
+        self.tester.scapy_append('RESULT=str(p[%d].show)' % (count-1))
 
         self.tester.scapy_foreground()
 
@@ -125,7 +125,7 @@ class TestShortLiveApp(TestCase):
         Basic rx/tx forwarding test
         """
         #dpdk start
-        self.dut.send_expect("./%s/app/testpmd -c 0xf -n 4 -- -i --portmask=0x3" % self.target, "testpmd>", 120)
+        self.dut.send_expect("./%s/app/testpmd -c 0xf -n 4 -- -i --portmask=0x3" % self.target, "Link Up", 120)
         self.dut.send_expect("set fwd mac", "testpmd>")
         self.dut.send_expect("set promisc all off", "testpmd>")
         self.dut.send_expect("start", "testpmd>")
@@ -150,7 +150,7 @@ class TestShortLiveApp(TestCase):
         for i in range(repeat_time):
             #dpdk start
             print "clean_up_with_signal_testpmd round %d" % (i + 1)
-            self.dut.send_expect("./%s/app/testpmd -c 0xf -n 4 -- -i --portmask=0x3" % self.target, "testpmd>", 120)
+            self.dut.send_expect("./%s/app/testpmd -c 0xf -n 4 -- -i --portmask=0x3" % self.target, "Link Up", 120)
             self.dut.send_expect("set fwd mac", "testpmd>")
             self.dut.send_expect("set promisc all off", "testpmd>")
             self.dut.send_expect("start", "testpmd>")
@@ -174,8 +174,10 @@ class TestShortLiveApp(TestCase):
             # kill with differen Signal
             if i%2 == 0:
                 self.dut.send_expect("pkill -2 l2fwd", "#", 60, True)
+                time.sleep(2)
             else:
                 self.dut.send_expect("pkill -15 l2fwd", "#", 60, True)
+                time.sleep(2)
 
     def test_clean_up_with_signal_l3fwd(self):
         repeat_time = 5
@@ -183,14 +185,16 @@ class TestShortLiveApp(TestCase):
         for i in range(repeat_time):
             #dpdk start
             print "clean_up_with_signal_l3fwd round %d" % (i + 1)
-            self.dut.send_expect("./examples/l3fwd/build/app/l3fwd -n 4 -c 0xf -- -p 0x3 --config='(0,0,1),(1,0,2)' &", "L3FWD:", 120)
+            self.dut.send_expect("./examples/l3fwd/build/app/l3fwd -n 4 -c 0xf -- -p 0x3 --config='(0,0,1),(1,0,2)' &", "L3FWD: entering main loop", 120)
             self.check_forwarding([0, 0], self.nic)
 
             # kill with differen Signal
             if i%2 == 0:
                 self.dut.send_expect("pkill -2 l3fwd", "#", 60, True)
+                time.sleep(2)
             else:
                 self.dut.send_expect("pkill -15 l3fwd", "#", 60, True)
+                time.sleep(2)
 
     def tear_down(self):
         """
-- 
1.8.3.1



More information about the dts mailing list