Netdev List
 help / color / mirror / Atom feed
* [patch net-next] selftests: bpf: don't try to read files without read permission
@ 2019-10-15 10:00 Jiri Pirko
  2019-10-15 15:35 ` Jakub Kicinski
  2019-10-31 23:35 ` Jakub Kicinski
  0 siblings, 2 replies; 6+ messages in thread
From: Jiri Pirko @ 2019-10-15 10:00 UTC (permalink / raw)
  To: netdev; +Cc: davem, jakub.kicinski, shuah, ast, daniel, rong.a.chen, mlxsw

From: Jiri Pirko <jiri@mellanox.com>

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 <rong.a.chen@intel.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 tools/testing/selftests/bpf/test_offload.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/test_offload.py b/tools/testing/selftests/bpf/test_offload.py
index 15a666329a34..c44c650bde3a 100755
--- a/tools/testing/selftests/bpf/test_offload.py
+++ b/tools/testing/selftests/bpf/test_offload.py
@@ -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):
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-11-01  6:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-15 10:00 [patch net-next] selftests: bpf: don't try to read files without read permission Jiri Pirko
2019-10-15 15:35 ` Jakub Kicinski
2019-10-15 23:28   ` Alexei Starovoitov
2019-10-31 23:35 ` Jakub Kicinski
2019-10-31 23:40   ` Jakub Kicinski
2019-11-01  6:36     ` Jiri Pirko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox