Skip to content

Commit

Permalink
selftests/bpf: fix the expected messages
Browse files Browse the repository at this point in the history
Recent changes added extack to program replacement path,
expect extack instead of generic messages.

Fixes: 01dde20 ("xdp: Provide extack messages when prog attachment failed")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
Jakub Kicinski authored and Daniel Borkmann committed Feb 6, 2019
1 parent f7748e2 commit 52158f0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tools/testing/selftests/bpf/test_offload.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,9 @@ def test_spurios_extack(sim, obj, skip_hw, needle):
ret, _, err = sim.set_xdp(obj, "generic", force=True,
fail=False, include_stderr=True)
fail(ret == 0, "Replaced XDP program with a program in different mode")
fail(err.count("File exists") != 1, "Replaced driver XDP with generic")
check_extack(err,
"native and generic XDP can't be active at the same time.",
args)
ret, _, err = sim.set_xdp(obj, "", force=True,
fail=False, include_stderr=True)
fail(ret == 0, "Replaced XDP program with a program in different mode")
Expand Down Expand Up @@ -957,7 +959,8 @@ def test_spurios_extack(sim, obj, skip_hw, needle):

start_test("Test multi-attachment XDP - replace...")
ret, _, err = sim.set_xdp(obj, "offload", fail=False, include_stderr=True)
fail(err.count("busy") != 1, "Replaced one of programs without -force")
fail(ret == 0, "Replaced one of programs without -force")
check_extack(err, "XDP program already attached.", args)

start_test("Test multi-attachment XDP - detach...")
ret, _, err = sim.unset_xdp("drv", force=True,
Expand Down

0 comments on commit 52158f0

Please sign in to comment.