提交 8101e069 编写于 作者: J Jakub Kicinski 提交者: David S. Miller

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: 4418f862 ("netdevsim: implement support for devlink region and snapshots")
Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d64479a3
...@@ -22,6 +22,7 @@ import os ...@@ -22,6 +22,7 @@ import os
import pprint import pprint
import random import random
import re import re
import stat
import string import string
import struct import struct
import subprocess import subprocess
...@@ -311,7 +312,11 @@ class DebugfsDir: ...@@ -311,7 +312,11 @@ class DebugfsDir:
for f in out.split(): for f in out.split():
if f == "ports": if f == "ports":
continue continue
p = os.path.join(path, f) p = os.path.join(path, f)
if not os.stat(p).st_mode & stat.S_IRUSR:
continue
if os.path.isfile(p): if os.path.isfile(p):
_, out = cmd('cat %s/%s' % (path, f)) _, out = cmd('cat %s/%s' % (path, f))
dfs[f] = out.strip() dfs[f] = out.strip()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册