From patchwork Thu Aug 13 19:09:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mei, JianweiX" X-Patchwork-Id: 75490 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4D946A04B0; Thu, 13 Aug 2020 12:45:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 30F371C022; Thu, 13 Aug 2020 12:45:48 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id E55131C021 for ; Thu, 13 Aug 2020 12:45:45 +0200 (CEST) IronPort-SDR: 8fhWNCgUEQyr2HKx8eCVo8Tx32CksadpIzxoyJbRAvG6BgtEF8qsruaZqaVBFuEpUrls/umVXw A2ZxHvZwc12Q== X-IronPort-AV: E=McAfee;i="6000,8403,9711"; a="141823712" X-IronPort-AV: E=Sophos;i="5.76,308,1592895600"; d="scan'208";a="141823712" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Aug 2020 03:45:44 -0700 IronPort-SDR: 3WK3dyA71ruXkLSIjzoltw5yWyVkzFR8wcz32FxHaIw/vlushgmBRcLqjBspfxoBOwzFqj0N06 JbRMH8EOamVw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,308,1592895600"; d="scan'208";a="309028025" Received: from unknown (HELO localhost.localdomain) ([10.240.183.106]) by orsmga002.jf.intel.com with ESMTP; 13 Aug 2020 03:45:43 -0700 From: Jianwei Mei To: dts@dpdk.org Cc: Jianwei Mei Date: Thu, 13 Aug 2020 19:09:05 +0000 Message-Id: <20200813190905.16768-1-jianweix.mei@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V1] framework/crb: modify code logic X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "dts" Code 'os.path.isfile()' only be executed locally(tester side), lead to recovery ENV fail. The code logic is to judge files on DUT, so change it as below. Signed-off-by: Jianwei Mei --- framework/crb.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/crb.py b/framework/crb.py index d456fab..cd29b8e 100644 --- a/framework/crb.py +++ b/framework/crb.py @@ -500,7 +500,8 @@ class Crb(object): pid_reg = r'p(\d+)' for config_file in file_directorys: # Covers case where the process is run as a unprivileged user and does not generate the file - if os.path.isfile(config_file): + isfile = self.send_expect('ls -l {}'.format(config_file), "# ", 20, alt_session) + if isfile: cmd = 'lsof -Fp %s' % config_file out = self.send_expect(cmd, "# ", 20, alt_session) if len(out): @@ -516,7 +517,8 @@ class Crb(object): hugepage_info = ['/var/run/dpdk/%s/hugepage_info' % file_prefix for file_prefix in prefix_list] for hugepage in hugepage_info: # Covers case where the process is run as a unprivileged user and does not generate the file - if os.path.isfile(hugepage): + isfile = self.send_expect('ls -l {}'.format(hugepage), "# ", 20, alt_session) + if isfile: cmd = 'lsof -Fp %s' % hugepage out = self.send_expect(cmd, "# ", 20, alt_session) if len(out) and "No such file or directory" not in out: