1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (c) 2021 Hengqi Chen */
4 #include <test_progs.h>
5 #include "test_prog_array_init.skel.h"
7 void test_prog_array_init(void)
9 struct test_prog_array_init *skel;
12 skel = test_prog_array_init__open();
13 if (!ASSERT_OK_PTR(skel, "could not open BPF object"))
16 skel->rodata->my_pid = getpid();
18 err = test_prog_array_init__load(skel);
19 if (!ASSERT_OK(err, "could not load BPF object"))
22 skel->links.entry = bpf_program__attach_raw_tracepoint(skel->progs.entry, "sys_enter");
23 if (!ASSERT_OK_PTR(skel->links.entry, "could not attach BPF program"))
28 ASSERT_EQ(skel->bss->value, 42, "unexpected value");
31 test_prog_array_init__destroy(skel);