mirror of
https://github.com/torvalds/linux.git
synced 2026-11-25 07:52:34 +00:00
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: kernel test robot <[email protected]> Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Jakub Kicinski <[email protected]>
This commit is contained in:
committed by
Alexei Starovoitov
parent
95fbda1e37
commit
5bc60de50d
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user