From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 1BC771B757 for ; Thu, 8 Feb 2018 04:04:35 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Feb 2018 19:04:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,476,1511856000"; d="scan'208";a="172606190" Received: from nfvihost.sh.intel.com ([10.239.183.46]) by orsmga004.jf.intel.com with ESMTP; 07 Feb 2018 19:04:34 -0800 From: michael.luo@intel.com To: dts@dpdk.org Date: Thu, 8 Feb 2018 18:58:01 +0800 Message-Id: <1518087481-53786-1-git-send-email-michael.luo@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [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: Thu, 08 Feb 2018 03:04:36 -0000 From: Luo Gaoliang If reta_lines was empty, DTS shows the test case passed still. So add the checking of reta_lines before verifying result. Signed-off-by: Luo Gaoliang --- tests/TestSuite_pmdrss_hash.py | 4 ++++ 1 file changed, 4 insertions(+) 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 = [] + 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 ']) @@ -370,6 +371,8 @@ class TestPmdrssHash(TestCase): item = item.strip() if(item.startswith("RSS hash")): name, value = item.split("=", 1) + else: + continue reta_line[name.strip()] = value.strip() reta_lines.append(reta_line) @@ -384,6 +387,7 @@ class TestPmdrssHash(TestCase): global reta_lines global reta_num result = [] + 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 ']) -- 2.7.4