test/eal: add ut for eal options proc-type and uio

Message ID 1561125028-21003-1-git-send-email-lavanyax.govindarajan@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series test/eal: add ut for eal options proc-type and uio |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Lavanya Govindarajan June 21, 2019, 1:50 p.m. UTC
  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@intel.com>
---
 app/test/test_eal_flags.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
  

Comments

Burakov, Anatoly June 26, 2019, 9:32 a.m. UTC | #1
On 21-Jun-19 2:50 PM, Lavanya Govindarajan 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@intel.com>
> ---

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
  
David Marchand June 26, 2019, 9:36 a.m. UTC | #2
On Fri, Jun 21, 2019 at 3:52 PM Lavanya Govindarajan <
lavanyax.govindarajan@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@intel.com>
> ---
>  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..82d24e1a8 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",
> +                       "-c", "1", "-n", "2", "--proc-type=auto"};
> +
> +       /* With process type as auto-detect with no-shconf */
> +       const char * const argv17[] = {prgname, "-c", "1", "-n", "2",
> +                       "--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",
> +                       "-c", "1", "-n", "2", "--create-uio-dev"};
> +
>

-n is unneeded to run those tests.
-c 1 is not needed either.

Please drop those.
Thanks.
  

Patch

diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
index 9112c96d0..82d24e1a8 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",
+			"-c", "1", "-n", "2", "--proc-type=auto"};
+
+	/* With process type as auto-detect with no-shconf */
+	const char * const argv17[] = {prgname, "-c", "1", "-n", "2",
+			"--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",
+			"-c", "1", "-n", "2", "--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");
+		return -1;
+	}
+	if (launch_proc(argv18) != 0) {
+		printf("Error - process did not run ok with "
+				"--create-uio-dev parameter\n");
+		return -1;
+	}
 	return 0;
 }