From patchwork Mon Aug 1 05:27:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weiyuan Li X-Patchwork-Id: 114473 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 33E68A00C3; Mon, 1 Aug 2022 07:27:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0AAAF41101; Mon, 1 Aug 2022 07:27:36 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 614D74067B for ; Mon, 1 Aug 2022 07:27:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659331654; x=1690867654; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=xN8aaIRwuS3ncUgKf3KDyLsON/KfDMwXZbDpwQ/BC7Y=; b=c2ZKAhTQymPOmM3XRSDBQcpT6714gE017KKAW4Q8JV3Oh78GaywLSeAQ u0wSFdxgSwWeU43RRsATIPtDPRzySuR13tElzx9jQeKFyHlniXwOBsTkX zHHsXcYEumunjImlHyhxUloTSGy5Jnreki8oYj5mKxOKEnNAgCqDAx7dg mawGTCZFprAnD/ZgdbBs1IFUEaEwSYJHjPBiwIt7U9MpxlNOn/5d0qnc3 eTIsWL0u/154jFaW05/j5KI3Ne0/IHSiiiQ96XD1eNxXfeT5npuV4nNgz CifW6UgOwfhpdD4dD25GMiCt/zfT7Uze0FqiQpitA00wiSOtwju3xNnRf g==; X-IronPort-AV: E=McAfee;i="6400,9594,10425"; a="286624727" X-IronPort-AV: E=Sophos;i="5.93,206,1654585200"; d="scan'208";a="286624727" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2022 22:27:33 -0700 X-IronPort-AV: E=Sophos;i="5.93,206,1654585200"; d="scan'208";a="634770314" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2022 22:27:31 -0700 From: Weiyuan Li To: dts@dpdk.org Cc: Weiyuan Li Subject: [dts][PATCH V1] tests/port_control: optimize the test script to make run stably Date: Mon, 1 Aug 2022 13:27:34 +0800 Message-Id: <20220801052734.13946-1-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.27.0 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 The case of VF binds PF port to kernel driver, and the next test case of PF needs to be bound to the dpdk driver, but it does not test failed. So, add check whether the PF port is bound to the dpdk driver. Signed-off-by: Weiyuan Li Tested-by: Jiale Song < songx.jiale@intel.com> Acked-by: Peng, Yuan Signed-off-by: Weiyuan Li --- tests/TestSuite_port_control.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/TestSuite_port_control.py b/tests/TestSuite_port_control.py index d571b01f..7d5b2b7b 100644 --- a/tests/TestSuite_port_control.py +++ b/tests/TestSuite_port_control.py @@ -37,6 +37,7 @@ class TestPortControl(TestCase): self.socket = self.dut.get_numa_id(self.dut_ports[0]) port = self.dut.ports_info[0]["port"] self.pf_default_driver = port.get_nic_driver() + self.driver = self.get_suite_cfg()["vf_driver"] def set_up(self): """ @@ -191,6 +192,14 @@ class TestPortControl(TestCase): ) def test_pf_start_stop_reset_close(self): + # check PF whether bind to vfio-pci + res = self.dut.send_expect("usertools/dpdk-devbind.py -s", "#") + pattern = f"({self.dut.nic.pci}).*drv=vfio-pci" + regex = re.compile(pattern) + mo = regex.search(res) + if mo is None: + self.bind_nic_driver(self.dut_ports[:1], driver=self.driver) + self.start_testpmd(self.host_testpmd) # start port self.start_pmd_port(self.host_testpmd)