X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_eal_flags.c;h=672ca0a7ca77f4ed3ae325eecf3c2991135bde06;hb=6b7780bfebe4;hp=9985ee97980876ceaff01478a08d7965734499e9;hpb=57739f65d09ac072466d0e51b9372992781e78d6;p=dpdk.git diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c index 9985ee9798..672ca0a7ca 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; } @@ -1033,6 +1061,24 @@ test_file_prefix(void) const char *argv4[] = {prgname, "-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); @@ -1153,6 +1199,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; }