From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by dpdk.org (Postfix) with ESMTP id 9570D2C19 for ; Fri, 4 Aug 2017 09:18:27 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C4DD41596; Fri, 4 Aug 2017 00:18:26 -0700 (PDT) Received: from localhost.localdomain.com (unknown [10.169.40.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3206C3F3E1; Fri, 4 Aug 2017 00:18:26 -0700 (PDT) From: Herbert Guan To: dts@dpdk.org, jianbo.liu@linaro.org Cc: Herbert Guan Date: Fri, 4 Aug 2017 15:18:14 +0800 Message-Id: <1501831094-31107-1-git-send-email-herbert.guan@arm.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dts] [PATCH] tests/short_live: fixes the result parsing issue X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Aug 2017 07:18:27 -0000 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 --- 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