0001
0002 #include <test_progs.h>
0003 #include <network_helpers.h>
0004
0005 void test_pkt_md_access(void)
0006 {
0007 const char *file = "./test_pkt_md_access.o";
0008 struct bpf_object *obj;
0009 int err, prog_fd;
0010 LIBBPF_OPTS(bpf_test_run_opts, topts,
0011 .data_in = &pkt_v4,
0012 .data_size_in = sizeof(pkt_v4),
0013 .repeat = 10,
0014 );
0015
0016 err = bpf_prog_test_load(file, BPF_PROG_TYPE_SCHED_CLS, &obj, &prog_fd);
0017 if (CHECK_FAIL(err))
0018 return;
0019
0020 err = bpf_prog_test_run_opts(prog_fd, &topts);
0021 ASSERT_OK(err, "test_run_opts err");
0022 ASSERT_OK(topts.retval, "test_run_opts retval");
0023
0024 bpf_object__close(obj);
0025 }