Lines Matching defs:test

21 /* General test specific settings */
28 /* Few constants used to init test 'skb' */
51 /* Flags that can be passed to test cases */
80 } test[MAX_SUBTESTS];
88 /* Large test cases need separate allocation and fill handler. */
647 * When debugging a JIT that fails this test, one
907 /* Number of test runs for a pattern test */
913 * test is designed to verify e.g. the ALU and ALU64 operations for JITs that
2133 * both for positive and negative values. The test is designed to verify
2269 * test is designed to verify e.g. the JMP and JMP32 operations for JITs that
2702 int size = self->test[0].result - 1;
3520 "JGE (jt 0), test 1",
3533 "JGE (jt 0), test 2",
3772 /* Have to test all register combinations, since
10126 "JMP_JGE_X: ldimm64 test 1",
10141 "JMP_JGE_X: ldimm64 test 2",
10155 "JMP_JGE_X: ldimm64 test 3",
10170 "JMP_JLE_X: ldimm64 test 1",
10185 "JMP_JLE_X: ldimm64 test 2",
10199 "JMP_JLE_X: ldimm64 test 3",
10345 "BPF_MAXINSNS: Jump heavy test",
11138 "LDX_MSH standalone, test result 1",
11150 "LDX_MSH standalone, test result 2",
11387 "JNE signed compare, test 1",
11403 "JNE signed compare, test 2",
11419 "JNE signed compare, test 3",
11436 "JNE signed compare, test 4",
11449 "JNE signed compare, test 5",
11462 "JNE signed compare, test 6",
11475 "JNE signed compare, test 7",
12275 /* Exhaustive test of ALU64 shift operations */
12324 /* Exhaustive test of ALU32 shift operations */
12374 * Exhaustive test of ALU64 shift operations when
12402 * Exhaustive test of ALU32 shift operations when
14341 /* Initialize a fake skb with test pattern. */
14359 static void *generate_test_data(struct bpf_test *test, int sub)
14364 if (test->aux & FLAG_NO_DATA)
14367 if (test->aux & FLAG_LARGE_MEM)
14368 return kmalloc(test->test[sub].data_size, GFP_KERNEL);
14374 skb = populate_skb(test->data, test->test[sub].data_size);
14378 if (test->aux & FLAG_SKB_FRAG) {
14380 * when the test requires a fragmented skb, add a
14382 * test->frag_data.
14388 memcpy(page_address(page), test->frag_data, MAX_DATA);
14398 static void release_test_data(const struct bpf_test *test, void *data)
14400 if (test->aux & FLAG_NO_DATA)
14403 if (test->aux & FLAG_LARGE_MEM)
14455 /* Verifier didn't reject the test that's
14535 static int run_one(const struct bpf_prog *fp, struct bpf_test *test)
14539 if (test->nr_testruns)
14540 runs = min(test->nr_testruns, MAX_TESTRUNS);
14550 * the sub-test array. The first test is always run,
14554 test->test[i].data_size == 0 &&
14555 test->test[i].result == 0)
14558 data = generate_test_data(test, i);
14559 if (!data && !(test->aux & FLAG_NO_DATA)) {
14565 release_test_data(test, data);
14567 if (ret == test->test[i].result) {
14570 s32 res = test->test[i].result;
14733 static __init int test_skb_segment_single(const struct skb_segment_test *test)
14738 skb = test->build_skb();
14744 segs = skb_segment(skb, test->features);
14759 const struct skb_segment_test *test = &skb_segment_tests[i];
14765 pr_info("#%d %s ", i, test->descr);
14767 if (test_skb_segment_single(test)) {
14850 /* Flags that can be passed to tail call test cases */
14855 * Magic marker used in test snippets for tail calls below.
14857 * with the proper values by the test runner.
14874 * A test function to be called from a BPF program, clobbering a lot of
14898 * Tail call tests. Each test case may call any other test in the table,
14900 * test. The index TAIL_CALL_NULL can be used to specify a NULL target
14901 * function to test the JIT error path. Similarly, the index TAIL_CALL_INVALID
15057 struct tail_call_test *test = &tail_call_tests[which];
15063 struct bpf_insn *insn = &test->insns[len];
15079 fp->aux->stack_depth = test->stack_depth;
15080 memcpy(fp->insnsi, test->insns, len * sizeof(struct bpf_insn));
15167 struct tail_call_test *test = &tail_call_tests[i];
15178 pr_info("#%d %s ", i, test->descr);
15189 if (test->flags & FLAG_NEED_STATE)
15192 if (test->flags & FLAG_RESULT_IN_STATE)
15194 if (ret == test->result) {
15198 pr_cont("ret %d != %d FAIL", ret, test->result);
15256 * cover only that test.
15269 * test_range to cover only that test.
15274 pr_err("test_bpf: no test named '%s' found for '%s' suite.\n",
15314 * is specified, set 'test_bpf' as the default test suite.