[PATCH 1/3] test/bpf: skip some testing if null net driver not present
Stephen Hemminger
stephen at networkplumber.org
Thu Jan 22 17:19:48 CET 2026
On Thu, 22 Jan 2026 12:23:51 +0000
Bruce Richardson <bruce.richardson at intel.com> wrote:
> Some of the BPF tests require the net/null driver to be present, so skip
> those tests if it's not found. If the early part of the tests fail,
> return that failure - on if they succeed do we return skipped on the
> missing dependency.
>
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> ---
> app/test/test_bpf.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/app/test/test_bpf.c b/app/test/test_bpf.c
> index a7d56f8d86..ae588acb16 100644
> --- a/app/test/test_bpf.c
> +++ b/app/test/test_bpf.c
> @@ -3725,6 +3725,11 @@ test_bpf_elf_rx_load(void)
> return ret == 0 ? TEST_SUCCESS : TEST_FAILED;
> }
>
> +#ifdef RTE_NET_NULL
> +static const bool have_net_null = true;
> +#else
> +static const bool have_net_null; /* statics default to false */
> +#endif
>
> static int
> test_bpf_elf(void)
> @@ -3732,6 +3737,10 @@ test_bpf_elf(void)
> int ret;
>
> ret = test_bpf_elf_load();
> + if (ret == TEST_SUCCESS && !have_net_null) {
> + printf("net_null driver not available, skipping remainder of BPF tests\n");
> + return TEST_SKIPPED;
> + }
> if (ret == TEST_SUCCESS)
> ret = test_bpf_elf_tx_load();
> if (ret == TEST_SUCCESS)
Only the tests doing ELF load need a device.
I think that part can be handled at compile time with the #ifdef
or by splitting the ELF load tests to another file and doing it with meson.build
More information about the dev
mailing list