Skip to content

Commit 5bc60de

Browse files
jpirkoAlexei Starovoitov
authored andcommitted
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]>
1 parent 95fbda1 commit 5bc60de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/bpf/test_offload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def _debugfs_dir_read(self, path):
312312
if f == "ports":
313313
continue
314314
p = os.path.join(path, f)
315-
if os.path.isfile(p):
315+
if os.path.isfile(p) and os.access(p, os.R_OK):
316316
_, out = cmd('cat %s/%s' % (path, f))
317317
dfs[f] = out.strip()
318318
elif os.path.isdir(p):

0 commit comments

Comments
 (0)