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 8CB0E41CA9; Thu, 16 Feb 2023 03:02:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 56F0E40A8B; Thu, 16 Feb 2023 03:02:54 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id EA66940695 for ; Thu, 16 Feb 2023 03:02:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676512973; x=1708048973; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=/AeS2/m/IVyB/32DRD/E84nCnTgl2QKVRxcBJ8eihV4=; b=dRRvcxQwZs1y42FRwPpZI7h6TgT6VUOCf2P3sFRBBvG2NNsSm7c2Ct5w 7Ulnf6pXMzpjac0amO53Y7RBcOD0OIvYRS9boiRmkooXKB54+s5xHbsSs PPm/0H0Z9JaoLCwEB4ilszYuW53LvNiB8JseRersgvU0PR276B0g75tEg Y+mTjhrdtCGaSNEabQwIsqdTMVlqH36akSlxuyaHbz542dam701U2SGqJ qjxUjlfb4UzBztliYWWdvbrP9C7lTlU5bL3I+tv6Ky2ewQLzyapq1aiZb ojawg0Hg20g7yLxWYNL9l+Nt3pGe0S4zaDqvg2br26yBPHwiAySWuGLEh g==; X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="329321955" X-IronPort-AV: E=Sophos;i="5.97,301,1669104000"; d="scan'208";a="329321955" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 18:02:52 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="812789236" X-IronPort-AV: E=Sophos;i="5.97,301,1669104000"; d="scan'208";a="812789236" Received: from unknown (HELO localhost.localdomain) ([10.239.252.96]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 18:02:50 -0800 From: Zhimin Huang To: dts@dpdk.org Cc: Zhimin Huang Subject: [dts][PATCH V2] tests/dcf_lifecycle: check the process status Date: Thu, 16 Feb 2023 10:21:32 +0000 Message-Id: <20230216102132.1200497-1-zhiminx.huang@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 when the process is not completely killed, the flow rule in dcf will take effect and cause the test to fail. so check the process status after kill DCF process. Signed-off-by: Zhimin Huang --- v2: -format the script tests/TestSuite_dcf_lifecycle.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/TestSuite_dcf_lifecycle.py b/tests/TestSuite_dcf_lifecycle.py index cd7e1824..d3758c6c 100644 --- a/tests/TestSuite_dcf_lifecycle.py +++ b/tests/TestSuite_dcf_lifecycle.py @@ -1295,13 +1295,22 @@ class TestDcfLifeCycle(TestCase): # Kill DCF process cmd = "ps aux | grep testpmd" self.d_a_con(cmd) - cmd = ( - r"kill -9 `ps -ef | grep %s | grep -v grep | grep cap=dcf | awk '{print $2}'`" + grep_key = ( + "grep %s | grep -v grep | grep cap=dcf | awk '{print $2}'" % self.vf_dcf_testpmd.split("/")[-1] ) + cmd = r"kill -9 `ps -ef | %s`" % grep_key self.d_a_con(cmd) + out = self.check_process_status(grep_key) + if out: + self.logger.warning("the process failed to kill") time.sleep(1) + def check_process_status(self, process_key): + cmd = "ps -aux | grep -v grep | {}".format(process_key) + out = self.d_a_con(cmd) + return out + def create_acl_rule_by_kernel_cmd(self, port_id=0, stats=True): # create an ACL rule on PF0 by kernel command intf = self.dut.ports_info[port_id]["port"].intf_name -- 2.25.1