Skip to content

Commit f735b64

Browse files
borkmanndavem330
authored andcommitted
bpf, tests: set rlimit also for test_align, so it doesn't fail
When running all the tests, through 'make run_tests', I had test_align failing due to insufficient rlimit. Set it the same way as all other test cases from BPF selftests do, so that test case properly loads everything. [...] Summary: 7 PASSED, 1 FAILED selftests: test_progs [PASS] /home/foo/net-next/tools/testing/selftests/bpf Test 0: mov ... Failed to load program. FAIL Test 1: shift ... Failed to load program. FAIL Test 2: addsub ... Failed to load program. FAIL Test 3: mul ... Failed to load program. FAIL Test 4: unknown shift ... Failed to load program. FAIL Test 5: unknown mul ... Failed to load program. FAIL Test 6: packet const offset ... Failed to load program. FAIL Test 7: packet variable offset ... Failed to load program. FAIL Results: 0 pass 8 fail selftests: test_align [PASS] [...] Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5ecf51f commit f735b64

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/testing/selftests/bpf/test_align.c

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include <stddef.h>
1010
#include <stdbool.h>
1111

12+
#include <sys/resource.h>
13+
1214
#include <linux/unistd.h>
1315
#include <linux/filter.h>
1416
#include <linux/bpf_perf_event.h>
@@ -432,6 +434,9 @@ static int do_test(unsigned int from, unsigned int to)
432434
int main(int argc, char **argv)
433435
{
434436
unsigned int from = 0, to = ARRAY_SIZE(tests);
437+
struct rlimit rinf = { RLIM_INFINITY, RLIM_INFINITY };
438+
439+
setrlimit(RLIMIT_MEMLOCK, &rinf);
435440

436441
if (argc == 3) {
437442
unsigned int l = atoi(argv[argc - 2]);

0 commit comments

Comments
 (0)