From patchwork Thu Sep 22 02:58:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 116613 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 09C6AA0540; Thu, 22 Sep 2022 05:05:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E8C9740691; Thu, 22 Sep 2022 05:05:53 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 0EBF84067C for ; Thu, 22 Sep 2022 05:05:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663815952; x=1695351952; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Lm1MW/JgYJKgtpYcb5Zskb2L56Peq0cyp+9umvxSfe4=; b=TLY44OM5nnj2AI4woIde7Lt7aAfoXMghKwQ2/Gl3VITgcQa9J9l1GiXq FryQ6hI8sMYOHA8SzROtBashDLuclT0KdcFg8my5iPLk4AsGMU1TFTMaR iiSCO4EqOU8OrBsbbwZysFUT4hKX885VaNDF0HmrQ3v7kqYHXtWKWRh0z whFXnWNiaB+F/IuTH2qP0zctxVOcTV4EWGkpSxC38nQV1VUwodx2YmohD /eVTuCAdAGVdOp9Cn6cQHS+83HGTasgQgoouWkGvB7hwOX4yzjqJjcP0k GVv91mGfWWwDm0mKUIGCBpH14aGW6xDPp9B/YD02NOeH+qg0aH8zlbr01 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10477"; a="301026592" X-IronPort-AV: E=Sophos;i="5.93,335,1654585200"; d="scan'208";a="301026592" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2022 20:05:51 -0700 X-IronPort-AV: E=Sophos;i="5.93,335,1654585200"; d="scan'208";a="948415931" Received: from unknown (HELO localhost.localdomain) ([10.239.252.222]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2022 20:05:49 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V1] tests/pvp_share_lib: delete repeat code Date: Wed, 21 Sep 2022 22:58:43 -0400 Message-Id: <20220922025843.1862827-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 Optimize code and delete repeat code. Signed-off-by: Wei Ling --- tests/TestSuite_pvp_share_lib.py | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/tests/TestSuite_pvp_share_lib.py b/tests/TestSuite_pvp_share_lib.py index ee3ae39a..32879503 100644 --- a/tests/TestSuite_pvp_share_lib.py +++ b/tests/TestSuite_pvp_share_lib.py @@ -1,3 +1,4 @@ +# coding=utf-8 # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019 Intel Corporation # @@ -7,9 +8,8 @@ DPDK Test suite. The feature need compile dpdk as shared libraries. """ -import framework.utils as utils from framework.pktgen import PacketGeneratorHelper -from framework.settings import HEADER_SIZE +from framework.settings import HEADER_SIZE, DRIVERS from framework.test_case import TestCase @@ -130,7 +130,7 @@ class TestPVPShareLib(TestCase): ports=[self.pci_info], ) eal_param += ( - " -d librte_net_vhost.so -d librte_net_%s.so -d librte_mempool_ring.so --file-prefix=vhost" + "-d librte_net_vhost.so -d librte_net_%s.so -d librte_mempool_ring.so --file-prefix=vhost" % driver ) command_line_client = self.path + eal_param + " -- -i" @@ -152,7 +152,7 @@ class TestPVPShareLib(TestCase): ) if self.check_2M_env: eal_param += " --single-file-segments" - eal_param += " -d librte_net_virtio.so -d librte_mempool_ring.so" + eal_param += "-d librte_net_virtio.so -d librte_mempool_ring.so" command_line_user = self.path + eal_param + " -- -i" self.virtio_user.send_expect(command_line_user, "testpmd> ", 120) self.virtio_user.send_expect("start", "testpmd> ", 120) @@ -166,29 +166,15 @@ class TestPVPShareLib(TestCase): self.dut.close_session(self.vhost_user) self.dut.close_session(self.virtio_user) - def test_perf_pvp_share_lib_of_niantic(self): + def test_perf_pvp_share_lib(self): """ - Vhost/virtio-user pvp share lib test with 82599 + Vhost/virtio-user pvp share lib test with IntelĀ® Ethernet 82599/700 Series """ self.verify( - self.nic in ["IXGBE_10G-82599_SFP"], + self.nic in ["IXGBE_10G-82599_SFP", "I40E_10G-SFP_XL710", "I40E_40G-QSFP_A", "I40E_25G-25G_SFP28"], "the nic not support this case: %s" % self.running_case, ) - self.start_testpmd_as_vhost(driver="ixgbe") - self.start_testpmd_as_virtio() - self.send_and_verify() - self.result_table_print() - self.close_all_apps() - - def test_perf_pvp_share_lib_of_fortville(self): - """ - Vhost/virtio-user pvp share lib test with IntelĀ® Ethernet 700 Series - """ - self.verify( - self.nic in ["I40E_10G-SFP_XL710", "I40E_40G-QSFP_A", "I40E_25G-25G_SFP28"], - "the nic not support this case: %s" % self.running_case, - ) - self.start_testpmd_as_vhost(driver="i40e") + self.start_testpmd_as_vhost(driver=DRIVERS[self.nic]) self.start_testpmd_as_virtio() self.send_and_verify() self.result_table_print()