From patchwork Wed Jul 20 17:11:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 114064 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 4C90DA00C5; Wed, 20 Jul 2022 10:50:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3334040697; Wed, 20 Jul 2022 10:50:21 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id A1B904003C for ; Wed, 20 Jul 2022 10:50:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658307019; x=1689843019; h=from:to:cc:subject:date:message-id; bh=pfnGJpXw34SnOUJk3U2ven2MPhADKN/fwfPI6FDs2Rk=; b=Q9D+wJ1zDWq5hTV8KrjUzjXdMEUHI10RxguC2ys2S7lY7PqOJQFV1CWj b+XsRrbCP1ccnEkfqr74wHax/vhoB/N9K862zYDUxlUj5bgy8jnAHb0uK 8dvvMUGMsL1z+tNcAL49+RBgqTLgDc2qtRLoUsrjqi/i6njiNHrm0e4Sy BVkf/ytERze1tjtCrvvPGVvJ84Ryhb5aIo4E6WvkoS7Ylg2ME9RwvOyV3 0WAwFYdDBi++Z6SICSo+EvoEno5hLnXSsQ0lDsQu0ozCuy3tOGTkeluDa KUEn6m8LxvKPL61LozFOCjVo0M/AKad135drxodXntw+9qD6VzDi0/URk g==; X-IronPort-AV: E=McAfee;i="6400,9594,10413"; a="267119992" X-IronPort-AV: E=Sophos;i="5.92,286,1650956400"; d="scan'208";a="267119992" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2022 01:50:18 -0700 X-IronPort-AV: E=Sophos;i="5.92,286,1650956400"; d="scan'208";a="595162150" Received: from unknown (HELO localhost.localdomain) ([10.239.252.94]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2022 01:50:17 -0700 From: Jiale Song To: dts@dpdk.org Cc: Jiale Song Subject: [dts] [PATCH V1 1/2] tests/ice_dcf_switch_filter_gtpu: remove the method of checking testpmd status Date: Wed, 20 Jul 2022 17:11:12 +0000 Message-Id: <20220720171113.902-1-songx.jiale@intel.com> X-Mailer: git-send-email 2.17.1 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 1.the "testpmd_status" is the wrong status when launch app timeout, it will affect other cases test.remove this method. 2.add timeout. Signed-off-by: Jiale Song --- tests/TestSuite_ice_dcf_switch_filter_gtpu.py | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/tests/TestSuite_ice_dcf_switch_filter_gtpu.py b/tests/TestSuite_ice_dcf_switch_filter_gtpu.py index 0f48d78d..c79eb1b2 100644 --- a/tests/TestSuite_ice_dcf_switch_filter_gtpu.py +++ b/tests/TestSuite_ice_dcf_switch_filter_gtpu.py @@ -3550,7 +3550,6 @@ class ICEDCFSwitchFilterGTPUTest(TestCase): localPort = self.tester.get_local_port(self.dut_ports[0]) self.__tx_iface = self.tester.get_interface(localPort) self.pkt = Packet() - self.testpmd_status = "close" self.pass_flag = "passed" self.fail_flag = "failed" # bind pf to kernel @@ -3592,8 +3591,7 @@ class ICEDCFSwitchFilterGTPUTest(TestCase): """ dcf switch need reload driver to ensure create rule sucessful """ - self.dut.send_expect("rmmod ice", "# ", 15) - self.dut.send_expect("modprobe ice", "# ", 15) + self.dut.send_expect("rmmod ice && modprobe ice", "# ", 120) def create_testpmd_command(self): """ @@ -3617,8 +3615,7 @@ class ICEDCFSwitchFilterGTPUTest(TestCase): launch testpmd with the command """ command = self.create_testpmd_command() - self.dut.send_expect(command, "testpmd> ", 15) - self.testpmd_status = "running" + self.dut.send_expect(command, "testpmd> ", 30) self.dut.send_expect("set portlist 1", "testpmd> ", 15) self.dut.send_expect("set fwd rxonly", "testpmd> ", 15) self.dut.send_expect("set verbose 1", "testpmd> ", 15) @@ -3817,17 +3814,14 @@ class ICEDCFSwitchFilterGTPUTest(TestCase): """ quit testpmd and destroy vf """ - if self.testpmd_status != "close": - # destroy all flow rules on DCF - self.dut.send_expect("flow flush 0", "testpmd> ", 15) - self.dut.send_expect("clear port stats all", "testpmd> ", 15) - self.dut.send_expect("quit", "#", 15) - # kill all DPDK application - self.dut.kill_all() - # destroy vfs - for port_id in self.dut_ports: - self.dut.destroy_sriov_vfs_by_port(port_id) - self.testpmd_status = "close" + # destroy all flow rules on DCF + self.dut.send_expect("quit", "# ") + # kill all DPDK application + self.dut.kill_all() + # destroy vfs + for port_id in self.dut_ports: + self.dut.destroy_sriov_vfs_by_port(port_id) + if getattr(self, "session_secondary", None): self.dut.close_session(self.session_secondary) From patchwork Wed Jul 20 17:11:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 114065 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 60C1BA034C; Wed, 20 Jul 2022 10:50:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B8A5410F1; Wed, 20 Jul 2022 10:50:22 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 635D34003C for ; Wed, 20 Jul 2022 10:50:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658307020; x=1689843020; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=xLWAILVFnLBoqy8RDWZhbF+QyHPZrJliaJ3Mao9Ig2A=; b=fCmbwUlg12LBNEtPJqkZA6UBhEA9RyxuQaCuVCtx84WapaHeeRX504JU vHsafjJogkuB4kFq7cFDtEDVs5Pf8pYz4iqERiXrJMOXrLVgyj2+ZXUti ofWiYEIzp/qOWd3a8lyo8yvBK/FVNsw25EQ7RlfqtxrTey+78sKBRhLBU SNDXvCD43vwiB/l/AxinEBTQVP7fMH5fXcYYc0MELzlmkWz0G1RqmAs0e DPf5PtKOrfIicm14QocSJrIk6ztTM2gFewyDlw6iInTh8hN3AroKeyVxV FYWqscI2doCUlAADSQ5Z5ymCMVD/4boAq3rHmzUpKitN9ahGC4AtlkneE g==; X-IronPort-AV: E=McAfee;i="6400,9594,10413"; a="267119996" X-IronPort-AV: E=Sophos;i="5.92,286,1650956400"; d="scan'208";a="267119996" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2022 01:50:19 -0700 X-IronPort-AV: E=Sophos;i="5.92,286,1650956400"; d="scan'208";a="595162165" Received: from unknown (HELO localhost.localdomain) ([10.239.252.94]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2022 01:50:18 -0700 From: Jiale Song To: dts@dpdk.org Cc: Jiale Song Subject: [dts] [PATCH V1 2/2] tests/ice_dcf_switch_filter: remove the method of checking testpmd status Date: Wed, 20 Jul 2022 17:11:13 +0000 Message-Id: <20220720171113.902-2-songx.jiale@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220720171113.902-1-songx.jiale@intel.com> References: <20220720171113.902-1-songx.jiale@intel.com> 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 1.the "testpmd_status" is the wrong status when launch app timeout, it will affect other cases test.remove this method. 2.add timeout. Signed-off-by: Jiale Song Tested-by: Weiyuan Li --- tests/TestSuite_ice_dcf_switch_filter.py | 44 ++++++++---------------- 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/tests/TestSuite_ice_dcf_switch_filter.py b/tests/TestSuite_ice_dcf_switch_filter.py index 3c647be6..c1131c41 100644 --- a/tests/TestSuite_ice_dcf_switch_filter.py +++ b/tests/TestSuite_ice_dcf_switch_filter.py @@ -1686,7 +1686,6 @@ class ICEDCFSwitchFilterTest(TestCase): self.pf0_intf = self.dut.ports_info[self.used_dut_port_0]["intf"] self.__tx_iface = self.tester.get_interface(localPort) self.pkt = Packet() - self.testpmd_status = "close" # bind pf to kernel self.bind_nics_driver(self.dut_ports, driver="ice") # get priv-flags default stats @@ -1719,8 +1718,7 @@ class ICEDCFSwitchFilterTest(TestCase): time.sleep(5) def reload_ice(self): - self.dut.send_expect("rmmod ice", "# ", 15) - self.dut.send_expect("modprobe ice", "# ", 15) + self.dut.send_expect("rmmod ice && modprobe ice", "# ", 120) def set_up(self): """ @@ -1748,8 +1746,7 @@ class ICEDCFSwitchFilterTest(TestCase): launch testpmd with the command """ command = self.create_testpmd_command() - out = self.dut.send_expect(command, "testpmd> ", 15) - self.testpmd_status = "running" + out = self.dut.send_expect(command, "testpmd> ", 30) self.dut.send_expect("set portlist 1", "testpmd> ", 15) self.dut.send_expect("set fwd rxonly", "testpmd> ", 15) self.dut.send_expect("set verbose 1", "testpmd> ", 15) @@ -2247,7 +2244,6 @@ class ICEDCFSwitchFilterTest(TestCase): self.dut.send_expect("flow flush 0", "testpmd> ", 300) self.dut.send_expect("quit", "#") - self.testpmd_status = "close" # destroy vfs for port_id in self.dut_ports: self.dut.destroy_sriov_vfs_by_port(port_id) @@ -2265,8 +2261,7 @@ class ICEDCFSwitchFilterTest(TestCase): port_options={vf0_pci: "cap=dcf"}, ) command = self.path + all_eal_param + " -- -i" - out = self.dut.send_expect(command, "testpmd> ", 15) - self.testpmd_status = "running" + out = self.dut.send_expect(command, "testpmd> ", 30) self.dut.send_expect("set portlist 1,2", "testpmd> ", 15) self.dut.send_expect("set fwd rxonly", "testpmd> ", 15) self.dut.send_expect("set verbose 1", "testpmd> ", 15) @@ -2322,8 +2317,7 @@ class ICEDCFSwitchFilterTest(TestCase): port_options={vf0_pci: "cap=dcf"}, ) command = self.path + all_eal_param + " -- -i" - out = self.dut.send_expect(command, "testpmd> ", 15) - self.testpmd_status = "running" + out = self.dut.send_expect(command, "testpmd> ", 30) self.dut.send_expect("set portlist 1,2", "testpmd> ", 15) self.dut.send_expect("set fwd rxonly", "testpmd> ", 15) self.dut.send_expect("set verbose 1", "testpmd> ", 15) @@ -2370,8 +2364,7 @@ class ICEDCFSwitchFilterTest(TestCase): self.setup_1pf_vfs_env() # launch testpmd command = self.create_testpmd_command() - out = self.dut.send_expect(command, "testpmd> ", 15) - self.testpmd_status = "running" + out = self.dut.send_expect(command, "testpmd> ", 30) self.dut.send_expect("set portlist 1", "testpmd> ", 15) self.dut.send_expect("set fwd mac", "testpmd> ", 15) self.dut.send_expect("set verbose 1", "testpmd> ", 15) @@ -2406,8 +2399,7 @@ class ICEDCFSwitchFilterTest(TestCase): port_options={vf0_pci: "cap=dcf"}, ) command = self.path + all_eal_param + " -- -i" - out = self.dut.send_expect(command, "testpmd> ", 15) - self.testpmd_status = "running" + out = self.dut.send_expect(command, "testpmd> ", 30) self.dut.send_expect("set portlist 1,2", "testpmd> ", 15) self.dut.send_expect("set fwd mac", "testpmd> ", 15) self.dut.send_expect("set verbose 1", "testpmd> ", 15) @@ -2472,8 +2464,7 @@ class ICEDCFSwitchFilterTest(TestCase): cores="1S/4C/1T", ports=[vf0_pci], port_options={vf0_pci: "cap=dcf"} ) command = self.path + all_eal_param + " -- -i" - out = self.dut.send_expect(command, "testpmd> ", 15) - self.testpmd_status = "running" + out = self.dut.send_expect(command, "testpmd> ", 30) # generate max_vf_number-1 rules to each vf and matched packets for i in range(1, max_vf_number): rte_flow_pattern = ( @@ -2624,8 +2615,7 @@ class ICEDCFSwitchFilterTest(TestCase): port_options={vf0_pci: "cap=dcf"}, ) command = self.path + all_eal_param + " -- -i" - out = self.dut.send_expect(command, "testpmd> ", 15) - self.testpmd_status = "running" + out = self.dut.send_expect(command, "testpmd> ", 30) self.dut.send_expect("set portlist 1,2", "testpmd> ", 15) self.dut.send_expect("set fwd rxonly", "testpmd> ", 15) self.dut.send_expect("set verbose 1", "testpmd> ", 15) @@ -2670,17 +2660,13 @@ class ICEDCFSwitchFilterTest(TestCase): """ Run after each test case. """ - if self.testpmd_status != "close": - # destroy all flow rules on DCF - self.dut.send_expect("flow flush 0", "testpmd> ", 15) - self.dut.send_expect("clear port stats all", "testpmd> ", 15) - self.dut.send_expect("quit", "#", 15) - # kill all DPDK application - self.dut.kill_all() - # destroy vfs - for port_id in self.dut_ports: - self.dut.destroy_sriov_vfs_by_port(port_id) - self.testpmd_status = "close" + # destroy all flow rules on DCF + self.dut.send_expect("quit", "# ") + # kill all DPDK application + self.dut.kill_all() + # destroy vfs + for port_id in self.dut_ports: + self.dut.destroy_sriov_vfs_by_port(port_id) if getattr(self, "session_secondary", None): self.dut.close_session(self.session_secondary)