Skip to content

Commit

Permalink
samples/bpf: test both pre-alloc and normal maps
Browse files Browse the repository at this point in the history
extend test coveraged to include pre-allocated and run-time alloc maps

Signed-off-by: Alexei Starovoitov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
4ast authored and davem330 committed Mar 8, 2016
1 parent 89b9760 commit c3f85cf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion samples/bpf/test_maps.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ static void test_map_parallel(void)
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_percpu_hashmap_sanity(0, NULL);
Expand All @@ -479,6 +479,14 @@ int main(void)
test_map_large();
test_map_parallel();
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");
return 0;
}

0 comments on commit c3f85cf

Please sign in to comment.