Commit b23b385f authored by Jiri Olsa's avatar Jiri Olsa Committed by Alexei Starovoitov

selftests/bpf: Load bpf_testmod for verifier test

Loading bpf_testmod kernel module for verifier test. We will
move all the tests kfuncs into bpf_testmod in following change.
Acked-by: default avatarDavid Vernet <void@manifault.com>
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20230515133756.1658301-8-jolsa@kernel.orgSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 11642eb9
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "bpf_util.h" #include "bpf_util.h"
#include "test_btf.h" #include "test_btf.h"
#include "../../../include/linux/filter.h" #include "../../../include/linux/filter.h"
#include "testing_helpers.h"
#ifndef ENOTSUPP #ifndef ENOTSUPP
#define ENOTSUPP 524 #define ENOTSUPP 524
...@@ -1684,6 +1685,12 @@ static int do_test(bool unpriv, unsigned int from, unsigned int to) ...@@ -1684,6 +1685,12 @@ static int do_test(bool unpriv, unsigned int from, unsigned int to)
{ {
int i, passes = 0, errors = 0; int i, passes = 0, errors = 0;
/* ensure previous instance of the module is unloaded */
unload_bpf_testmod(verbose);
if (load_bpf_testmod(verbose))
return EXIT_FAILURE;
for (i = from; i < to; i++) { for (i = from; i < to; i++) {
struct bpf_test *test = &tests[i]; struct bpf_test *test = &tests[i];
...@@ -1711,6 +1718,8 @@ static int do_test(bool unpriv, unsigned int from, unsigned int to) ...@@ -1711,6 +1718,8 @@ static int do_test(bool unpriv, unsigned int from, unsigned int to)
} }
} }
unload_bpf_testmod(verbose);
printf("Summary: %d PASSED, %d SKIPPED, %d FAILED\n", passes, printf("Summary: %d PASSED, %d SKIPPED, %d FAILED\n", passes,
skips, errors); skips, errors);
return errors ? EXIT_FAILURE : EXIT_SUCCESS; return errors ? EXIT_FAILURE : EXIT_SUCCESS;
......
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