DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test/eal: add ut cases for in-memory and single-file-segment
@ 2019-06-14 13:37 Pallantla Poornima
  2019-06-25 10:22 ` Burakov, Anatoly
  2019-06-26 13:45 ` [dpdk-dev] [PATCH v2] " Pallantla Poornima
  0 siblings, 2 replies; 8+ messages in thread
From: Pallantla Poornima @ 2019-06-14 13:37 UTC (permalink / raw)
  To: dev; +Cc: reshma.pattan, anatoly.burakov, Pallantla Poornima

Added unit test case for eal command line 'in-memory' option
which will cover below functions.
get_seg_memfd()
test_memfd_create()
pagesz_flags()

Added unit test case for eal command line 'single-file-segments' option
which will cover resize_hugefile().

Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
---
 app/test/test_eal_flags.c | 69 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
index 9112c96d0..2b2cccaec 100644
--- a/app/test/test_eal_flags.c
+++ b/app/test/test_eal_flags.c
@@ -978,6 +978,7 @@ test_file_prefix(void)
 	 *    mem mode
 	 */
 	char prefix[PATH_MAX] = "";
+	char tmp[PATH_MAX];
 
 #ifdef RTE_EXEC_ENV_FREEBSD
 	return 0;
@@ -1010,6 +1011,26 @@ test_file_prefix(void)
 	const char *argv4[] = {prgname, "-c", "1", "-n", "2", "-m",
 			DEFAULT_MEM_SIZE, "--file-prefix=" memtest2 };
 
+	/* primary process with inmemory mode */
+	const char * const argv5[] = {prgname, "-c", "1", "-n", "2", "-m",
+		DEFAULT_MEM_SIZE, "--in-memory" };
+
+	/* primary process with memtest1 and inmemory mode */
+	const char * const argv6[] = {prgname, "-c", "1", "-n", "2", "-m",
+		DEFAULT_MEM_SIZE, "--in-memory",
+		"--file-prefix=" memtest1 };
+
+	snprintf(tmp, PATH_MAX, "--file-prefix=%s", prefix);
+
+	/* primary process with parent file-prefix and inmemory mode */
+	const char * const argv7[] = {prgname, "-c", "1", "-n", "2", "-m",
+		DEFAULT_MEM_SIZE, "--in-memory", tmp};
+
+	/* primary process with memtest1 and single-file-segments mode */
+	const char * const argv8[] = {prgname, "-c", "1", "-n", "2", "-m",
+		DEFAULT_MEM_SIZE, "--single-file-segments",
+		"--file-prefix=" memtest1 };
+
 	/* check if files for current prefix are present */
 	if (process_hugefiles(prefix, HUGEPAGE_CHECK_EXISTS) != 1) {
 		printf("Error - hugepage files for %s were not created!\n", prefix);
@@ -1130,6 +1151,54 @@ test_file_prefix(void)
 		return -1;
 	}
 
+	/* this process will run in in-memory mode, so it should not leave any
+	 * hugepage files behind.
+	 */
+
+	/* test case to check eal-options with --in-memory mode */
+	if (launch_proc(argv5) != 0) {
+		printf("Error - failed to run with in-memory mode\n");
+		return -1;
+	}
+
+	/*test case to check eal-options with --in-memory mode with
+	 * custom file-prefix.
+	 */
+	if (launch_proc(argv6) != 0) {
+		printf("Error - failed to run with in-memory mode\n");
+		return -1;
+	}
+
+	/* check if hugefiles for memtest1 are present */
+	if (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 0) {
+		printf("Error - hugepage files for %s were created and not deleted!\n",
+				memtest1);
+		return -1;
+	}
+
+	/* test case to check eal-options with --in-memory mode with
+	 * parent file-prefix.
+	 */
+	if (launch_proc(argv7) != 0) {
+		printf("Error - failed to run with --file-prefix=%s\n", prefix);
+		return -1;
+	}
+
+	/* this process will run in single file mode, so it should not leave any
+	 * hugepage files behind.
+	 */
+	if (launch_proc(argv8) != 0) {
+		printf("Error - failed to run with single-file-segments mode\n");
+		return -1;
+	}
+
+	/* check if hugefiles for memtest1 are present */
+	if (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 0) {
+		printf("Error - hugepage files for %s were not deleted!\n",
+				memtest1);
+		return -1;
+	}
+
 	return 0;
 }
 
-- 
2.17.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] test/eal: add ut cases for in-memory and single-file-segment
  2019-06-14 13:37 [dpdk-dev] [PATCH] test/eal: add ut cases for in-memory and single-file-segment Pallantla Poornima
@ 2019-06-25 10:22 ` Burakov, Anatoly
  2019-06-26 13:45 ` [dpdk-dev] [PATCH v2] " Pallantla Poornima
  1 sibling, 0 replies; 8+ messages in thread
From: Burakov, Anatoly @ 2019-06-25 10:22 UTC (permalink / raw)
  To: Pallantla Poornima, dev; +Cc: reshma.pattan

On 14-Jun-19 2:37 PM, Pallantla Poornima wrote:
> Added unit test case for eal command line 'in-memory' option
> which will cover below functions.
> get_seg_memfd()
> test_memfd_create()
> pagesz_flags()
> 
> Added unit test case for eal command line 'single-file-segments' option
> which will cover resize_hugefile().
> 
> Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
> ---
>   app/test/test_eal_flags.c | 69 +++++++++++++++++++++++++++++++++++++++
>   1 file changed, 69 insertions(+)
> 
> diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
> index 9112c96d0..2b2cccaec 100644
> --- a/app/test/test_eal_flags.c
> +++ b/app/test/test_eal_flags.c
> @@ -978,6 +978,7 @@ test_file_prefix(void)
>   	 *    mem mode
>   	 */
>   	char prefix[PATH_MAX] = "";
> +	char tmp[PATH_MAX];
>   
>   #ifdef RTE_EXEC_ENV_FREEBSD
>   	return 0;
> @@ -1010,6 +1011,26 @@ test_file_prefix(void)
>   	const char *argv4[] = {prgname, "-c", "1", "-n", "2", "-m",
>   			DEFAULT_MEM_SIZE, "--file-prefix=" memtest2 };
>   
> +	/* primary process with inmemory mode */
> +	const char * const argv5[] = {prgname, "-c", "1", "-n", "2", "-m",
> +		DEFAULT_MEM_SIZE, "--in-memory" };
> +
> +	/* primary process with memtest1 and inmemory mode */
> +	const char * const argv6[] = {prgname, "-c", "1", "-n", "2", "-m",
> +		DEFAULT_MEM_SIZE, "--in-memory",
> +		"--file-prefix=" memtest1 };
> +
> +	snprintf(tmp, PATH_MAX, "--file-prefix=%s", prefix);

No need to do this, you can just add `"--file-prefix", prefix` into 
below line and it'll work. The syntax is either "--flag=param" or 
"--flag param" - both are valid.

Otherwise,

Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH v2] test/eal: add ut cases for in-memory and single-file-segment
  2019-06-14 13:37 [dpdk-dev] [PATCH] test/eal: add ut cases for in-memory and single-file-segment Pallantla Poornima
  2019-06-25 10:22 ` Burakov, Anatoly
@ 2019-06-26 13:45 ` Pallantla Poornima
  2019-06-26 13:54   ` David Marchand
  2019-06-27 13:07   ` [dpdk-dev] [PATCH v3] " Pallantla Poornima
  1 sibling, 2 replies; 8+ messages in thread
From: Pallantla Poornima @ 2019-06-26 13:45 UTC (permalink / raw)
  To: dev; +Cc: reshma.pattan, anatoly.burakov, Pallantla Poornima

Added unit test case for eal command line 'in-memory' option
which will cover below functions.
get_seg_memfd()
test_memfd_create()
pagesz_flags()

Added unit test case for eal command line 'single-file-segments' option
which will cover resize_hugefile().

Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
v2: Removed snprintf as suggested
---
 app/test/test_eal_flags.c | 66 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
index 9112c96d0..85f4fc64a 100644
--- a/app/test/test_eal_flags.c
+++ b/app/test/test_eal_flags.c
@@ -1010,6 +1010,24 @@ test_file_prefix(void)
 	const char *argv4[] = {prgname, "-c", "1", "-n", "2", "-m",
 			DEFAULT_MEM_SIZE, "--file-prefix=" memtest2 };
 
+	/* primary process with inmemory mode */
+	const char * const argv5[] = {prgname, "-c", "1", "-n", "2", "-m",
+		DEFAULT_MEM_SIZE, "--in-memory" };
+
+	/* primary process with memtest1 and inmemory mode */
+	const char * const argv6[] = {prgname, "-c", "1", "-n", "2", "-m",
+		DEFAULT_MEM_SIZE, "--in-memory",
+		"--file-prefix=" memtest1 };
+
+	/* primary process with parent file-prefix and inmemory mode */
+	const char * const argv7[] = {prgname, "-c", "1", "-n", "2", "-m",
+		DEFAULT_MEM_SIZE, "--in-memory", "--file-prefix", prefix };
+
+	/* primary process with memtest1 and single-file-segments mode */
+	const char * const argv8[] = {prgname, "-c", "1", "-n", "2", "-m",
+		DEFAULT_MEM_SIZE, "--single-file-segments",
+		"--file-prefix=" memtest1 };
+
 	/* check if files for current prefix are present */
 	if (process_hugefiles(prefix, HUGEPAGE_CHECK_EXISTS) != 1) {
 		printf("Error - hugepage files for %s were not created!\n", prefix);
@@ -1130,6 +1148,54 @@ test_file_prefix(void)
 		return -1;
 	}
 
+	/* this process will run in in-memory mode, so it should not leave any
+	 * hugepage files behind.
+	 */
+
+	/* test case to check eal-options with --in-memory mode */
+	if (launch_proc(argv5) != 0) {
+		printf("Error - failed to run with in-memory mode\n");
+		return -1;
+	}
+
+	/*test case to check eal-options with --in-memory mode with
+	 * custom file-prefix.
+	 */
+	if (launch_proc(argv6) != 0) {
+		printf("Error - failed to run with in-memory mode\n");
+		return -1;
+	}
+
+	/* check if hugefiles for memtest1 are present */
+	if (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 0) {
+		printf("Error - hugepage files for %s were created and not deleted!\n",
+				memtest1);
+		return -1;
+	}
+
+	/* test case to check eal-options with --in-memory mode with
+	 * parent file-prefix.
+	 */
+	if (launch_proc(argv7) != 0) {
+		printf("Error - failed to run with --file-prefix=%s\n", prefix);
+		return -1;
+	}
+
+	/* this process will run in single file mode, so it should not leave any
+	 * hugepage files behind.
+	 */
+	if (launch_proc(argv8) != 0) {
+		printf("Error - failed to run with single-file-segments mode\n");
+		return -1;
+	}
+
+	/* check if hugefiles for memtest1 are present */
+	if (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 0) {
+		printf("Error - hugepage files for %s were not deleted!\n",
+				memtest1);
+		return -1;
+	}
+
 	return 0;
 }
 
-- 
2.17.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH v2] test/eal: add ut cases for in-memory and single-file-segment
  2019-06-26 13:45 ` [dpdk-dev] [PATCH v2] " Pallantla Poornima
@ 2019-06-26 13:54   ` David Marchand
  2019-06-27 13:07   ` [dpdk-dev] [PATCH v3] " Pallantla Poornima
  1 sibling, 0 replies; 8+ messages in thread
From: David Marchand @ 2019-06-26 13:54 UTC (permalink / raw)
  To: Pallantla Poornima; +Cc: dev, Pattan, Reshma, Burakov, Anatoly

On Wed, Jun 26, 2019 at 3:47 PM Pallantla Poornima <
pallantlax.poornima@intel.com> wrote:

> Added unit test case for eal command line 'in-memory' option
> which will cover below functions.
> get_seg_memfd()
> test_memfd_create()
> pagesz_flags()
>
> Added unit test case for eal command line 'single-file-segments' option
> which will cover resize_hugefile().
>
> Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
> Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
> v2: Removed snprintf as suggested
> ---
>  app/test/test_eal_flags.c | 66 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 66 insertions(+)
>
> diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
> index 9112c96d0..85f4fc64a 100644
> --- a/app/test/test_eal_flags.c
> +++ b/app/test/test_eal_flags.c
> @@ -1010,6 +1010,24 @@ test_file_prefix(void)
>         const char *argv4[] = {prgname, "-c", "1", "-n", "2", "-m",
>                         DEFAULT_MEM_SIZE, "--file-prefix=" memtest2 };
>
> +       /* primary process with inmemory mode */
> +       const char * const argv5[] = {prgname, "-c", "1", "-n", "2", "-m",
> +               DEFAULT_MEM_SIZE, "--in-memory" };
> +
> +       /* primary process with memtest1 and inmemory mode */
> +       const char * const argv6[] = {prgname, "-c", "1", "-n", "2", "-m",
> +               DEFAULT_MEM_SIZE, "--in-memory",
> +               "--file-prefix=" memtest1 };
> +
> +       /* primary process with parent file-prefix and inmemory mode */
> +       const char * const argv7[] = {prgname, "-c", "1", "-n", "2", "-m",
> +               DEFAULT_MEM_SIZE, "--in-memory", "--file-prefix", prefix };
> +
> +       /* primary process with memtest1 and single-file-segments mode */
> +       const char * const argv8[] = {prgname, "-c", "1", "-n", "2", "-m",
> +               DEFAULT_MEM_SIZE, "--single-file-segments",
> +               "--file-prefix=" memtest1 };
> +
>

Same comment than http://patchwork.dpdk.org/patch/55169/

Please drop -n and -c options if there is no requirement for the tests to
run.


-- 
David Marchand

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH v3] test/eal: add ut cases for in-memory and single-file-segment
  2019-06-26 13:45 ` [dpdk-dev] [PATCH v2] " Pallantla Poornima
  2019-06-26 13:54   ` David Marchand
@ 2019-06-27 13:07   ` Pallantla Poornima
  2019-07-02  7:48     ` David Marchand
  2019-07-03  7:13     ` [dpdk-dev] [PATCH v4] " Pallantla Poornima
  1 sibling, 2 replies; 8+ messages in thread
From: Pallantla Poornima @ 2019-06-27 13:07 UTC (permalink / raw)
  To: dev; +Cc: reshma.pattan, anatoly.burakov, Pallantla Poornima

Added unit test case for eal command line 'in-memory' option
which will cover below functions.
get_seg_memfd()
test_memfd_create()
pagesz_flags()

Added unit test case for eal command line 'single-file-segments' option
which will cover resize_hugefile().

Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
v3: Removed -c , -n options as suggested
v2: Removed snprintf as suggested
---
 app/test/test_eal_flags.c | 66 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
index 9112c96d0..0d5eef727 100644
--- a/app/test/test_eal_flags.c
+++ b/app/test/test_eal_flags.c
@@ -1010,6 +1010,24 @@ test_file_prefix(void)
 	const char *argv4[] = {prgname, "-c", "1", "-n", "2", "-m",
 			DEFAULT_MEM_SIZE, "--file-prefix=" memtest2 };
 
+	/* primary process with inmemory mode */
+	const char * const argv5[] = {prgname, "-m",
+		DEFAULT_MEM_SIZE, "--in-memory" };
+
+	/* primary process with memtest1 and inmemory mode */
+	const char * const argv6[] = {prgname, "-m",
+		DEFAULT_MEM_SIZE, "--in-memory",
+		"--file-prefix=" memtest1 };
+
+	/* primary process with parent file-prefix and inmemory mode */
+	const char * const argv7[] = {prgname, "-m",
+		DEFAULT_MEM_SIZE, "--in-memory", "--file-prefix", prefix };
+
+	/* primary process with memtest1 and single-file-segments mode */
+	const char * const argv8[] = {prgname, "-m",
+		DEFAULT_MEM_SIZE, "--single-file-segments",
+		"--file-prefix=" memtest1 };
+
 	/* check if files for current prefix are present */
 	if (process_hugefiles(prefix, HUGEPAGE_CHECK_EXISTS) != 1) {
 		printf("Error - hugepage files for %s were not created!\n", prefix);
@@ -1130,6 +1148,54 @@ test_file_prefix(void)
 		return -1;
 	}
 
+	/* this process will run in in-memory mode, so it should not leave any
+	 * hugepage files behind.
+	 */
+
+	/* test case to check eal-options with --in-memory mode */
+	if (launch_proc(argv5) != 0) {
+		printf("Error - failed to run with in-memory mode\n");
+		return -1;
+	}
+
+	/*test case to check eal-options with --in-memory mode with
+	 * custom file-prefix.
+	 */
+	if (launch_proc(argv6) != 0) {
+		printf("Error - failed to run with in-memory mode\n");
+		return -1;
+	}
+
+	/* check if hugefiles for memtest1 are present */
+	if (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 0) {
+		printf("Error - hugepage files for %s were created and not deleted!\n",
+				memtest1);
+		return -1;
+	}
+
+	/* test case to check eal-options with --in-memory mode with
+	 * parent file-prefix.
+	 */
+	if (launch_proc(argv7) != 0) {
+		printf("Error - failed to run with --file-prefix=%s\n", prefix);
+		return -1;
+	}
+
+	/* this process will run in single file mode, so it should not leave any
+	 * hugepage files behind.
+	 */
+	if (launch_proc(argv8) != 0) {
+		printf("Error - failed to run with single-file-segments mode\n");
+		return -1;
+	}
+
+	/* check if hugefiles for memtest1 are present */
+	if (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 0) {
+		printf("Error - hugepage files for %s were not deleted!\n",
+				memtest1);
+		return -1;
+	}
+
 	return 0;
 }
 
-- 
2.17.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH v3] test/eal: add ut cases for in-memory and single-file-segment
  2019-06-27 13:07   ` [dpdk-dev] [PATCH v3] " Pallantla Poornima
@ 2019-07-02  7:48     ` David Marchand
  2019-07-03  7:13     ` [dpdk-dev] [PATCH v4] " Pallantla Poornima
  1 sibling, 0 replies; 8+ messages in thread
From: David Marchand @ 2019-07-02  7:48 UTC (permalink / raw)
  To: Pallantla Poornima; +Cc: dev, Pattan, Reshma, Burakov, Anatoly

On Thu, Jun 27, 2019 at 3:09 PM Pallantla Poornima <
pallantlax.poornima@intel.com> wrote:

> Added unit test case for eal command line 'in-memory' option
> which will cover below functions.
> get_seg_memfd()
> test_memfd_create()
> pagesz_flags()
>
> Added unit test case for eal command line 'single-file-segments' option
> which will cover resize_hugefile().
>
> Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
> Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
> v3: Removed -c , -n options as suggested
> v2: Removed snprintf as suggested
> ---
>  app/test/test_eal_flags.c | 66 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 66 insertions(+)
>
> diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
> index 9112c96d0..0d5eef727 100644
> --- a/app/test/test_eal_flags.c
> +++ b/app/test/test_eal_flags.c
> @@ -1010,6 +1010,24 @@ test_file_prefix(void)
>         const char *argv4[] = {prgname, "-c", "1", "-n", "2", "-m",
>                         DEFAULT_MEM_SIZE, "--file-prefix=" memtest2 };
>
> +       /* primary process with inmemory mode */
> +       const char * const argv5[] = {prgname, "-m",
> +               DEFAULT_MEM_SIZE, "--in-memory" };
> +
> +       /* primary process with memtest1 and inmemory mode */
> +       const char * const argv6[] = {prgname, "-m",
> +               DEFAULT_MEM_SIZE, "--in-memory",
> +               "--file-prefix=" memtest1 };
> +
> +       /* primary process with parent file-prefix and inmemory mode */
> +       const char * const argv7[] = {prgname, "-m",
> +               DEFAULT_MEM_SIZE, "--in-memory", "--file-prefix", prefix };
> +
> +       /* primary process with memtest1 and single-file-segments mode */
> +       const char * const argv8[] = {prgname, "-m",
> +               DEFAULT_MEM_SIZE, "--single-file-segments",
> +               "--file-prefix=" memtest1 };
> +
>         /* check if files for current prefix are present */
>         if (process_hugefiles(prefix, HUGEPAGE_CHECK_EXISTS) != 1) {
>                 printf("Error - hugepage files for %s were not
> created!\n", prefix);
> @@ -1130,6 +1148,54 @@ test_file_prefix(void)
>                 return -1;
>         }
>
> +       /* this process will run in in-memory mode, so it should not leave
> any
> +        * hugepage files behind.
> +        */
> +
> +       /* test case to check eal-options with --in-memory mode */
> +       if (launch_proc(argv5) != 0) {
> +               printf("Error - failed to run with in-memory mode\n");
> +               return -1;
> +       }
> +
> +       /*test case to check eal-options with --in-memory mode with
>

missing space.

+        * custom file-prefix.
> +        */
> +       if (launch_proc(argv6) != 0) {
> +               printf("Error - failed to run with in-memory mode\n");
> +               return -1;
> +       }
> +
> +       /* check if hugefiles for memtest1 are present */
> +       if (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 0) {
> +               printf("Error - hugepage files for %s were created and not
> deleted!\n",
> +                               memtest1);
> +               return -1;
> +       }
> +
> +       /* test case to check eal-options with --in-memory mode with
> +        * parent file-prefix.
> +        */
> +       if (launch_proc(argv7) != 0) {
> +               printf("Error - failed to run with --file-prefix=%s\n",
> prefix);
> +               return -1;
> +       }
> +
> +       /* this process will run in single file mode, so it should not
> leave any
> +        * hugepage files behind.
> +        */
> +       if (launch_proc(argv8) != 0) {
> +               printf("Error - failed to run with single-file-segments
> mode\n");
> +               return -1;
> +       }
> +
> +       /* check if hugefiles for memtest1 are present */
> +       if (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 0) {
> +               printf("Error - hugepage files for %s were not deleted!\n",
> +                               memtest1);
> +               return -1;
> +       }
> +
>         return 0;
>  }
>
> --
> 2.17.2
>
>
There are a couple of inconsistencies between inmemory, in-memory,
--in-memory.
Could you make this consistent?
Then you can add my review tag.

Thanks.

-- 
David Marchand

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH v4] test/eal: add ut cases for in-memory and single-file-segment
  2019-06-27 13:07   ` [dpdk-dev] [PATCH v3] " Pallantla Poornima
  2019-07-02  7:48     ` David Marchand
@ 2019-07-03  7:13     ` Pallantla Poornima
  2019-07-04 21:35       ` Thomas Monjalon
  1 sibling, 1 reply; 8+ messages in thread
From: Pallantla Poornima @ 2019-07-03  7:13 UTC (permalink / raw)
  To: dev; +Cc: reshma.pattan, anatoly.burakov, david.marchand, Pallantla Poornima

Added unit test case for eal command line '--in-memory' option
which will cover below functions.
get_seg_memfd()
test_memfd_create()
pagesz_flags()

Added unit test case for eal command line '--single-file-segments' option
which will cover resize_hugefile().

Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
v4: Corrected spell check
v3: Removed -c , -n options as suggested
v2: Removed snprintf as suggested
---
 app/test/test_eal_flags.c | 66 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
index 9112c96d0..61baa5aec 100644
--- a/app/test/test_eal_flags.c
+++ b/app/test/test_eal_flags.c
@@ -1010,6 +1010,24 @@ test_file_prefix(void)
 	const char *argv4[] = {prgname, "-c", "1", "-n", "2", "-m",
 			DEFAULT_MEM_SIZE, "--file-prefix=" memtest2 };
 
+	/* primary process with --in-memory mode */
+	const char * const argv5[] = {prgname, "-m",
+		DEFAULT_MEM_SIZE, "--in-memory" };
+
+	/* primary process with memtest1 and --in-memory mode */
+	const char * const argv6[] = {prgname, "-m",
+		DEFAULT_MEM_SIZE, "--in-memory",
+		"--file-prefix=" memtest1 };
+
+	/* primary process with parent file-prefix and --in-memory mode */
+	const char * const argv7[] = {prgname, "-m",
+		DEFAULT_MEM_SIZE, "--in-memory", "--file-prefix", prefix };
+
+	/* primary process with memtest1 and --single-file-segments mode */
+	const char * const argv8[] = {prgname, "-m",
+		DEFAULT_MEM_SIZE, "--single-file-segments",
+		"--file-prefix=" memtest1 };
+
 	/* check if files for current prefix are present */
 	if (process_hugefiles(prefix, HUGEPAGE_CHECK_EXISTS) != 1) {
 		printf("Error - hugepage files for %s were not created!\n", prefix);
@@ -1130,6 +1148,54 @@ test_file_prefix(void)
 		return -1;
 	}
 
+	/* this process will run in --in-memory mode, so it should not leave any
+	 * hugepage files behind.
+	 */
+
+	/* test case to check eal-options with --in-memory mode */
+	if (launch_proc(argv5) != 0) {
+		printf("Error - failed to run with --in-memory mode\n");
+		return -1;
+	}
+
+	/*test case to check eal-options with --in-memory mode with
+	 * custom file-prefix.
+	 */
+	if (launch_proc(argv6) != 0) {
+		printf("Error - failed to run with --in-memory mode\n");
+		return -1;
+	}
+
+	/* check if hugefiles for memtest1 are present */
+	if (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 0) {
+		printf("Error - hugepage files for %s were created and not deleted!\n",
+				memtest1);
+		return -1;
+	}
+
+	/* test case to check eal-options with --in-memory mode with
+	 * parent file-prefix.
+	 */
+	if (launch_proc(argv7) != 0) {
+		printf("Error - failed to run with --file-prefix=%s\n", prefix);
+		return -1;
+	}
+
+	/* this process will run in --single-file-segments mode,
+	 * so it should not leave any hugepage files behind.
+	 */
+	if (launch_proc(argv8) != 0) {
+		printf("Error - failed to run with --single-file-segments mode\n");
+		return -1;
+	}
+
+	/* check if hugefiles for memtest1 are present */
+	if (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 0) {
+		printf("Error - hugepage files for %s were not deleted!\n",
+				memtest1);
+		return -1;
+	}
+
 	return 0;
 }
 
-- 
2.17.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH v4] test/eal: add ut cases for in-memory and single-file-segment
  2019-07-03  7:13     ` [dpdk-dev] [PATCH v4] " Pallantla Poornima
@ 2019-07-04 21:35       ` Thomas Monjalon
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2019-07-04 21:35 UTC (permalink / raw)
  To: Pallantla Poornima; +Cc: dev, reshma.pattan, anatoly.burakov, david.marchand

03/07/2019 09:13, Pallantla Poornima:
> Added unit test case for eal command line '--in-memory' option
> which will cover below functions.
> get_seg_memfd()
> test_memfd_create()
> pagesz_flags()
> 
> Added unit test case for eal command line '--single-file-segments' option
> which will cover resize_hugefile().
> 
> Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
> Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
> Reviewed-by: David Marchand <david.marchand@redhat.com>

Applied, thanks




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-07-04 21:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-14 13:37 [dpdk-dev] [PATCH] test/eal: add ut cases for in-memory and single-file-segment Pallantla Poornima
2019-06-25 10:22 ` Burakov, Anatoly
2019-06-26 13:45 ` [dpdk-dev] [PATCH v2] " Pallantla Poornima
2019-06-26 13:54   ` David Marchand
2019-06-27 13:07   ` [dpdk-dev] [PATCH v3] " Pallantla Poornima
2019-07-02  7:48     ` David Marchand
2019-07-03  7:13     ` [dpdk-dev] [PATCH v4] " Pallantla Poornima
2019-07-04 21:35       ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).