提交 5bc60de5 编写于 作者: J Jiri Pirko 提交者: Alexei Starovoitov

selftests: bpf: Don't try to read files without read permission

Recently couple of files that are write only were added to netdevsim
debugfs. Don't read these files and avoid error.
Reported-by: Nkernel test robot <rong.a.chen@intel.com>
Signed-off-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
Acked-by: NJakub Kicinski <jakub.kicinski@netronome.com>
上级 95fbda1e
......@@ -312,7 +312,7 @@ class DebugfsDir:
if f == "ports":
continue
p = os.path.join(path, f)
if os.path.isfile(p):
if os.path.isfile(p) and os.access(p, os.R_OK):
_, out = cmd('cat %s/%s' % (path, f))
dfs[f] = out.strip()
elif os.path.isdir(p):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册