From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 807CDA04C1; Fri, 22 Nov 2019 07:56:52 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2E8E32C28; Fri, 22 Nov 2019 07:56:52 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 0D25E2C23 for ; Fri, 22 Nov 2019 07:56:49 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Nov 2019 22:56:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,228,1571727600"; d="scan'208";a="290569904" Received: from unknown (HELO dpdk-wenjielx-KVM190.icx.intel.com) ([10.238.54.190]) by orsmga001.jf.intel.com with ESMTP; 21 Nov 2019 22:56:47 -0800 From: Wenjie Li To: dts@dpdk.org Cc: Wenjie Li Date: Fri, 22 Nov 2019 15:43:10 +0000 Message-Id: <1574437390-66321-1-git-send-email-wenjiex.a.li@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V1] tests: optimize two suites 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" ensure the DUT port is up before the tester send packets in below suites: tests/TestSuite_metering_and_policing.py tests/TestSuite_short_live.py Signed-off-by: Wenjie Li --- tests/TestSuite_metering_and_policing.py | 8 ++++++-- tests/TestSuite_short_live.py | 12 ++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/TestSuite_metering_and_policing.py b/tests/TestSuite_metering_and_policing.py index 77da805..ef8c419 100644 --- a/tests/TestSuite_metering_and_policing.py +++ b/tests/TestSuite_metering_and_policing.py @@ -42,7 +42,7 @@ from test_case import TestCase from plotting import Plotting from settings import HEADER_SIZE from dut import Dut - +from pmd_output import PmdOutput class TestMeteringAndPolicing(TestCase): scapyCmds = [] @@ -244,7 +244,11 @@ class TestMeteringAndPolicing(TestCase): """ Send packet and check the stats. If expect_port == -1, the packet should be dropped. """ - time.sleep(3) + # check the ports are UP before sending packets + self.pmd_out = PmdOutput(self.dut) + res = self.pmd_out.wait_link_status_up('all', 30) + self.verify(res is True, 'there have port link is down') + rx_before = [] tx_before = [] for i in range(0, len(self.dut_ports)): diff --git a/tests/TestSuite_short_live.py b/tests/TestSuite_short_live.py index 4e1ee15..dfccbd8 100644 --- a/tests/TestSuite_short_live.py +++ b/tests/TestSuite_short_live.py @@ -141,6 +141,12 @@ class TestShortLiveApp(TestCase): self.dut.send_expect("set fwd mac", "testpmd>") self.dut.send_expect("set promisc all off", "testpmd>") self.dut.send_expect("start", "testpmd>") + + # check the ports are UP before sending packets + self.pmd_out = PmdOutput(self.dut) + res = self.pmd_out.wait_link_status_up('all', 30) + self.verify(res is True, 'there have port link is down') + self.check_forwarding([0, 1], self.nic) def test_start_up_time(self): @@ -166,6 +172,12 @@ class TestShortLiveApp(TestCase): self.dut.send_expect("set fwd mac", "testpmd>") self.dut.send_expect("set promisc all off", "testpmd>") self.dut.send_expect("start", "testpmd>") + + # check the ports are UP before sending packets + self.pmd_out = PmdOutput(self.dut) + res = self.pmd_out.wait_link_status_up('all', 30) + self.verify(res is True, 'there have port link is down') + self.check_forwarding([0, 1], self.nic) # kill with different Signal -- 2.17.1