Skip to contentSkip to conversation

selftests/bpf: Running test_progs with distro configs

RFC Viktor Malik 3 participants 6 messages Jan 21 – Jan 23 BPF

lore
Share & tools
lore
#0 lore raw

Hi,

I know this has been discussed multiple times already but I'd still like to open the topic again.

We struggle to run BPF selftests, especially test_progs, on distros whose configuration is different from what is in tools/testings/selftests/bpf/config. While the tests usually compile fine, many test cases fail because some required config option is not set (for instance CONFIG_FUNCTION_ERROR_INJECTION required for sleepable tracing programs, which is often not enabled on enterprise systems). This makes processing the tests output much harder.

One possible solution would be to maintain our own DENYLIST but I can imagine that the same problem affects other distro folks. So, I'm wondering if the community would be interested in some solution which could live inside the upstream repo. Obviously, I don't want any complicated solution which would require a lot of maintenance and would bit-rot over time. So, I'm thinking something like introducing CONFIG_DENYLIST which would contain "config:testcase" pairs and a couple of lines of code to test_progs runner which would parse the file and automatically skip the given test cases if the required config is not enabled.

Last, let me briefly mention our motivation. BPF selftests are practically the only comprehensive test suite for kernel eBPF as well as for libbpf and bpftool. Running them regularly on distro kernels can not only help find bugs in distro kernels and packages but also reveal upstream bugs which are not caught in upstream testing (b/c we test on different arches, different hardware, etc.).

Before staring implementing an RFC, I'm curious to hear what other people think about this.

Thanks!
Viktor

reviewer
#1 lore raw
Quoted 14 lines · Viktor Malik

Hi,

I know this has been discussed multiple times already but I'd still like to open the topic again.

We struggle to run BPF selftests, especially test_progs, on distros whose configuration is different from what is in tools/testings/selftests/bpf/config. While the tests usually compile fine, many test cases fail because some required config option is not set (for instance CONFIG_FUNCTION_ERROR_INJECTION required for sleepable tracing programs, which is often not enabled on enterprise systems). This makes processing the tests output much harder.

Quoted 10 lines

One possible solution would be to maintain our own DENYLIST but I can imagine that the same problem affects other distro folks. So, I'm wondering if the community would be interested in some solution which could live inside the upstream repo. Obviously, I don't want any complicated solution which would require a lot of maintenance and would bit-rot over time. So, I'm thinking something like introducing CONFIG_DENYLIST which would contain "config:testcase" pairs and a couple of lines of code to test_progs runner which would parse the file and automatically skip the given test cases if the required config is not enabled.

I think this is probably the best idea, but it still requires some work to keep the list up to date. I guess it is possible to use some automation here.

Thanks,
Song

Quoted 14 lines

Last, let me briefly mention our motivation. BPF selftests are practically the only comprehensive test suite for kernel eBPF as well as for libbpf and bpftool. Running them regularly on distro kernels can not only help find bugs in distro kernels and packages but also reveal upstream bugs which are not caught in upstream testing (b/c we test on different arches, different hardware, etc.).

Before staring implementing an RFC, I'm curious to hear what other people think about this.

Thanks!
Viktor

#2 lore raw
In reply to Viktor Malik
Quoted 14 lines · Viktor Malik

Hi,

I know this has been discussed multiple times already but I'd still like to open the topic again.

We struggle to run BPF selftests, especially test_progs, on distros whose configuration is different from what is in tools/testings/selftests/bpf/config. While the tests usually compile fine, many test cases fail because some required config option is not set (for instance CONFIG_FUNCTION_ERROR_INJECTION required for sleepable tracing programs, which is often not enabled on enterprise systems). This makes processing the tests output much harder.

Quoted 10 lines

One possible solution would be to maintain our own DENYLIST but I can imagine that the same problem affects other distro folks. So, I'm wondering if the community would be interested in some solution which could live inside the upstream repo. Obviously, I don't want any complicated solution which would require a lot of maintenance and would bit-rot over time. So, I'm thinking something like introducing CONFIG_DENYLIST which would contain "config:testcase" pairs and a couple of lines of code to test_progs runner which would parse the file and automatically skip the given test cases if the required config is not enabled.

test_progs already has -a and -b and BPF CI is using it to silence the flaky tests on some archs beyond what's in selftests/bpf/DENYLIST* already.
For your use case I think you can introduce DENYLIST.redhat file.

#3 lore raw
Quoted 26 lines · Alexei Starovoitov
Quoted 14 lines · Viktor Malik

Hi,

I know this has been discussed multiple times already but I'd still like to open the topic again.

We struggle to run BPF selftests, especially test_progs, on distros whose configuration is different from what is in tools/testings/selftests/bpf/config. While the tests usually compile fine, many test cases fail because some required config option is not set (for instance CONFIG_FUNCTION_ERROR_INJECTION required for sleepable tracing programs, which is often not enabled on enterprise systems). This makes processing the tests output much harder.

Quoted 10 lines

One possible solution would be to maintain our own DENYLIST but I can imagine that the same problem affects other distro folks. So, I'm wondering if the community would be interested in some solution which could live inside the upstream repo. Obviously, I don't want any complicated solution which would require a lot of maintenance and would bit-rot over time. So, I'm thinking something like introducing CONFIG_DENYLIST which would contain "config:testcase" pairs and a couple of lines of code to test_progs runner which would parse the file and automatically skip the given test cases if the required config is not enabled.

Quoted 4 lines

test_progs already has -a and -b and BPF CI is using it to silence the flaky tests on some archs beyond what's in selftests/bpf/DENYLIST* already.
For your use case I think you can introduce DENYLIST.redhat file.

A separate DENYLIST file is a good idea. I just wanted to check if folks want to share these per-config rather than per-distro. In case this is only suitable for RHEL, then we'll certainly go with a separate DENYLIST.

#4 lore raw
Quoted 28 lines · Viktor Malik
Quoted 26 lines · Alexei Starovoitov
Quoted 24 lines · Viktor Malik

Hi,

I know this has been discussed multiple times already but I'd still like to open the topic again.

We struggle to run BPF selftests, especially test_progs, on distros whose configuration is different from what is in tools/testings/selftests/bpf/config. While the tests usually compile fine, many test cases fail because some required config option is not set (for instance CONFIG_FUNCTION_ERROR_INJECTION required for sleepable tracing programs, which is often not enabled on enterprise systems). This makes processing the tests output much harder.

One possible solution would be to maintain our own DENYLIST but I can imagine that the same problem affects other distro folks. So, I'm wondering if the community would be interested in some solution which could live inside the upstream repo. Obviously, I don't want any complicated solution which would require a lot of maintenance and would bit-rot over time. So, I'm thinking something like introducing CONFIG_DENYLIST which would contain "config:testcase" pairs and a couple of lines of code to test_progs runner which would parse the file and automatically skip the given test cases if the required config is not enabled.

Quoted 8 lines
Quoted 4 lines

test_progs already has -a and -b and BPF CI is using it to silence the flaky tests on some archs beyond what's in selftests/bpf/DENYLIST* already.
For your use case I think you can introduce DENYLIST.redhat file.

A separate DENYLIST file is a good idea. I just wanted to check if folks want to share these per-config rather than per-distro. In case this is only suitable for RHEL, then we'll certainly go with a separate DENYLIST.

Are you trying to share the burden with other distros ? ;) It will bit rot anyway and I'd rather have individuals taking care of their own denylist file than a semi-functional group of people pretending to share while care about their own thing only.

#5 lore raw
Quoted 34 lines · Alexei Starovoitov
Quoted 33 lines · Viktor Malik
Quoted 30 lines · Alexei Starovoitov
Quoted 14 lines · Viktor Malik

Hi,

I know this has been discussed multiple times already but I'd still like to open the topic again.

We struggle to run BPF selftests, especially test_progs, on distros whose configuration is different from what is in tools/testings/selftests/bpf/config. While the tests usually compile fine, many test cases fail because some required config option is not set (for instance CONFIG_FUNCTION_ERROR_INJECTION required for sleepable tracing programs, which is often not enabled on enterprise systems). This makes processing the tests output much harder.

Quoted 10 lines

One possible solution would be to maintain our own DENYLIST but I can imagine that the same problem affects other distro folks. So, I'm wondering if the community would be interested in some solution which could live inside the upstream repo. Obviously, I don't want any complicated solution which would require a lot of maintenance and would bit-rot over time. So, I'm thinking something like introducing CONFIG_DENYLIST which would contain "config:testcase" pairs and a couple of lines of code to test_progs runner which would parse the file and automatically skip the given test cases if the required config is not enabled.

test_progs already has -a and -b and BPF CI is using it to silence the flaky tests on some archs beyond what's in selftests/bpf/DENYLIST* already.
For your use case I think you can introduce DENYLIST.redhat file.

Quoted 8 lines
Quoted 3 lines

A separate DENYLIST file is a good idea. I just wanted to check if folks want to share these per-config rather than per-distro. In case this is only suitable for RHEL, then we'll certainly go with a separate DENYLIST.

Are you trying to share the burden with other distros ? ;) It will bit rot anyway and I'd rather have individuals taking care of their own denylist file than a semi-functional group of people pretending to share while care about their own thing only.

The burden and the benefits ;)
But yeah, you're right, maintaining it would require some very smart automation and it's not worth the fuzz at the moment. We'll go with RHEL-specific denylist.

Thanks for the opinions.
Viktor