From patchwork Tue Sep 29 08:27:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lingli Chen X-Patchwork-Id: 79152 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 26B68A04C0; Tue, 29 Sep 2020 10:27:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1BC5A1BC82; Tue, 29 Sep 2020 10:27:39 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id A93B61BC72 for ; Tue, 29 Sep 2020 10:27:36 +0200 (CEST) IronPort-SDR: 8egDSXWsBB2TGRNP/zuqsSrUQpCtYf8tqZz4vZi3S2XofRsE02BE7g+IInRiwxx3Br5UcSVop2 CepX//Ze5egg== X-IronPort-AV: E=McAfee;i="6000,8403,9758"; a="162207239" X-IronPort-AV: E=Sophos;i="5.77,317,1596524400"; d="scan'208";a="162207239" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2020 01:27:33 -0700 IronPort-SDR: tWhUZ6pBynhYhttZ1EGHLfTXjSoF7j/R6NIHonxbDzB25E3BSCqIm5Id9rhU/iXF8qVD8lHTwH 9BZliHELEAFA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,317,1596524400"; d="scan'208";a="324595287" Received: from unknown (HELO localhost.localdomain) ([10.240.183.80]) by orsmga002.jf.intel.com with ESMTP; 29 Sep 2020 01:27:32 -0700 From: Chen Linglix To: dts@dpdk.org Cc: Chen Linglix Date: Tue, 29 Sep 2020 16:27:49 +0800 Message-Id: <20200929082749.15332-1-linglix.chen@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V1] tests/TestSuite_link_flowctrl:add set_up 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" add set_up,tear_down:Avoid the influence between cases Signed-off-by: Chen Linglix Tested-by: Chen, LingliX --- tests/TestSuite_link_flowctrl.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/TestSuite_link_flowctrl.py b/tests/TestSuite_link_flowctrl.py index 9e608bab..326f8b98 100644 --- a/tests/TestSuite_link_flowctrl.py +++ b/tests/TestSuite_link_flowctrl.py @@ -76,8 +76,6 @@ class TestLinkFlowctrl(TestCase): self.portMask = utils.create_mask([self.rx_port, self.tx_port]) - self.pmdout = PmdOutput(self.dut) - self.pmdout.start_testpmd("all", "--portmask=%s" % self.portMask) # get dts output path if self.logger.log_path.startswith(os.sep): self.output_path = self.logger.log_path @@ -88,6 +86,10 @@ class TestLinkFlowctrl(TestCase): # create an instance to set stream field setting self.pktgen_helper = PacketGeneratorHelper() + def set_up(self): + self.pmdout = PmdOutput(self.dut) + self.pmdout.start_testpmd("all", "--portmask=%s" % self.portMask) + def get_tgen_input(self): """ create streams for ports. @@ -563,9 +565,15 @@ class TestLinkFlowctrl(TestCase): "Link flow control fail, the loss percent is less than 50%") self.dut.send_expect("stop", "testpmd> ") - def tear_down_all(self): + def tear_down(self): """ Run after each test case. """ - self.dut.kill_all() self.dut.send_expect("quit", "# ") + self.dut.kill_all() + + def tear_down_all(self): + """ + Run after each test suite. + """ + pass