[dpdk-dev] [PATCH v2] test/eal: add ut for eal options proc-type and uio

David Marchand david.marchand at redhat.com
Tue Jul 2 09:33:04 CEST 2019


On Thu, Jun 27, 2019 at 2:18 PM Lavanya Govindarajan <
lavanyax.govindarajan at intel.com> wrote:

> Added unit test cases for EAL flags --proc-type=auto and
> --create-uio-dev in order to cover the below functions
> eal_proc_type_detect()
> rte_eal_create_uio_dev()
>
> Signed-off-by: Lavanya Govindarajan <lavanyax.govindarajan at intel.com>
> Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
> ---
> v2: Removed core and channels eal options as they are not significant
> ---
>
>  app/test/test_eal_flags.c | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
>
> diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
> index 9112c96d0..17c0e43d2 100644
> --- a/app/test/test_eal_flags.c
> +++ b/app/test/test_eal_flags.c
> @@ -880,6 +880,18 @@ test_misc_flags(void)
>         const char *argv15[] = {prgname, "--file-prefix=intr",
>                         "-c", "1", "-n", "2", "--vfio-intr=invalid"};
>
> +       /* With process type as auto-detect */
> +       const char * const argv16[] = {prgname, "--file-prefix=auto",
> +                       "--proc-type=auto"};
> +
> +       /* With process type as auto-detect with no-shconf */
> +       const char * const argv17[] = {prgname, "--proc-type=auto",
> +                       no_shconf, nosh_prefix, no_huge};
> +
> +       /* With process type as --create-uio-dev flag */
> +       const char * const argv18[] = {prgname, "--file-prefix=uiodev",
> +                       "--create-uio-dev"};
> +
>         /* run all tests also applicable to FreeBSD first */
>
>         if (launch_proc(argv0) == 0) {
> @@ -956,6 +968,21 @@ test_misc_flags(void)
>                                 "--vfio-intr invalid parameter\n");
>                 return -1;
>         }
> +       if (launch_proc(argv16) != 0) {
> +               printf("Error - process did not run ok with "
> +                               "--proc-type as auto parameter\n");
> +               return -1;
> +       }
> +       if (launch_proc(argv17) != 0) {
> +               printf("Error - process did not run ok with "
> +                               "--proc type as auto - no-shconf
> parameter\n");
>

Nit: those messages are not that useful, but at least let's make them
consistent by using the full option names: --proc-type and --no-shconf.


+               return -1;
> +       }
> +       if (launch_proc(argv18) != 0) {
> +               printf("Error - process did not run ok with "
> +                               "--create-uio-dev parameter\n");
> +               return -1;
> +       }
>         return 0;
>  }
>
> --
> 2.14.1
>
>
Reviewed-by: David Marchand <david.marchand at redhat.com>


-- 
David Marchand


More information about the dev mailing list