From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 1195BB55B for ; Sun, 15 Feb 2015 07:58:57 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 14 Feb 2015 22:55:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,580,1418112000"; d="scan'208";a="527747689" Received: from kmsmsx153.gar.corp.intel.com ([172.21.73.88]) by orsmga003.jf.intel.com with ESMTP; 14 Feb 2015 22:50:31 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by KMSMSX153.gar.corp.intel.com (172.21.73.88) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sun, 15 Feb 2015 14:58:45 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.192]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.46]) with mapi id 14.03.0195.001; Sun, 15 Feb 2015 14:58:44 +0800 From: "Qiu, Michael" To: "Liang, Cunming" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v1] test: add ut for eal flags --lcores Thread-Index: AQHQSOMC1j/PPvvn+UOxjPaWZ5dOKw== Date: Sun, 15 Feb 2015 06:58:44 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286CE9D76@SHSMSX101.ccr.corp.intel.com> References: <1423979251-5562-1-git-send-email-cunming.liang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v1] test: add ut for eal flags --lcores X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2015 06:58:58 -0000 Hi, Steve=0A= =0A= Why not post this patch within your enabling EAL "--lcores" option patch=0A= set?=0A= As it is not merged yet.=0A= =0A= Just a suggestion, depends you.=0A= =0A= Thanks,=0A= Michael=0A= On 2/15/2015 1:48 PM, Cunming Liang wrote:=0A= > The patch add unit test for the new eal option "--lcores".=0A= >=0A= > Signed-off-by: Cunming Liang =0A= > ---=0A= > It depends on the previous patch which enabling EAL "--lcores" option.= =0A= > http://dpdk.org/ml/archives/dev/2015-February/013204.html=0A= >=0A= > app/test/test_eal_flags.c | 95 ++++++++++++++++++++++++++++++++++++++++-= ------=0A= > 1 file changed, 81 insertions(+), 14 deletions(-)=0A= >=0A= > diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c=0A= > index 0a8269c..0352f87 100644=0A= > --- a/app/test/test_eal_flags.c=0A= > +++ b/app/test/test_eal_flags.c=0A= > @@ -512,47 +512,114 @@ test_missing_c_flag(void)=0A= > =0A= > /* -c flag but no coremask value */=0A= > const char *argv1[] =3D { prgname, prefix, mp_flag, "-n", "3", "-c"};= =0A= > - /* No -c or -l flag at all */=0A= > + /* No -c, -l or --lcores flag at all */=0A= > const char *argv2[] =3D { prgname, prefix, mp_flag, "-n", "3"};=0A= > /* bad coremask value */=0A= > - const char *argv3[] =3D { prgname, prefix, mp_flag, "-n", "3", "-c", "e= rror" };=0A= > + const char *argv3[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "-c", "error" };=0A= > /* sanity check of tests - valid coremask value */=0A= > - const char *argv4[] =3D { prgname, prefix, mp_flag, "-n", "3", "-c", "1= " };=0A= > + const char *argv4[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "-c", "1" };=0A= > /* -l flag but no corelist value */=0A= > - const char *argv5[] =3D { prgname, prefix, mp_flag, "-n", "3", "-l"};= =0A= > - const char *argv6[] =3D { prgname, prefix, mp_flag, "-n", "3", "-l", " = " };=0A= > + const char *argv5[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "-l"};=0A= > + const char *argv6[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "-l", " " };=0A= > /* bad corelist values */=0A= > - const char *argv7[] =3D { prgname, prefix, mp_flag, "-n", "3", "-l", "e= rror" };=0A= > - const char *argv8[] =3D { prgname, prefix, mp_flag, "-n", "3", "-l", "1= -" };=0A= > - const char *argv9[] =3D { prgname, prefix, mp_flag, "-n", "3", "-l", "1= ," };=0A= > - const char *argv10[] =3D { prgname, prefix, mp_flag, "-n", "3", "-l", "= 1#2" };=0A= > + const char *argv7[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "-l", "error" };=0A= > + const char *argv8[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "-l", "1-" };=0A= > + const char *argv9[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "-l", "1," };=0A= > + const char *argv10[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "-l", "1#2" };=0A= > /* sanity check test - valid corelist value */=0A= > - const char *argv11[] =3D { prgname, prefix, mp_flag, "-n", "3", "-l", "= 1-2,3" };=0A= > + const char *argv11[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "-l", "1-2,3" };=0A= > +=0A= > + /* --lcores flag but no lcores value */=0A= > + const char *argv12[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "--lcores" };=0A= > + const char *argv13[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "--lcores", " " };=0A= > + /* bad lcores value */=0A= > + const char *argv14[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "--lcores", "1-3-5" };=0A= > + const char *argv15[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "--lcores", "0-1,,2" };=0A= > + const char *argv16[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "--lcores", "0-,1" };=0A= > + const char *argv17[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "--lcores", "(0-,2-4)" };=0A= > + const char *argv18[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "--lcores", "(-1,2)" };=0A= > + const char *argv19[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "--lcores", "(2-4)@(2-4-6)" };=0A= > + const char *argv20[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "--lcores", "(a,2)" };=0A= > + const char *argv21[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "--lcores", "1-3@(1,3)" };=0A= > + const char *argv22[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "--lcores", "3@((1,3)" };=0A= > + const char *argv23[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "--lcores", "(4-7)=3D(1,3)" };=0A= > + const char *argv24[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "--lcores", "[4-7]@(1,3)" };=0A= > + /* sanity check of tests - valid lcores value */=0A= > + const char *argv25[] =3D { prgname, prefix, mp_flag,=0A= > + "-n", "3", "--lcores",=0A= > + "0-1,2@(5-7),(3-5)@(0,2),(0,6),7"};=0A= > =0A= > if (launch_proc(argv1) =3D=3D 0=0A= > || launch_proc(argv2) =3D=3D 0=0A= > || launch_proc(argv3) =3D=3D 0) {=0A= > - printf("Error - process ran without error when missing -c flag\n");=0A= > + printf("Error - "=0A= > + "process ran without error when missing -c flag\n");=0A= > return -1;=0A= > }=0A= > if (launch_proc(argv4) !=3D 0) {=0A= > - printf("Error - process did not run ok with valid coremask value\n");= =0A= > + printf("Error - "=0A= > + "process did not run ok with valid coremask value\n");=0A= > return -1;=0A= > }=0A= > =0A= > + /* start -l test */=0A= > if (launch_proc(argv5) =3D=3D 0=0A= > || launch_proc(argv6) =3D=3D 0=0A= > || launch_proc(argv7) =3D=3D 0=0A= > || launch_proc(argv8) =3D=3D 0=0A= > || launch_proc(argv9) =3D=3D 0=0A= > || launch_proc(argv10) =3D=3D 0) {=0A= > - printf("Error - process ran without error with invalid -l flag\n");=0A= > + printf("Error - "=0A= > + "process ran without error with invalid -l flag\n");=0A= > return -1;=0A= > }=0A= > if (launch_proc(argv11) !=3D 0) {=0A= > - printf("Error - process did not run ok with valid corelist value\n");= =0A= > + printf("Error - "=0A= > + "process did not run ok with valid corelist value\n");=0A= > return -1;=0A= > }=0A= > +=0A= > + /* start --lcores tests */=0A= > + if (launch_proc(argv12) =3D=3D 0 || launch_proc(argv13) =3D=3D 0 ||=0A= > + launch_proc(argv14) =3D=3D 0 || launch_proc(argv15) =3D=3D 0 ||=0A= > + launch_proc(argv16) =3D=3D 0 || launch_proc(argv17) =3D=3D 0 ||=0A= > + launch_proc(argv18) =3D=3D 0 || launch_proc(argv19) =3D=3D 0 ||=0A= > + launch_proc(argv20) =3D=3D 0 || launch_proc(argv21) =3D=3D 0 ||=0A= > + launch_proc(argv21) =3D=3D 0 || launch_proc(argv22) =3D=3D 0 ||=0A= > + launch_proc(argv23) =3D=3D 0 || launch_proc(argv24) =3D=3D 0) {=0A= > + printf("Error - "=0A= > + "process ran without error with invalid --lcore flag\n");=0A= > + return -1;=0A= > + }=0A= > +=0A= > + if (launch_proc(argv25) !=3D 0) {=0A= > + printf("Error - "=0A= > + "process did not run ok with valid corelist value\n");=0A= > + return -1;=0A= > + }=0A= > +=0A= > return 0;=0A= > }=0A= > =0A= =0A=