Skip to content

Commit

Permalink
selftests: bpf: Skip write only files in debugfs
Browse files Browse the repository at this point in the history
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: 4418f86 ("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>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed Nov 1, 2019
1 parent d64479a commit 8101e06
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/testing/selftests/bpf/test_offload.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import pprint
import random
import re
import stat
import string
import struct
import subprocess
Expand Down Expand Up @@ -311,7 +312,11 @@ def _debugfs_dir_read(self, path):
for f in out.split():
if f == "ports":
continue

p = os.path.join(path, f)
if not os.stat(p).st_mode & stat.S_IRUSR:
continue

if os.path.isfile(p):
_, out = cmd('cat %s/%s' % (path, f))
dfs[f] = out.strip()
Expand Down

0 comments on commit 8101e06

Please sign in to comment.