Skip to content

Commit 579345e

Browse files
anakryikoborkmann
authored andcommitted
selftests/bpf: Rename reference_tracking BPF programs
BPF programs for reference_tracking selftest use "fail_" prefix to notify that they are expected to fail. This is really confusing and inconvenient when trying to grep through test_progs output to find *actually* failed tests. So rename the prefix from "fail_" to "err_". Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 277b134 commit 579345e

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

tools/testing/selftests/bpf/prog_tests/reference_tracking.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ void test_reference_tracking(void)
3434
if (!test__start_subtest(title))
3535
continue;
3636

37-
/* Expect verifier failure if test name has 'fail' */
38-
if (strstr(title, "fail") != NULL) {
37+
/* Expect verifier failure if test name has 'err' */
38+
if (strstr(title, "err_") != NULL) {
3939
libbpf_print_fn_t old_print_fn;
4040

4141
old_print_fn = libbpf_set_print(NULL);

tools/testing/selftests/bpf/progs/test_sk_lookup_kern.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ int bpf_sk_lookup_test1(struct __sk_buff *skb)
9191
return 0;
9292
}
9393

94-
SEC("classifier/fail_use_after_free")
94+
SEC("classifier/err_use_after_free")
9595
int bpf_sk_lookup_uaf(struct __sk_buff *skb)
9696
{
9797
struct bpf_sock_tuple tuple = {};
@@ -106,7 +106,7 @@ int bpf_sk_lookup_uaf(struct __sk_buff *skb)
106106
return family;
107107
}
108108

109-
SEC("classifier/fail_modify_sk_pointer")
109+
SEC("classifier/err_modify_sk_pointer")
110110
int bpf_sk_lookup_modptr(struct __sk_buff *skb)
111111
{
112112
struct bpf_sock_tuple tuple = {};
@@ -121,7 +121,7 @@ int bpf_sk_lookup_modptr(struct __sk_buff *skb)
121121
return 0;
122122
}
123123

124-
SEC("classifier/fail_modify_sk_or_null_pointer")
124+
SEC("classifier/err_modify_sk_or_null_pointer")
125125
int bpf_sk_lookup_modptr_or_null(struct __sk_buff *skb)
126126
{
127127
struct bpf_sock_tuple tuple = {};
@@ -135,7 +135,7 @@ int bpf_sk_lookup_modptr_or_null(struct __sk_buff *skb)
135135
return 0;
136136
}
137137

138-
SEC("classifier/fail_no_release")
138+
SEC("classifier/err_no_release")
139139
int bpf_sk_lookup_test2(struct __sk_buff *skb)
140140
{
141141
struct bpf_sock_tuple tuple = {};
@@ -144,7 +144,7 @@ int bpf_sk_lookup_test2(struct __sk_buff *skb)
144144
return 0;
145145
}
146146

147-
SEC("classifier/fail_release_twice")
147+
SEC("classifier/err_release_twice")
148148
int bpf_sk_lookup_test3(struct __sk_buff *skb)
149149
{
150150
struct bpf_sock_tuple tuple = {};
@@ -156,7 +156,7 @@ int bpf_sk_lookup_test3(struct __sk_buff *skb)
156156
return 0;
157157
}
158158

159-
SEC("classifier/fail_release_unchecked")
159+
SEC("classifier/err_release_unchecked")
160160
int bpf_sk_lookup_test4(struct __sk_buff *skb)
161161
{
162162
struct bpf_sock_tuple tuple = {};
@@ -173,7 +173,7 @@ void lookup_no_release(struct __sk_buff *skb)
173173
bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0);
174174
}
175175

176-
SEC("classifier/fail_no_release_subcall")
176+
SEC("classifier/err_no_release_subcall")
177177
int bpf_sk_lookup_test5(struct __sk_buff *skb)
178178
{
179179
lookup_no_release(skb);

0 commit comments

Comments
 (0)