Skip to content

Commit f14a20a

Browse files
committed
btf_unit_test: Prepare partition of tests
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
1 parent 8b2494f commit f14a20a

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

AF_XDP-interaction/btf_unit_test.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ int init_btf_info_via_bpf_object(struct bpf_object *bpf_obj)
9898
xdp_hints_rx_time.btf_type_id = xsk_btf__btf_type_id(xbi);
9999
xdp_hints_rx_time.xbi = xbi;
100100
}
101-
// xsk_btf__free_xdp_hint(xbi);
101+
/* Remember to cleanup later: xsk_btf__free_xdp_hint(xbi); */
102102

103103
xbi = setup_btf_info(btf, "xdp_hints_mark");
104104
if (xbi) {
@@ -111,9 +111,7 @@ int init_btf_info_via_bpf_object(struct bpf_object *bpf_obj)
111111
return 0;
112112
}
113113

114-
115-
116-
int main(int argc, char **argv)
114+
int test01_normal()
117115
{
118116
struct bpf_object *bpf_obj;
119117
int err = 0;
@@ -133,6 +131,18 @@ int main(int argc, char **argv)
133131
xsk_btf__free_xdp_hint(xdp_hints_mark.xbi);
134132
bpf_object__close(bpf_obj);
135133

134+
return EXIT_OK;
135+
}
136+
137+
int main(int argc, char **argv)
138+
{
139+
struct bpf_object *bpf_obj;
140+
int err;
141+
142+
err = test01_normal();
143+
if (err != EXIT_OK)
144+
return err;
145+
136146
bpf_obj = load_bpf_object("btf_unit_test_bpf.o");
137147
if (!bpf_obj)
138148
return EXIT_FAIL_BPF;

0 commit comments

Comments
 (0)