test/bpf: skip test if libpcap is unavailable
authorTyler Retzlaff <roretzla@linux.microsoft.com>
Tue, 22 Mar 2022 07:12:35 +0000 (00:12 -0700)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 26 Apr 2022 07:31:52 +0000 (09:31 +0200)
commit55ae8965bf8eecd5ebec36663bb0f36018abf64b
tree2ff54ee3b0a786e70c257cf10287aec86ef242af
parent8001c0ddfe789cd6e0fe6260b2e07a21ec364ea4
test/bpf: skip test if libpcap is unavailable

test_bpf_convert is being conditionally registered depending on the
presence of RTE_HAS_LIBPCAP except the UT unconditionally lists it as a
test to run.

When the UT runs test_bpf_convert test-dpdk can't find the registration
and assumes the DPDK_TEST environment variable hasn't been defined
resulting in test-dpdk dropping to interactive mode and subsequently
waiting for the remainder of the UT fast-test timeout period before
reporting the test as having timed out.

* unconditionally register test_bpf_convert,
* if ! RTE_HAS_LIBPCAP provide a stub test_bpf_convert that reports the
  test is skipped similar to that done with the test_bpf test.

Fixes: 2eccf6afbea9 ("bpf: add function to convert classic BPF to DPDK BPF")
Cc: stable@dpdk.org
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
app/test/test_bpf.c