[dpdk-dev] [PATCH v4 3/3] test/devargs: add devargs test cases

Gaëtan Rivet grive at u256.net
Wed Oct 20 13:55:18 CEST 2021


On Wed, Oct 20, 2021, at 13:12, Xueming Li wrote:
> Initial version to test global devargs syntax.
>
> Signed-off-by: Xueming Li <xuemingl at nvidia.com>
> ---
>  app/test/meson.build    |   5 ++
>  app/test/test_devargs.c | 184 ++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 189 insertions(+)
>  create mode 100644 app/test/test_devargs.c
>
> diff --git a/app/test/meson.build b/app/test/meson.build
> index a16374b7a10..c4b0241010d 100644
> --- a/app/test/meson.build
> +++ b/app/test/meson.build
> @@ -399,6 +399,11 @@ if dpdk_conf.has('RTE_NET_RING')
>      fast_tests += [['latencystats_autotest', true]]
>      fast_tests += [['pdump_autotest', true]]
>  endif
> +if dpdk_conf.has('RTE_NET_VIRTIO')
> +    test_deps += 'net_virtio'
> +    test_sources += 'test_devargs.c'
> +    fast_tests += [['devargs_autotest', true]]
> +endif

Hi Steven,

Thanks for adding new use-cases and expanding the expect.
The dep check for the test can be improved I think.

When the build is shared, not all built drivers will be available, even if part of the meson config. It might generate false negative when running your test.

Additionally, even if net_virtio is not built, a subset of your test remains valid.

Finally, net_virtio might not be generic enough as a driver. A simpler one could be used, such as net_ring maybe.

Instead of checking the dependencies in the meson file, you could detect support in preamble
of the test:

bool pci_bus_avail = (rte_bus_find_by_name("pci") != NULL);
bool vdev_bus_avail = (rte_bus_find_by_name("vdev") != NULL);
bool eth_class_avail = [...]

Then during the test case, depending on the expect part of list[i],
you can skip the case if its deps were not found. In that case, am INFO or DEBUG level
message could be printed to say that the test was skipped.

-- 
Gaetan Rivet


More information about the dev mailing list