Skip to content

Commit f963728

Browse files
rgo3lmb
authored andcommitted
features: add missing HaveProgramHelper test cases
Add the missing test cases now that CI and the library support these helpers. Unfortunately the diff of this commit will touch all program/helper test cases because of go formatting, while it only adds the four cases that were pointed out in the removed comment. Signed-off-by: Robin Gögge <[email protected]>
1 parent 624a8b7 commit f963728

File tree

1 file changed

+22
-24
lines changed

1 file changed

+22
-24
lines changed

features/prog_test.go

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,31 +40,29 @@ func TestHaveProgramHelper(t *testing.T) {
4040
// Referencing linux kernel commits to track the kernel version required to pass these test cases.
4141
// They cases are derived from libbpf's selftests and helper/prog combinations that are
4242
// probed for in cilium/cilium.
43-
// Still missing since those helpers are not available in the lib yet, are:
44-
// - Kprobe, GetBranchSnapshot
45-
// - SchedCLS, SkbSetTstamp
46-
// These two test cases depend on CI kernels supporting those:
47-
// {ebpf.Kprobe, asm.FnKtimeGetCoarseNs, ebpf.ErrNotSupported, "5.16"}, // 5e0bc3082e2e
48-
// {ebpf.CGroupSockAddr, asm.FnGetCgroupClassid, nil, "5.10"}, // b426ce83baa7
4943
testCases := []testCase{
50-
{ebpf.Kprobe, asm.FnMapLookupElem, nil, "3.19"}, // d0003ec01c66
51-
{ebpf.SocketFilter, asm.FnKtimeGetCoarseNs, nil, "5.11"}, // d05512618056
52-
{ebpf.SchedCLS, asm.FnSkbVlanPush, nil, "4.3"}, // 4e10df9a60d9
53-
{ebpf.Kprobe, asm.FnSkbVlanPush, ebpf.ErrNotSupported, "4.3"}, // 4e10df9a60d9
54-
{ebpf.Kprobe, asm.FnSysBpf, ebpf.ErrNotSupported, "5.14"}, // 79a7f8bdb159
55-
{ebpf.Syscall, asm.FnSysBpf, nil, "5.14"}, // 79a7f8bdb159
56-
{ebpf.XDP, asm.FnJiffies64, nil, "5.5"}, // 5576b991e9c1
57-
{ebpf.XDP, asm.FnKtimeGetBootNs, nil, "5.7"}, // 71d19214776e
58-
{ebpf.SchedCLS, asm.FnSkbChangeHead, nil, "5.8"}, // 6f3f65d80dac
59-
{ebpf.SchedCLS, asm.FnRedirectNeigh, nil, "5.10"}, // b4ab31414970
60-
{ebpf.SchedCLS, asm.FnSkbEcnSetCe, nil, "5.1"}, // f7c917ba11a6
61-
{ebpf.SchedACT, asm.FnSkAssign, nil, "5.6"}, // cf7fbe660f2d
62-
{ebpf.SchedACT, asm.FnFibLookup, nil, "4.18"}, // 87f5fc7e48dd
63-
{ebpf.Kprobe, asm.FnFibLookup, ebpf.ErrNotSupported, "4.18"}, // 87f5fc7e48dd
64-
{ebpf.CGroupSockAddr, asm.FnGetsockopt, nil, "5.8"}, // beecf11bc218
65-
{ebpf.CGroupSockAddr, asm.FnSkLookupTcp, nil, "4.20"}, // 6acc9b432e67
66-
{ebpf.CGroupSockAddr, asm.FnGetNetnsCookie, nil, "5.7"}, // f318903c0bf4
67-
{ebpf.CGroupSock, asm.FnGetNetnsCookie, nil, "5.7"}, // f318903c0bf4
44+
{ebpf.Kprobe, asm.FnMapLookupElem, nil, "3.19"}, // d0003ec01c66
45+
{ebpf.SocketFilter, asm.FnKtimeGetCoarseNs, nil, "5.11"}, // d05512618056
46+
{ebpf.SchedCLS, asm.FnSkbVlanPush, nil, "4.3"}, // 4e10df9a60d9
47+
{ebpf.Kprobe, asm.FnSkbVlanPush, ebpf.ErrNotSupported, "4.3"}, // 4e10df9a60d9
48+
{ebpf.Kprobe, asm.FnSysBpf, ebpf.ErrNotSupported, "5.14"}, // 79a7f8bdb159
49+
{ebpf.Syscall, asm.FnSysBpf, nil, "5.14"}, // 79a7f8bdb159
50+
{ebpf.XDP, asm.FnJiffies64, nil, "5.5"}, // 5576b991e9c1
51+
{ebpf.XDP, asm.FnKtimeGetBootNs, nil, "5.7"}, // 71d19214776e
52+
{ebpf.SchedCLS, asm.FnSkbChangeHead, nil, "5.8"}, // 6f3f65d80dac
53+
{ebpf.SchedCLS, asm.FnRedirectNeigh, nil, "5.10"}, // b4ab31414970
54+
{ebpf.SchedCLS, asm.FnSkbEcnSetCe, nil, "5.1"}, // f7c917ba11a6
55+
{ebpf.SchedACT, asm.FnSkAssign, nil, "5.6"}, // cf7fbe660f2d
56+
{ebpf.SchedACT, asm.FnFibLookup, nil, "4.18"}, // 87f5fc7e48dd
57+
{ebpf.Kprobe, asm.FnFibLookup, ebpf.ErrNotSupported, "4.18"}, // 87f5fc7e48dd
58+
{ebpf.CGroupSockAddr, asm.FnGetsockopt, nil, "5.8"}, // beecf11bc218
59+
{ebpf.CGroupSockAddr, asm.FnSkLookupTcp, nil, "4.20"}, // 6acc9b432e67
60+
{ebpf.CGroupSockAddr, asm.FnGetNetnsCookie, nil, "5.7"}, // f318903c0bf4
61+
{ebpf.CGroupSock, asm.FnGetNetnsCookie, nil, "5.7"}, // f318903c0bf4
62+
{ebpf.Kprobe, asm.FnKtimeGetCoarseNs, ebpf.ErrNotSupported, "5.16"}, // 5e0bc3082e2e
63+
{ebpf.CGroupSockAddr, asm.FnGetCgroupClassid, nil, "5.7"}, // 5a52ae4e32a6
64+
{ebpf.Kprobe, asm.FnGetBranchSnapshot, nil, "5.16"}, // 856c02dbce4f
65+
{ebpf.SchedCLS, asm.FnSkbSetTstamp, nil, "5.18"}, // 9bb984f28d5b
6866
}
6967

7068
for _, tc := range testCases {

0 commit comments

Comments
 (0)