Commit 4bbca662 authored by Hangbin Liu's avatar Hangbin Liu Committed by David S. Miller

selftests/bpf: fix netdevsim trap_flow_action_cookie read

When read netdevsim trap_flow_action_cookie, we need to init it first,
or we will get "Invalid argument" error.

Fixes: d3cbb907 ("netdevsim: add ACL trap reporting cookie as a metadata")
Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8c0de6e9
......@@ -318,6 +318,9 @@ class DebugfsDir:
continue
if os.path.isfile(p):
# We need to init trap_flow_action_cookie before read it
if f == "trap_flow_action_cookie":
cmd('echo deadbeef > %s/%s' % (path, f))
_, out = cmd('cat %s/%s' % (path, f))
dfs[f] = out.strip()
elif os.path.isdir(p):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment