From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2E07AA0613 for ; Wed, 25 Sep 2019 07:47:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 24B302C60; Wed, 25 Sep 2019 07:47:27 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id AE74B2C36 for ; Wed, 25 Sep 2019 07:47:25 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2019 22:47:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,546,1559545200"; d="scan'208";a="213933712" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga004.fm.intel.com with ESMTP; 24 Sep 2019 22:47:24 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 24 Sep 2019 22:47:24 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 24 Sep 2019 22:47:24 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 24 Sep 2019 22:47:23 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.92]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.53]) with mapi id 14.03.0439.000; Wed, 25 Sep 2019 13:47:22 +0800 From: "Tu, Lijuan" To: "Mo, YufengX" , "dts@dpdk.org" , "Li, WenjieX A" CC: "Lin, Xueqin" , "Mo, YufengX" Thread-Topic: [dts] [PATCH V1 1/1] tests/flow_classify: fix check condition logic error Thread-Index: AQHVc18gHFXg0nu2U0Wp8LBmm7wiFac74qHw Date: Wed, 25 Sep 2019 05:47:21 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB27DF0@SHSMSX101.ccr.corp.intel.com> References: <20190925050741.44855-1-yufengx.mo@intel.com> <20190925050741.44855-2-yufengx.mo@intel.com> In-Reply-To: <20190925050741.44855-2-yufengx.mo@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDVlM2Q4MjktM2UyOC00Zjc2LWI0ZTAtZGYwNWY2NzI1M2E5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNlQ1SStQUUEwTURLcHpTd3dEZElydm8xbTJoTFNBelY0UzlzYkEySERtM2NNV3FBVGRRdFBIemltOXpcL2xkK2YifQ== 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: [dts] [PATCH V1 1/1] tests/flow_classify: fix check condition logic error X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of yufengmx > Sent: Wednesday, September 25, 2019 1:08 PM > To: dts@dpdk.org; Li, WenjieX A > Cc: Lin, Xueqin ; Mo, YufengX > > Subject: [dts] [PATCH V1 1/1] tests/flow_classify: fix check condition lo= gic > error >=20 >=20 > fix check condition logic error. > missed use local directory check method, change os.path.exists to > is_existed_on_crb. >=20 > Signed-off-by: yufengmx > --- > tests/TestSuite_flow_classify.py | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) >=20 > diff --git a/tests/TestSuite_flow_classify.py b/tests/TestSuite_flow_clas= sify.py > index ffa6136..c51b0a2 100644 > --- a/tests/TestSuite_flow_classify.py > +++ b/tests/TestSuite_flow_classify.py > @@ -46,6 +46,16 @@ from settings import HEADER_SIZE >=20 > class TestFlowClassify(TestCase): >=20 > + def is_existed_on_crb(self, check_path, crb=3D'dut'): > + alt_session =3D self.dut.alt_session \ > + if crb =3D=3D 'dut' else \ > + self.tester.alt_session > + alt_session.send_expect("ls %s > /dev/null 2>&1" % check_path, "= # ") > + cmd =3D "echo $?" > + output =3D alt_session.send_expect(cmd, "# ") > + ret =3D True if output and output.strip() =3D=3D "0" else False > + return ret > + > def get_cores_mask(self, config=3D'all'): > sockets =3D [self.dut.get_numa_id(index) for index in self.dut_p= orts] > socket_count =3D Counter(sockets) @@ -291,7 +301,7 @@ class > TestFlowClassify(TestCase): > 'examples', > 'flow_classify', > 'ipv4_rules_file.txt']) > - if not os.path.exists(rule_config): > + if not self.is_existed_on_crb(rule_config): > raise VerifyFailure("rules file doesn't existed") > core =3D "1S/1C/1T" > option =3D r" -c {0} -n 4 --file-prefix=3Dtest -- --rule_ipv4=3D= {1}".format( @@ - > 390,7 +400,7 @@ class TestFlowClassify(TestCase): > elif flow_type =3D=3D 'single_stream': > if rule_priority is None and captured_pkts !=3D 0: > msg =3D "invalid stream hasn't been filtered out" > - elif rule_priority is None and captured_pkts !=3D total_= packets: > + elif rule_priority and captured_pkts !=3D total_packets: > msg =3D "expect {0} ".format(total_packets) + \ > "captured {0}".format(captured_pkts) > else: > -- > 2.21.0