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

Message ID 1562159174-12183-1-git-send-email-lavanyax.govindarajan@intel.com (mailing list archive)
State Accepted, archived
Headers
Series [v3] test/eal: add ut for eal options proc-type and uio |

Checks

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

Commit Message

Lavanya Govindarajan July 3, 2019, 1:06 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>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
v3: Corrected error log message to be consistent
v2: Removed core and channels eal options as they are not significant
---

 app/test/test_eal_flags.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
  

Comments

Thomas Monjalon July 4, 2019, 9:52 p.m. UTC | #1
03/07/2019 15:06, Lavanya Govindarajan:
> 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>
> Reviewed-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks
  

Patch

diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
index 9985ee979..3766c4cfc 100644
--- a/app/test/test_eal_flags.c
+++ b/app/test/test_eal_flags.c
@@ -903,6 +903,18 @@  test_misc_flags(void)
 	const char *argv15[] = {prgname, "--file-prefix=intr",
 			"--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) {
@@ -979,6 +991,22 @@  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 and --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;
 }