Commit c3f85cff authored by Alexei Starovoitov's avatar Alexei Starovoitov Committed by David S. Miller

samples/bpf: test both pre-alloc and normal maps

extend test coveraged to include pre-allocated and run-time alloc maps
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 89b97607
...@@ -468,7 +468,7 @@ static void test_map_parallel(void) ...@@ -468,7 +468,7 @@ static void test_map_parallel(void)
assert(bpf_get_next_key(map_fd, &key, &key) == -1 && errno == ENOENT); assert(bpf_get_next_key(map_fd, &key, &key) == -1 && errno == ENOENT);
} }
int main(void) static void run_all_tests(void)
{ {
test_hashmap_sanity(0, NULL); test_hashmap_sanity(0, NULL);
test_percpu_hashmap_sanity(0, NULL); test_percpu_hashmap_sanity(0, NULL);
...@@ -479,6 +479,14 @@ int main(void) ...@@ -479,6 +479,14 @@ int main(void)
test_map_large(); test_map_large();
test_map_parallel(); test_map_parallel();
test_map_stress(); test_map_stress();
}
int main(void)
{
map_flags = 0;
run_all_tests();
map_flags = BPF_F_NO_PREALLOC;
run_all_tests();
printf("test_maps: OK\n"); printf("test_maps: OK\n");
return 0; return 0;
} }
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