Skip to content

Commit

Permalink
selftests/bpf: Print unexpected output on fail
Browse files Browse the repository at this point in the history
This makes it easier to debug off-hand when the error message isn't
exactly as expected.

Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
Joe Stringer authored and Daniel Borkmann committed Feb 15, 2018
1 parent 615a947 commit 95f87a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/testing/selftests/bpf/test_verifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -11291,7 +11291,8 @@ static void do_test_single(struct bpf_test *test, bool unpriv,
goto fail_log;
}
if (!strstr(bpf_vlog, expected_err) && !reject_from_alignment) {
printf("FAIL\nUnexpected error message!\n");
printf("FAIL\nUnexpected error message!\n\tEXP: %s\n\tRES: %s\n",
expected_err, bpf_vlog);
goto fail_log;
}
}
Expand Down

0 comments on commit 95f87a9

Please sign in to comment.