提交 6f521a2b 编写于 作者: M Martin KaFai Lau 提交者: Alexei Starovoitov

bpf: selftest: Move sock_fields test into test_progs

This is a mechanical change to
1. move test_sock_fields.c to prog_tests/sock_fields.c
2. rename progs/test_sock_fields_kern.c to progs/test_sock_fields.c

Minimal change is made to the code itself.  Next patch will make
changes to use new ways of writing test, e.g. use skel and global
variables.
Signed-off-by: NMartin KaFai Lau <kafai@fb.com>
Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200925000427.3857814-1-kafai@fb.com
上级 5d13746d
...@@ -13,7 +13,6 @@ test_verifier_log ...@@ -13,7 +13,6 @@ test_verifier_log
feature feature
test_sock test_sock
test_sock_addr test_sock_addr
test_sock_fields
urandom_read urandom_read
test_sockmap test_sockmap
test_lirc_mode2_user test_lirc_mode2_user
......
...@@ -35,7 +35,7 @@ TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map test ...@@ -35,7 +35,7 @@ TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map test
test_verifier_log test_dev_cgroup test_tcpbpf_user \ test_verifier_log test_dev_cgroup test_tcpbpf_user \
test_sock test_sockmap get_cgroup_id_user test_socket_cookie \ test_sock test_sockmap get_cgroup_id_user test_socket_cookie \
test_cgroup_storage \ test_cgroup_storage \
test_netcnt test_tcpnotify_user test_sock_fields test_sysctl \ test_netcnt test_tcpnotify_user test_sysctl \
test_progs-no_alu32 \ test_progs-no_alu32 \
test_current_pid_tgid_new_ns test_current_pid_tgid_new_ns
......
...@@ -409,10 +409,10 @@ static void test(void) ...@@ -409,10 +409,10 @@ static void test(void)
check_result(); check_result();
} }
int main(int argc, char **argv) void test_sock_fields(void)
{ {
struct bpf_prog_load_attr attr = { struct bpf_prog_load_attr attr = {
.file = "test_sock_fields_kern.o", .file = "test_sock_fields.o",
.prog_type = BPF_PROG_TYPE_CGROUP_SKB, .prog_type = BPF_PROG_TYPE_CGROUP_SKB,
.prog_flags = BPF_F_TEST_RND_HI32, .prog_flags = BPF_F_TEST_RND_HI32,
}; };
...@@ -477,6 +477,4 @@ int main(int argc, char **argv) ...@@ -477,6 +477,4 @@ int main(int argc, char **argv)
cleanup_cgroup_environment(); cleanup_cgroup_environment();
printf("PASS\n"); printf("PASS\n");
return 0;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册