test suite reviews and discussions
 help / color / mirror / Atom feed
From: Jianwei Mei <jianweix.mei@intel.com>
To: dts@dpdk.org
Cc: Jianwei Mei <jianweix.mei@intel.com>
Subject: [dts] [PATCH V1] framework/crb: modify code logic
Date: Thu, 13 Aug 2020 19:09:05 +0000	[thread overview]
Message-ID: <20200813190905.16768-1-jianweix.mei@intel.com> (raw)

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 <jianweix.mei@intel.com>
---
 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:
-- 
2.17.1


             reply	other threads:[~2020-08-13 10:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-13 19:09 Jianwei Mei [this message]
2020-08-21  2:59 ` Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200813190905.16768-1-jianweix.mei@intel.com \
    --to=jianweix.mei@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).