]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
selftests/bpf: Add selftest for calling global functions from freplace
[mirror_ubuntu-jammy-kernel.git] / tools / testing / selftests / bpf / prog_tests / fexit_bpf2bpf.c
index 73b4c76e6b869b09577043dfee0cc915ab89f6d3..52f1426ae06e025930eeaf09ec86ba86b84e7c81 100644 (file)
@@ -371,6 +371,18 @@ static void test_func_map_prog_compatibility(void)
                                     "./test_attach_probe.o");
 }
 
+static void test_func_replace_global_func(void)
+{
+       const char *prog_name[] = {
+               "freplace/test_pkt_access",
+       };
+
+       test_fexit_bpf2bpf_common("./freplace_global_func.o",
+                                 "./test_pkt_access.o",
+                                 ARRAY_SIZE(prog_name),
+                                 prog_name, false, NULL);
+}
+
 void test_fexit_bpf2bpf(void)
 {
        if (test__start_subtest("target_no_callees"))
@@ -391,4 +403,6 @@ void test_fexit_bpf2bpf(void)
                test_func_replace_multi();
        if (test__start_subtest("fmod_ret_freplace"))
                test_fmod_ret_freplace();
+       if (test__start_subtest("func_replace_global_func"))
+               test_func_replace_global_func();
 }