summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2019-10-31 23:06:58 -0400
committerDavid S. Miller <davem@davemloft.net>2019-11-01 18:16:01 -0400
commit8101e069418d136b995b3da81f1af72637082fda (patch)
treef04a90e5e3816f690ec868f392e0880dfb4a6796 /tools/testing/selftests
parentd64479a3e3f9924074ca7b50bd72fa5211dca9c1 (diff)
selftests: bpf: Skip write only files in debugfs
DebugFS for netdevsim now contains some "action trigger" files which are write only. Don't try to capture the contents of those. Note that we can't use os.access() because the script requires root. Fixes: 4418f862d675 ("netdevsim: implement support for devlink region and snapshots") Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests')
-rwxr-xr-xtools/testing/selftests/bpf/test_offload.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/test_offload.py b/tools/testing/selftests/bpf/test_offload.py
index 15a666329a34..1afa22c88e42 100755
--- a/tools/testing/selftests/bpf/test_offload.py
+++ b/tools/testing/selftests/bpf/test_offload.py
@@ -22,6 +22,7 @@ import os
22import pprint 22import pprint
23import random 23import random
24import re 24import re
25import stat
25import string 26import string
26import struct 27import struct
27import subprocess 28import subprocess
@@ -311,7 +312,11 @@ class DebugfsDir:
311 for f in out.split(): 312 for f in out.split():
312 if f == "ports": 313 if f == "ports":
313 continue 314 continue
315
314 p = os.path.join(path, f) 316 p = os.path.join(path, f)
317 if not os.stat(p).st_mode & stat.S_IRUSR:
318 continue
319
315 if os.path.isfile(p): 320 if os.path.isfile(p):
316 _, out = cmd('cat %s/%s' % (path, f)) 321 _, out = cmd('cat %s/%s' % (path, f))
317 dfs[f] = out.strip() 322 dfs[f] = out.strip()