Lines Matching defs:test
38 /* Expected test result */
399 static int run_test_case(int cgfd, const struct sock_test *test)
404 printf("Test case: %s .. ", test->descr);
405 progfd = load_sock_prog(test->insns, test->expected_attach_type);
407 if (test->result == LOAD_REJECT)
413 if (attach_sock_prog(cgfd, progfd, test->attach_type) == -1) {
414 if (test->result == ATTACH_REJECT)
420 if (bind_sock(test->domain, test->type, test->ip, test->port) == -1) {
424 if (test->result == BIND_REJECT && errno == EPERM)
431 if (test->result != SUCCESS)
440 bpf_prog_detach(cgfd, test->attach_type);