| 1 | |
| 2 |
|
| 3 | #include <test_progs.h>
|
| 4 | #include "kfunc_call_test.skel.h"
|
| 5 | #include "kfunc_call_test.lskel.h"
|
| 6 | #include "test_kernel_flag.skel.h"
|
| 7 |
|
| 8 | void test_kernel_flag(void)
|
| 9 | {
|
| 10 | struct test_kernel_flag *lsm_skel;
|
| 11 | struct kfunc_call_test *skel = NULL;
|
| 12 | struct kfunc_call_test_lskel *lskel = NULL;
|
| 13 | int ret;
|
| 14 |
|
| 15 | lsm_skel = test_kernel_flag__open_and_load();
|
| 16 | if (!ASSERT_OK_PTR(lsm_skel, "lsm_skel"))
|
| 17 | return;
|
| 18 |
|
| 19 | lsm_skel->bss->monitored_tid = sys_gettid();
|
| 20 |
|
| 21 | ret = test_kernel_flag__attach(lsm_skel);
|
| 22 | if (!ASSERT_OK(ret, "test_kernel_flag__attach"))
|
| 23 | goto close_prog;
|
| 24 |
|
| 25 |
|
| 26 | skel = kfunc_call_test__open_and_load();
|
| 27 | if (!ASSERT_OK_PTR(skel, "skel"))
|
| 28 | goto close_prog;
|
| 29 |
|
| 30 |
|
| 31 | lskel = kfunc_call_test_lskel__open_and_load();
|
| 32 | if (!ASSERT_ERR_PTR(lskel, "lskel"))
|
| 33 | goto close_prog;
|
| 34 |
|
| 35 | close_prog:
|
| 36 | if (skel)
|
| 37 | kfunc_call_test__destroy(skel);
|
| 38 | if (lskel)
|
| 39 | kfunc_call_test_lskel__destroy(lskel);
|
| 40 |
|
| 41 | lsm_skel->bss->monitored_tid = 0;
|
| 42 | test_kernel_flag__destroy(lsm_skel);
|
| 43 | }
|