From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C135FA00C4; Mon, 18 Apr 2022 12:29:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BB0E3406A2; Mon, 18 Apr 2022 12:29:14 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id C003F4014F for ; Mon, 18 Apr 2022 12:29:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650277752; x=1681813752; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=a7NM37KqhbZtRYTuH2iSk0yXWYPjznbDz/tgqNvWRSY=; b=FVOa8Q653nPxMglNFr1Yvz+Sju8amRLHerWSjIeKX81Rx41/hs8GtaTu 2QZHTXmzGMFgAZKkpr8F48ptpEuo6ZaPzSdguueY0U8yAF94Ppnnc96Je aMeeTHHde0JaZlJp6Swx1WH8wR8OT4t0IbMMvWkp5L+pTztI2Hvcw0fSc 0McmuCVCIMDEe4Kxo5shmlANu9qHxA4ZHACdsvKEBy5U1hg2XsXrzY89P 4uWA/Im434qGRjfo+3MZEoPigB1Cc/o64dF0mYTy94C8Z8h6XNKTNVaBD MXlElwLdNhg+bDahaS1vwhS4x8e7DW/DW7vu2UBBPl63ka8CvnUlyHkz5 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10320"; a="262352326" X-IronPort-AV: E=Sophos;i="5.90,269,1643702400"; d="scan'208";a="262352326" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2022 03:29:11 -0700 X-IronPort-AV: E=Sophos;i="5.90,269,1643702400"; d="scan'208";a="701774340" Received: from unknown (HELO localhost.localdomain) ([10.239.251.222]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2022 03:29:09 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V1 2/2] tests/pvp_share_lib: optimize code and delete repeat code Date: Mon, 18 Apr 2022 18:29:02 +0800 Message-Id: <20220418102902.512644-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/tests/TestSuite_pvp_share_lib.py b/tests/TestSuite_pvp_share_lib.py index f9c1f5da..f5377549 100644 --- a/tests/TestSuite_pvp_share_lib.py +++ b/tests/TestSuite_pvp_share_lib.py @@ -36,7 +36,7 @@ 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 @@ -157,7 +157,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" @@ -179,7 +179,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) @@ -193,29 +193,12 @@ 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): - """ - Vhost/virtio-user pvp share lib test with niantic - """ - self.verify( - self.nic in ["niantic"], - "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 fortville - """ + def test_perf_pvp_share_lib(self): self.verify( - self.nic in ["fortville_eagle", "fortville_spirit", "fortville_25g"], + self.nic in ["niantic", "fortville_eagle", "fortville_spirit", "fortville_25g"], "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() -- 2.25.1