* [dts] [PATCH V1] framework/crb: modify code logic
@ 2020-08-13 19:09 Jianwei Mei
2020-08-21 2:59 ` Tu, Lijuan
0 siblings, 1 reply; 2+ messages in thread
From: Jianwei Mei @ 2020-08-13 19:09 UTC (permalink / raw)
To: dts; +Cc: Jianwei Mei
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dts] [PATCH V1] framework/crb: modify code logic
2020-08-13 19:09 [dts] [PATCH V1] framework/crb: modify code logic Jianwei Mei
@ 2020-08-21 2:59 ` Tu, Lijuan
0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2020-08-21 2:59 UTC (permalink / raw)
To: Mei, JianweiX, dts; +Cc: Mei, JianweiX
> 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>
Applied
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-21 2:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-13 19:09 [dts] [PATCH V1] framework/crb: modify code logic Jianwei Mei
2020-08-21 2:59 ` Tu, Lijuan
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).