Skip to content

Commit

Permalink
selftests: bpf: Don't try to read files without read permission
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jpirko authored and Alexei Starovoitov committed Oct 15, 2019
1 parent 95fbda1 commit 5bc60de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/bpf/test_offload.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def _debugfs_dir_read(self, path):
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):
Expand Down

0 comments on commit 5bc60de

Please sign in to comment.