From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 8A0A81B36C for ; Sun, 11 Feb 2018 02:38:57 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Feb 2018 17:38:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,493,1511856000"; d="scan'208";a="16849100" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga007.fm.intel.com with ESMTP; 10 Feb 2018 17:38:56 -0800 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sat, 10 Feb 2018 17:38:56 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sat, 10 Feb 2018 17:38:56 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.125]) with mapi id 14.03.0319.002; Sun, 11 Feb 2018 09:38:54 +0800 From: "Liu, Yong" To: "Luo, Michael" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH] tests/pmdrss_hash: check reta_lines before verifying the result Thread-Index: AQHToIme3zLFhO/tNkOWhkgdNLWnp6Oeb7QQ Date: Sun, 11 Feb 2018 01:38:54 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62F9DA07@SHSMSX103.ccr.corp.intel.com> References: <1518087481-53786-1-git-send-email-michael.luo@intel.com> In-Reply-To: <1518087481-53786-1-git-send-email-michael.luo@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjUyMjg5ZDctNmI4Yi00ZGNlLTg0OTEtOTU2YjJkNzgzZTc4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJLdEh6dU1yWitnOHZjSnB6UHJ4XC9YampOVUt5K1I1c3dVbWE5ZkF2eVV4TkRXNEcwRE9ES1JYR2NRajN4dGxaYyJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action 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] tests/pmdrss_hash: check reta_lines before verifying the result 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: , X-List-Received-Date: Sun, 11 Feb 2018 01:38:58 -0000 Thanks, Michael.=20 I'm fine with the logic refine, but variable "reta_lines" should better be = an argument of verify function than a global variable.=20 Could you please modify your patch? Regards, Marvin > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of michael.luo@intel.co= m > Sent: Thursday, February 08, 2018 6:58 PM > To: dts@dpdk.org > Subject: [dts] [PATCH] tests/pmdrss_hash: check reta_lines before > verifying the result >=20 > From: Luo Gaoliang >=20 > If reta_lines was empty, DTS shows the test case passed still. > So add the checking of reta_lines before verifying result. >=20 > Signed-off-by: Luo Gaoliang > --- > tests/TestSuite_pmdrss_hash.py | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/tests/TestSuite_pmdrss_hash.py > b/tests/TestSuite_pmdrss_hash.py > index 78e4075..7a1f870 100644 > --- a/tests/TestSuite_pmdrss_hash.py > +++ b/tests/TestSuite_pmdrss_hash.py > @@ -184,6 +184,7 @@ class TestPmdrssHash(TestCase): > global reta_lines > global reta_num > result =3D [] > + self.verify(len(reta_lines) > 0, 'No packet received!') > self.result_table_create( > ['packet index', 'hash value', 'hash index', 'queue id', > 'actual queue id', 'pass ']) >=20 > @@ -370,6 +371,8 @@ class TestPmdrssHash(TestCase): > item =3D item.strip() > if(item.startswith("RSS hash")): > name, value =3D item.split("=3D", 1) > + else: > + continue >=20 > reta_line[name.strip()] =3D value.strip() > reta_lines.append(reta_line) > @@ -384,6 +387,7 @@ class TestPmdrssHash(TestCase): > global reta_lines > global reta_num > result =3D [] > + self.verify(len(reta_lines) > 0, 'No packet received!') > self.result_table_create( > ['packet index', 'RSS hash', 'hash index', 'queue id', > 'actual queue id', 'pass ']) >=20 > -- > 2.7.4